<div id="ContentPrimary">
<ul class="selectors modeSelectors">
<li><a href="/content/l411846326l1213g/references/" title="">
<span class="selector">References (27)</span></a></li>
<li><a href="/content/l411846326l1213g/referrers/" title="">
<span class="selector">Cited By (2)</span></a></li>
<li><a href="/content/l411846326l1213g/export-citation/" title="">
<span class="selector">Export Citation</span></a></li>
<li><a href="/content/l411846326l1213g/about/" title="">
<span class="selector">About</span></a></li>
</ul>
In this I need to find and click About link using Selenium api but I was unable to do it.
what I did is
wait.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver webDriver) {
System.out.println("Searching ...");
String s = driver.findElement(By.cssSelector("#ContentPrimary ul li[4] span.selector")).getText();
System.out.println(s);
if (Pattern.compile(Pattern.quote("About"), Pattern.CASE_INSENSITIVE).matcher(s).find()) {
return true;
} else {
return false;
}
}
});
driver.findElement(By.linkText("About")).click();
but its not working