如果使用javascript每小时路径更改时,如何找到以下元素?
<a onclick="" href="javascript:validatePostBack('jspx_generated_8','sendActivationRequest','prepaidActivationForm','null','y',false)" name="jspx_generated_8" id="jspx_generated_8">
<img src="/extranet/images/req/accept.png">
</a>
答案 0 :(得分:1)
您可以使用CssSelector选择属性'href'包含'prepaidActivationForm'的元素。请参阅以下java代码:
WebElement aElement = driver.findElement(By.cssSelector("[href*='prepaidActivationForm']"));