Home > Test Automation > Open saved profiles in Firefox – Selenium (WebDriver)

Open saved profiles in Firefox – Selenium (WebDriver)

Hello, I will put the code that you need for open some saved profile in Firefox with Selenium.

ProfilesIni profilesIni = new ProfilesIni();
FirefoxProfile profile = profilesIni.getProfile(“default“); //This is the name of profile, you can find this in the folder of firefox profiles.
WebDriver driver = new FirefoxDriver(profile);
 
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); // Only necessary if you have invalid certificates in the page
                
profile.setPreference(“network.proxy.type”, 0); // open without proxy
profile.setAcceptUntrustedCertificates(true); // Only necessary if you have invalid certificates in the page
profile.setAssumeUntrustedCertificateIssuer(false); // Only necessary if you have invalid certificates in the page
 
I use this way for open a saved profile that contains a personal certificate. I needed open 
a page with this certificate installed.
 
Bye bye 🙂
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: