使用Selenium-Server-4.0.0-Alpha-2,用于Internet ExtplorerOptions类型的方法ntactoedgechrome()未定义
我想用 Selenium 测试 Edge 浏览器的 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);
我可以得到该方法的错误InternetExplorerOptions 中未定义 “attachToEdgeChrome()”
和 “withEdgeExecutablePath()”
。我在这里缺少什么吗?
注意:我的selenium jar是selenium-server-4.0.0-alpha-2.jar
I want test the IE mode for Edge browser with Selenium. I found the solution on the MS site here:
https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=java
I am using the following code as given in the above link:
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);
I can get the error that the methods "attachToEdgeChrome()"
and "withEdgeExecutablePath()"
are not defined in the InternetExplorerOptions. Is there anything I am missing here?
Note: My selenium jar is selenium-server-4.0.0-alpha-2.jar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 ChangeLogs 0f Selenium v4.0.0.0-alpha-2:
因此,理想情况下,文档中的代码块 使用 Internet Explorer 驱动程序在 Microsoft Edge 中自动执行 IE 模式 应该可以无缝运行。
但是,根据最佳实践,您应该始终首选
alpha
和beta
版本,而不是使用alpha
版本。 >GA 版本来执行您的测试,您可以从以下选项中挑选任何人:As per the ChangeLogs 0f Selenium v4.0.0.0-alpha-2:
So ideally, the code block from the documentation Use Internet Explorer Driver to automate IE mode in Microsoft Edge should have worked seamlessly.
However, as per best practices instead of using the
alpha
andbeta
releases, you should always prefer the GA releases to execute your tests and you can pickup anyone from the following options: