以下是一组链接,<a elements. 只有其中一个链接有一个子字符串"long"作为属性href的值
<a class="c1" href= "very_lpng string" > name1 </a>
<a class="g2" href= "verylong string" > name2 </a> // The one that I need
<a class="g4" href= "very ling string" > name3 </a>
<a class="g5g" href= "very ng string" > name4 </a>
...................
Run Code Online (Sandbox Code Playgroud)
我需要单击其中href包含子字符串"long" 的链接.我怎样才能做到这一点?
PS:driver.findElement(By.partialLinkText("long")).click();// b/c它由名字选择