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

通常我们调用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

2、进入“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);

 

posted @ 2016-06-28 15:12  Ashely_An  阅读(233)  评论(0编辑  收藏  举报