How to create profile in Firefox using Selenium WebDriver

前端 未结 5 720
独厮守ぢ
独厮守ぢ 2021-01-05 07:18

When we write something like this:

FirefoxProfile ffprofile = new FirefoxProfile(new File(\"D:\\\\Selenium\"));

Does it mean we are creatin

5条回答
  •  一生所求
    2021-01-05 08:11

    Here is how I do by selenium 3 with geckodriver:

    • Use firefox command line interface to create profile

      firefox.exe -CreateProfile "profile_name profile_dir" (In java, execute this runtime by Runtime.getRuntime().exec function)

    • Set -profile argument in firefox options

      FirefoxOptions options = new FirefoxOptions();
      options.addArguments("-profile", );
      driver = new FirefoxDriver(options);
      

提交回复
热议问题