Use Firefoxprofile,selenium to set Firefox, initialize Firefox

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.