尝试使用边缘驱动程序启动硒测试并获得异常
一切都可以在firefox和chrome上正常运行,但是我无法管理它以启动edge(版本77.0.223.0(正式版本)开发人员(64位))。
这是我的考试课程
class EdgeTest {
private static String binaryPath;
private WebDriver driver;
@BeforeEach
public void setupTest() {
WebDriverManager.edgedriver().setup();
binaryPath = WebDriverManager.edgedriver().getBinaryPath();
WebDriverManager.edgedriver().browserPath("C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe\")");
System.setProperty("webdriver.edge.driver", binaryPath);
driver = new EdgeDriver();
}
@After
public void teardown() {
if (driver != null) {
driver.quit();
}
}
@Test
public void test() {
// Your test code here. For example:
WebDriverWait wait = new WebDriverWait(driver, 30);
driver.get("https://en.wikipedia.org/wiki/Main_Page");
}
这是我得到的例外:
org.openqa.selenium.WebDriverException: unknown error: cannot find Microsoft Edge binary
Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:09:30'
System info: host: 'IRVING', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212'
Driver info: driver.version: EdgeDriver
remote stacktrace: Backtrace:
Ordinal0 [0x00007FF7845DD422+1823778]
Ordinal0 [0x00007FF7845457B2+1202098]
并记录
14:46:46.411 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Edge Dev (based on Chromium) version 77 found
14:46:46.415 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver for edge77 not found in local properties
14:46:46.668 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - The driver version for Microsoft Edge 77 is unknown ... trying with latest
14:46:46.669 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Reading https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ to find out the latest version of Edge driver
14:46:47.050 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Latest version of Edge driver is 77.0.229.0
14:46:47.060 [main] INFO io.github.bonigarcia.wdm.Downloader - Using binary driver previously downloaded
14:46:47.060 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.edge.driver as C:\Users\cseegraef\.m2\repository\webdriver\edgedriver\win64\x64\77.0.229.0\msedgedriver.exe
Previous : 1.8.0_212-b03
Starting MSEdgeDriver 77.0.229.0 (219d9c8b098bc5511828863cd68c4e880c69814b) on port 46356
Only local connections are allowed.
Please protect ports used by the WebDriver and related test frameworks to prevent access by malicious code.
感谢您的帮助或信息。