【发布时间】:2019-05-19 14:40:30
【问题描述】:
请告知如何在以下代码中找到新业务标签的链接。我尝试了以下 xpath,但没有成功:
driver.findElement(By.linkText("NEW BUSINESS")).click
driver.findElement(By.xpath("//span[@class='hdBottomBar']/a[1]"))
HTML:
<span class="hdBottomBar">
<a class="hdTopBar" href="javascript: void navCntl('NewBusiness','NavBar');" onmouseover="window.status='New Business';return true" onmouseout="window.status='';return true" name="newBusiness">NEW BUSINESS</a>
【问题讨论】:
-
“它没用”是什么意思?请发布相关的错误信息等。还为您想要的语言添加标签... Java?
标签: java selenium-webdriver xpath css-selectors webdriverwait