I am trying to select a menu item…though xpath validates well in Xpath checker, it does not work from WebDriver …can someone help?
I get Unable to locate element: {“method”:”xpath”,”selector”:”//a[contains(text(),’Start Loan Process’)]”}
HMTL looks something like this
<div class="bd">
<ul class="first-of-type">
<li id="yui-gen7" class="yuimenuitem first-of-type" groupindex="0" index="0">
<li id="yui-gen8" class="yuimenuitem" groupindex="0" index="1">
<li id="yui-gen9" class="yuimenuitem" groupindex="0" index="2">
<li id="yui-gen10" class="yuimenuitem" groupindex="0" index="3">
<li id="yui-gen11" class="yuimenuitem" groupindex="0" index="4">
<a class="yuimenuitemlabel" href="#">Start Loan Process</a>
On the other hand you can also try to use findElementsBy(By.classname(“yuimenuitemlabel”))
Get them to list of web elements and then filter it using webelement.getText() method.