selenium3 火狐浏览器加载插件方法

  1. 在浏览器属性-目标后加入如下字符:“ -no-remote -profilemanager”,保存设置后,运行浏览器会弹出用户配置文件设置窗口,可以看到所有配置的列表,也可自己新建
    1. 1 ProfilesIni pi = new ProfilesIni();
      2 FirefoxProfile profile = pi.getProfile("Default User");  //Default User 为浏览器用户配置名称
      System.setProperty("webdriver.gecko.driver","./geckodriver.exe"); 3 FirefoxOptions options = new FirefoxOptions(); 4 options.setProfile(profile); 5 WebDriver webdriver = new FirefoxDriver(options); 6 webdriver.get("http://www.baidu.com");
原文地址:https://www.cnblogs.com/test-researcher/p/9833216.html