启动firefox浏览器时加载扩展。显示错误构造函数FirefoxDriver(FirefoxProfile)未定义

时间:2019-06-11 06:07:29

标签: selenium web driver

我收到错误消息“未定义构造函数FirefoxDriver(FirefoxProfile)”

if(data.equals(“ Mozilla”)){             // driver = new FirefoxDriver();             System.setProperty(“ webdriver.gecko.driver”,System.getProperty(“ user.dir”)+“ /geckodriver.exe”);             // FirefoxOptions options = new FirefoxOptions();             字符串fileName = System.getProperty(“ user.dir”)+“ //Nimbus-Screenshot-&-Screen-Video-Recorder_v8.8.1”;             FirefoxProfile配置文件=新的FirefoxProfile();

        try {
            profile.addExtension(new File(fileName));
            // Add more FF addons if required
        } catch (Exception e) {

        }

        driver = new FirefoxDriver(profile); // Here I am getting an error
        //driver = new FirefoxDriver(options);
        driver.manage().window().maximize();

    }

以下是附件 enter image description here

enter image description here

0 个答案:

没有答案