I have tried and searched almost everything but still didn't find an answer to import a root CA into chromedriver while running my Selenium test.
Small background info: I am running regression tests with Selenium and chromedriver. My goal is to let these functional tests pass through Zed Attack Proxy. Since the webapplication uses https I need the Zed Attack proxy certificate imported in the chromedriver so it would trust Zed Attack Proxy to decrypt requests passing by.
FYI, this problem cannot be solved by ignoring-certificate-errors because this won't decrypt the requests but simply ignore it.
Any help is appreciated!
The only documentation I know of is https://github.com/SeleniumHQ/selenium/wiki/Untrusted-SSL-Certificates but that only covers firefox :/
I believe you can specify existing Firefox profiles with Selenium, so maybe you can do the same with Chromium ones? If so can you import the cert into a new profile 'manually' and then use that for your testing?
Update, I've also found this: https://unix.stackexchange.com/questions/122753/chrome-certificate :)
Related
When testing on opera browser with python selenium on browserstack I see the following certificate error
How can I bypass this with python selenium? I have tried adding the capability
desired_cap['acceptSslCerts']=True but that doesn't work.
As per the link, https://www.browserstack.com/automate/capabilities, I believe the correct way of setting 'acceptSslCerts' capability is('true' and not 'True'):
'acceptSslCerts' : 'true'
Let me know if that helps.
As Opera 20 and above uses the Windows certificate store, the warning can be bypassed.
If you want to use a unknown selfsigned certificate, you have to add it to Windows Trusted Root Certificates (But be careful using certificates without proofing they are really for the server!).
See: https://www.thewindowsclub.com/manage-trusted-root-certificates-windows
I am running automated UI tests using Chromedriver.
Tested site, requires authentication through p12 certificate. Once I open the page, certificate selection pop-up is displayed in Chrome.
I am aware of AutoSelectCertificateForUrls feature. However, I want to use different certificates, depending on the particular test case.
Is it possible to use an option --ssl-client-certificate-file
mentioned in thread https://sqa.stackexchange.com/a/18220/24148 with Chromedriver? I see that in the linked thread it is mentioned that it works only with PhantomJS, but maybe since the original post, it was implemented?
Using Selenium's WebDriver, with PhantomJSDriver, I am trying to do headless browser testing. It works fine when connected to internet WITHOUT a proxy. But when the connection to internet is via an authenticated proxy, it fails. I want to deploy this program to multiple user sites, which might be connected to internet with or without proxy, and in case of proxy, it might be authenticated or unauthenticated.
Is there a way to tell Selenium Webdriver to use the "current" browser's internet connection settings? Please note I am using phantomjs.
Thanks,
abbas
There is some more simple but very effective solution, that I've used when battling with similar issues an year ago.
Do you have these issues when using other *Drivers? If not - my proposal is to use your implementation of any other *Driver that works fine and after it passes authentication just cast it to PhantomJSDriver. Please note that is just possible workaround if your TestFramework hierarchy is built to support such an action.
In addition you can consider the following - when I used such Polymorphism the difference is speed. For FirefoxDriver and PhantomJSDriver it wasn't such a pain and if you can use it only for authentication it will not slow you down noticeable.
I'm not sure that I can help you with my solution, but it will not hurt to try it.
I have recently run into problems using the .NET version of Selenium Webdriver to run tests against a website running in a test environment where the SSL certificate does not match the hostname it’s served from.
To make Firefox accept the SSL certificate while it is controlled by Selenium, I have tried using firefoxProfile.SetPreference("browser.ssl_override_behavior", 1) and firefoxProfile.AcceptUntrustedCertificates but have not been successful.
Is there any other way I can resolve this problem?
Thanks in advance to anyone who can help,
Brett
the way we got around this was hacking local hosts file...
I am testing a web site which uses both http and https protocols depending on its configuration file.
I am writing my test cases in java.
My test cases are working fine for http but in https it generates a untrusted connection error.
I know i can avoid this using firefoxprofile manager but problem is that my test cases will be used on many machines to test this website and creating a profile on every machine is not possible
Is there any way to avoid getting this error so that my test cases works perfectly for both http and https.
You could try invoking the browser with -trustAllSSLCertificates clause.
Here's a code snippet:
BrowserConfigurationOptions bco = new BrowserConfigurationOptions();
bco.setCommandLineFlags("-trustAllSSLCertificates");
bco.setCommandLineFlags("-disable-web-security");
bco.setCommandLineFlags("-avoidProxy");
settings.setReuseBrowserSessions(true);
settings.setSingleWindow(true);
SeleniumServer seleniumserver=new SeleniumServer(settings);
seleniumserver.boot();
seleniumserver.start();
rs79's answer is a good start, but depending on your browser there are more steps you need to take. I wrote up a pretty comprehensive article on testing SSL in Selenium that you may want to check out:
http://mogotest.com/blog/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium