Hi Guys,
Here is my page source.
<ul id="ClaimTabbedPanelsTabGroup_ul" class="TabbedPanelsTabGroup">
<li id="data_li" class="TabbedPanelsTab" tabindex="0" onclick="javascript:showLoader('0');tabSubmit('summary.do?hdn_button=Summary')">
Apple
</li>
<li id="data_li" class="TabbedPanelsTab" tabindex="0" onclick="javascript:showLoader('1');tabSubmit('documentsimages.do?hdn_button=Documents')">
Mango
</li>
<li id="data_li" class="TabbedPanelsTab" tabindex="0" onclick="javascript:showLoader('2');tabSubmit('documentsimages.do?hdn_button=Images')">
Peach
</li>
<li id="data_li" class="TabbedPanelsTab" tabindex="0">
Orange
</li>
</ul>
I want to get the link webelements through their innertext which are Apple, Mango etc.
When I provided the expression - $$("li:contains('Apple')") in the Chrome console it resulted in - SyntaxError: An invalid or illegal string was specified
Similarly I tried a few expressions with the 'contains' but none of them worked.
The only thing which works is $$("#data_li:nth-child(1)") but I don't want to do this just because my selenium scripts would break if the indices of these links are altered by the Dev. Any suggestions?