问题可能出在html的其余部分,您没有发布的部分。
在此示例中(我刚刚关闭了打开的标签):
<a ng-href="#/catalog/90d9650a36988e5d0136988f03ab000f/category/DATAbase_SERVERS/service/90cefc7a42b3d4df0142b52466810026" href="#/catalog/90d9650a36988e5d0136988f03ab000f/category/DATAbase_SERVERS/service/90cefc7a42b3d4df0142b52466810026"><div ><img ng-src="csa/images/library/Service_Design.png" src="csa/images/library/Service_Design.png"></div><div ><div > <p> <strong >Smoke Sequential</strong> </p> </div></div></a>
我可以轻松找到该元素:
driver.findElement(By.linkText("Smoke Sequential")).click();
如果元素内还有更多文本,则可以尝试通过部分链接文本查找:
driver.findElement(By.partiallinkText("Sequential")).click();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)