I am just trying to figure out if anyone else has seen their Selenium tests run significantly slower (takes 2+ minutes to start) when they load a profile into the FirefoxDriver as shown in: Selenium a default profile for the Firefox
The question originator of the above post mentioned this issue in a comment, but never updated whether he fixed this slowness issue.
At some point my tests stopped running all together and I started getting the error
org.openqa.selenium.WebDriverException: java.io.Exception: unexpected end of stream on Connection.
If I remove the profile option from the FirefoxDriver call then the test runs within 5 seconds of selecting "RUN" but the test fails because the default profile Selenium uses does not have the certificates I need to access my site.
Anyone else in the same boat or know how to fix this? How do you adjust how much information is saved within a profile?
- Firefox Version: 60.3.0
- Selenium Version: 3.14.0
- GeckoDriver Version: 0.23.0
- OS: Linux Redhat 6
- Eclipse Version: Neon
Code:
WebDriver browser;
System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver.exe");
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.get("SeleniumUser");
FirefoxOptions options = new FirefoxOptions().setProfile(ffprofile);
browser = new FirefoxDriver(options); // takes a long time and eventually fails here
browser.get("site.url");
If you take out the {options} parameter from the new FirefoxDriver() call the test will start in about 5 seconds. Keeping the options causes the error "org.openqa.selenium.WebDriverException: java.io.Exception: unexpected end of stream on Connection" as stated above.