笔记本电脑上的Firefox版本为71.0 (64-bit)
,操作系统为Windows10 64 byte
,我正在尝试通过驱动程序from this page(geckodriver-v0.26.0-win64.zip
)使用firefox运行自动化测试。
设置驱动程序的代码如下,它适用于chrome:
public Driver() {
//File file = new File("src/test/resources/driver/chromedriver.exe");
File file = new File("src/test/resources/driver/geckodriver.exe");
String driverPath=file.getAbsolutePath();
System.out.println("Webdriver is in path: "+driverPath);
//System.setProperty("webdriver.chrome.driver",driverPath);
System.setProperty("webdriver.gecko.driver",driverPath);
}
但是,当我使用Firefox运行代码时,它会抱怨:
org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'LAPTOP-R1MUDANH', ip: '192.168.178.49', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: Driver
我用:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
我该如何解决此问题?