找不到与硒3.8.1和gecko驱动程序0.19.0匹配的功能集 [英] Unable to find a matching set of capabilities with selenium 3.8.1 and gecko driver 0.19.0

查看:124
本文介绍了找不到与硒3.8.1和gecko驱动程序0.19.0匹配的功能集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Webdriver {

    public static void main(String[] args) throws InterruptedException {
        // TODO Auto-generated method stub


        System.setProperty("webdriver.gecko.driver", "C:\\Selenium\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        //System.setProperty("webdriver.chrome.driver","C:\\Selenium\\chromedriver.exe");
        //WebDriver driver = new ChromeDriver();

        driver.get("https://maps.mapmyindia.com");

        Thread.sleep(2000);
        driver.findElement(By.id("auto")).sendKeys("TCS");

        Thread.sleep(2000);
        driver.findElement(By.id("auto_geo")).click();

当我在eclipse luna上运行此代码时,出现错误:线程 main org中发生异常。 openqa.selenium.SessionNotCreatedException:无法找到匹配的功能集

When i run this code on eclipse luna there is an error: Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities

推荐答案

new FirefoxDriver(DesiredCapabilities caps); 

已过时,请使用

FirefoxOptions options = new FirefoxOptions();
options.setCapability("marionette", false);
WebDriver webDriver = new FirefoxDriver(options);

您很好,

这篇关于找不到与硒3.8.1和gecko驱动程序0.19.0匹配的功能集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆