Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97778

Webdriver Automation - Unable to find element using xpath

$
0
0

Environment: Eclipse - Java - Junit - firefox webdriver

Screen shot url : https://www.dropbox.com/s/26fl2l1y1mkpxiz/Screenshot%202014-01-06%2001.52.43.png

I am trying to test a webpage but unable to find element (looks like a button). Firebug xpath is :.//*[@id='DERIVED_REGFRM1_LINK_ADD_ENRL$118$']

With the same Xpath, it works correctly with selenium IDE (By recording).

It's html code is:

<td valign="top" align="left">
    <div id="win0divDERIVED_REGFRM1_LINK_ADD_ENRL$118$">
        <span class="SSSBUTTON_CONFIRMLINK" title="Enroll in Classes">
            <a id="DERIVED_REGFRM1_LINK_ADD_ENRL$118$" class="SSSBUTTON_CONFIRMLINK" 
            href="javascript:submitAction_win0(document.win0,
    'DERIVED_REGFRM1_LINK_ADD_ENRL$118$');" 
    tabindex="192" ptlinktgt="pt_peoplecode" 
    name="DERIVED_REGFRM1_LINK_ADD_ENRL$118$">Proceed to Step 2 of 3</a>
        </span>
    </div>
</td>

I have tried my finding By.xpath, id, etc. eg: driver.findElement(By.xpath("//*[@id='DERIVED_REGFRM1_LINK_ADD_ENRL$118$'] ")).click();

What is the correct solution?


Viewing all articles
Browse latest Browse all 97778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>