有人可以帮助理解通过Selenide搜索元素的错误所在吗?
我有这样的HTML代码:
<div>
Current method:
<strong>
SMS
</strong>
</div>Selenium找到抛出此xpath的元素
findElement(By.xpath("//div[contains(. , \"Current method\")]/strong"))但是Selenide使用相同的定位器返回ElementNotFound异常
$(By.xpath("//div[contains(. , \"Current method\")]/strong"))发布于 2017-11-24 20:27:10
如果你需要健壮,你可以
$(By.xpath("//strong[contains(text(),'SMS')]"))发布于 2018-01-08 00:16:24
你可以给我们下面的选项。$(“strong:包含(‘SMS’)”);Using css selectors method
发布于 2017-11-08 21:08:42
您可以尝试:
$(byText("Current method:")).shouldBe(Condition.exist);https://stackoverflow.com/questions/47098883
复制相似问题