![](/img/trans.png)
[英]XPath/CSS/Locators to select title radio button option using WebDriver
[英]Webdriver CSS locators suddenly stopped working on IE11, while xpath locators do work
突然,webdriver CSS定位器停止在我的代码中工作。 (他们几天前在工作)
当我打开IE 11的开发人员工具时(通过在Internet Explorer中按F12键),我看到一个普遍错误,提示“ InvalidSelectorError:指定了无效或非法的选择器”,但它没有向我显示定位器本身
有没有办法在开发人员工具上测试CSS定位器,或检查IE看到了什么?
我通过的命令非常简单:
wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("span:contains('Information')")));
:contains
不是CSS3的一部分。
请参阅https://www.w3.org/TR/css3-selectors/#selectors
您可以尝试By.cssSelector("span[innertext='Information']")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.