"Forward" Webdriver run test using custom Firefox profile

Source: Internet
Author: User

Click to go to forwarding address:

Generally we use the following code to start Firefox:

Java codeWebdriver Driver = new Firefoxdriver ()

This way selenium server-initiated Firefox will be a brand new, without installing any add-on Firefox.

If necessary, we can use our own designated Firefox with a specific configuration. The steps are as follows

    1. Run cmd to open the Firefox Profile Manager
    2. Click "Create profile ..." To complete the steps, including entering the profile name
    3. Click "Start Firefox"
    4. Install your add-on or other configuration in a new Firefox startup


Finally, start firefoxdriver using the following method in your code:

Java code
    1. Profilesini allprofiles = new Profilesini ();
    2. "Selenium" is the new profile just created
    3. Firefoxprofile profile = Allprofiles.getprofile ("Selenium");
    4. Webdriver Driver = new Firefoxdriver (profile);

I installed Firebug in selenium profile and then started the profile with a script to see the installed Firebug.

In addition we can see the manager has a default, this is our own normal use of the Firefox profile, but also can be used in the code.

"Forward" Webdriver run test using custom Firefox profile

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.