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 🙂

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.