Srinivas
Srinivas

Reputation: 3

Webdriver: How to select anchor link under DIV?

In below code when I use //a[text()='My Process1' in Firebug it evaluates xpath and returns correctly, however when I try to use the same for finding an element using WebDriver I get NoSuchElement exception....any ideas what I might be doing wrong?

    <div class="abbd" style="">
    <ul class="New-type">
    <li class="abcmenuitem" id="yui-gen10" groupindex="0" index="3"><a href="#" class="abcmenuitemlabel">My Process1</a></li>
    <li class="abcmenuitem" id="yui-gen11" groupindex="0" index="4"><a href="#" class="abcmenuitemlabel">My Process2</a></li>
    </ul>

</div>

Upvotes: 0

Views: 1548

Answers (1)

ComfortablyNumb
ComfortablyNumb

Reputation: 3501

webDriver.findElment(By.linkText("My Process1"));

Upvotes: 2

Related Questions