0
为了方便起见,我希望Selenium Webdriver检查元素的顺序。我们选择元素的方式几乎总是用Xpath标识符来完成。Selenium Webdriver中元素字符串的测试元素顺序
检查下面的HTML代码:
<html>
<body>
<header>
This is the header
</header>
This is the body
<footer>
This is the footer
</footer>
</body>
</html>
我想要什么,使用Selenium的Java的webdriver(和XPath的)检查,如果确实是头至上,并然后页脚。
header = driver.findElement(By.xpath("//header"))
footer = driver.findElement(By.xpath("//footer"))
这怎么办?
我是否也可以在DOM视角中将字符串转换为页脚?一些东西在: driver.findElement(By.xpath(AAA))。findElement(By.xpath(“./ following-sibling::(''+ BBB +'')”)); 那会怎样? – user3356141 2014-11-05 09:36:15