我想用Selenium测试边缘浏览器的IE模式。我在MS站点上找到了解决方案:https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=java
我使用以下代码,如上面的链接所示:
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.attachToEdgeChrome();
ieOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
WebDriver driver = new InternetExplorerDriver(ieOptions);
我可以得到方法"attachToEdgeChrome()"
和"withEdgeExecutablePath()"
没有在InternetExplorerOptions中定义的错误。这里有我遗漏的东西吗?
注意事项:我的selenium jar是selenium-server-4.0.0-alpha-2.jar
发布于 2022-04-11 02:39:21
根据ChangeLogs 0f v4.0.0.0-α-2
因此,理想情况下,文档在Microsoft中使用Internet驱动程序自动实现IE模式中的代码块应该是无缝工作的。
但是,根据最佳实践而不是使用alpha
和beta
版本,您应该总是更喜欢GA版本来执行您的测试,并且您可以从以下选项中提取任何人:
https://stackoverflow.com/questions/71822475
复制相似问题