The following is a bunch of links <a >element. Only one of them has a substring "long" as a value for the attribute href.
<a class="g1" href= "very_lpng string" > name1 </a>
<a class="g2" href= "verylong string" > name2 </a> // I need this one
<a class="g3" href= "very ling string" > name3 </a>
<a class="g4" href= "very ng string" > name4 </a>
I need to click the link whose href has substring "long" in it. How can I do this?
driver.findElement(By.partialLinkText("long")).click(); // because it chooses by the name