如何在selenium webdriver中使用href查找元素?

时间:2018-03-02 05:43:07

标签: selenium-webdriver href

我想在selenium webdriver中使用href选择链接。 我不想使用linkText或部分linktext.I想要给href 下面是我的链接的检查元素

<a id="functionStart" onmouseover="this.style.color = '#48A533';" onkeyup="this.style.color = '#48A533';" onblur="this.style.color='#000000';" onmouseout="this.style.color='#000000';" href="newRegistration.action?currentStatusId=1nq4isv3kw1b23c5&amp;functionId=zay0hhnvin1b23c5&amp;roleGroupId=1x5ulxynnea10co0" style="margin-left: 10px; color: rgb(0, 0, 0); width: 170px; font-size: 11px; font-weight: bolder;">New Registration Application</a>

我试过了

driver.findElement(By.xpath(".//a[@href='unApprovedVehicles.action?
currentStatusId=ejdlwd08moa10co0&functionId=fg0lc76ibo1b23c5&roleGroupId=y2olyuttbv0000babe12a0']")).click();

0 个答案:

没有答案