通常我们调用firefox会使用以下的语句,但是打开的却是一个干净的firefox

//调用firefox浏览器

System.setProperty("webdriver.firefox.bin","C:\\Program Files (x86)\\Mozilla Firefox\\Firefox.exe");
WebDriver driver = new FirefoxDriver();

 

如何调用一个数据完整的firefox,操作如下:

1、win+R,打开运行;输入命令:firefox -ProfileManager

如何调用一个数据完整的firefox浏览器

2、进入“firefox-选择用户配置文件”,双击默认打开的配置文件,验证是否为具备完整数据的浏览器

如何调用一个数据完整的firefox浏览器

3、记住配置文件名,调用数据完整的firefox语句,如下:

// 调用使用的firefox
ProfilesIni profiles = new ProfilesIni();
FirefoxProfile myprofile = profiles.getProfile("default");

System.setProperty("webdriver.firefox.bin","C:\\Program Files (x86)\\Mozilla Firefox\\Firefox.exe");
WebDriver driver = new FirefoxDriver(myprofile);

 

相关文章:

  • 2021-07-22
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2021-07-05
  • 2021-11-27
  • 2021-12-02
  • 2021-05-22
  • 2021-11-19
相关资源
相似解决方案