1. What is Firefoxprofile
Simple is personal customization, such as you set your own access to the homepage, disable the loading of pictures of these personalized settings, can be saved to a folder, is Firefoxprofile, the next time you use, load the Firefoxprofile, You can make your Firefox settings the same as the previous configuration
2, why selenium to use Firefoxprofile
When we automated tests, we sometimes did not need to load the pictures, improve the speed of the browser loading, so as to improve the execution speed of the script. In addition, in some poor network environment, disable CSS, pictures and other loading can improve the speed of access
Method:
1. Create your own Firefoxprofile
Close all Filefox browsing Windows-"Run Firefox Manager, click Windows" Start "and" Run ", then enter Firefox.exe-profilemanagerin the input box, click" OK "button- To create a new profile, simply click on the "Create Profile" button and enter the configuration file name in the wizard window that appears.
Now create a standalone Firefox profile that launches the profile Firefox
Create a new BAT file, enter the command line
Set moz_no_remote=1
Start "" "C:\Program Files\Mozilla Firefox formal\firefox.exe"-P firefoxprofile file name
In the newly opened browser, you can set Firefox at will, these settings are saved in your personalized Firefoxprofile
2. Now call Firefoxprofile with Selenium
Firefox_profile = Webdriver. Firefoxprofile ("D:\Downloads")
Browser = Webdriver. Firefox (Firefox_profile=firefox_profile)
The D:\Downloads path holds me Firefoxprofile
Use Firefoxprofile,selenium to set Firefox, initialize Firefox