How to create profile in Firefox using Selenium WebDriver

前端 未结 5 723
独厮守ぢ
独厮守ぢ 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 07:54

    Following code will create firefox profile (based on provided file) and create a new FF webdriver instance with this profile loaded:

    FirefoxProfile profile = new FirefoxProfile(new File("D:\\Selenium Profile"));                  
    WebDriver driver = new FirefoxDriver(profile);
    

    Maybe take a look on the official support page for FF profile manager or here: Custom Firefox profile for Selenium to get some idea on FF profiles.

提交回复
热议问题