java - Selenium clicking on javascript link -


i'm having issue writing selenium test using java , spring.

i need selenium click on delete button on page contains multiple delete buttons (a list of files). using selenium ide generates following code

selenium.click("link=delete");

which useless. haven't been able figure out how target specific element contained in table. here's source:

<tr onmouseover="mouseover(this)" onmouseout="mouseout(this)">   <td class="thumbnail" align="center"><img src="/services/images/nav/resources.gif" /></td>   <td colspan="3" onclick="nav('filename'); return false">     <a href="javascript:nav('filename')">basics</a></td>  <td>    <a class="actionbutton" href="javascript:del('filename')">delete</a></td> <td>&nbsp;</td> </tr>    

i need either a) find way return xpath of correct delete action or b) send javascript command through java code. haven't been able figure out how to either, can point me in right direction?

is "filename" part unique?

if so, appropriate xpath be:

selenium.click("//a[@href=\"javascript:del('filename')\"") 

also, did click first delete link selenium ide? if so, try clicking on 1 of subsequent ones instead , see comes with.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -