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
- Run cmd to open the Firefox Profile Manager
- Click "Create profile ..." To complete the steps, including entering the profile name
- Click "Start Firefox"
- Install your add-on or other configuration in a new Firefox startup
Finally, start firefoxdriver using the following method in your code:
Java code
- Profilesini allprofiles = new Profilesini ();
- "Selenium" is the new profile just created
- Firefoxprofile profile = Allprofiles.getprofile ("Selenium");
- 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