3 Replies Last post: Nov 20, 2008 9:50 AM by Wayne Richards  
Wayne Richards Beginner 21 posts since
Nov 20, 2008
Currently Being Moderated

Nov 20, 2008 6:34 AM

Problems clicking Javascript link

Hi All,

 

I am trying to get Selenium ide 1.0b2 to click a link on a pop up window, the windows contains a html table with each datarow containing a html link which fires some javascript.  Below is an example of a row in the which contains the link I am trying to click on.

 

<tr style="">

<td class="field-string">
<a href="JavaScript: SelectItem( '7141','Boss Hogg','Line_Manager_Employee_ID');">Boss Hogg</a>
</td>
<td class="field-string">RDD</td>
</tr>

I am trying to use a click command to click on the link, ide records the command as
<tr>

    <td>clickAndWait</td>
    <td>link=Boss Hogg</td>
    <td></td>
</tr>

 


using the above it just hangs at the clickandwait command, if I change it to a plain click command it passes the test but does not actually click the link on the page.  I have tried selecting the link using xpath generated from Xpath Checker with the same result.

 

Any help would be greatly appreciated

 

Regards

 

Wayne

gim_h Almighty 736 posts since
Oct 17, 2007
Currently Being Moderated
1. Nov 20, 2008 7:18 AM in response to: Wayne Richards
Re: Problems clicking Javascript link

selenium doesn't support pseudo-url, moreover pseudo-url is not a recommended usage by w3c http://www.w3.org/WAI/GL/WCAG20/WD-WCAG20-HTML-TECHS-20041008/#js-url

the workaround is change href="javascript:...."  to onclick="javascript:...", and then click the link

you can use selenium to make the change.

More Like This

  • Retrieving data ...