Security (SSL) Certificates are tricky to automate because each browser prompts its warning differently. Because Test Studio only records in Internet Explorer, the "Continue to this website" link pictured below is recorded and expected to pass when executed in IE. That specific link does not exist in the other browsers, so we expect the test to fail at that step in Firefox, Safari, and Chrome.
Click a thumbnail to see that browser's Certificate Warning:
There are a few work-arounds to consider:
- Change the browser settings to not prompt for certificates. In Firefox this setting is located under:
Add a Manual Step. This will require the tester to manually accept the certificate during test execution and then press OK on the Manual Step dialog to continue. You can set the Manual Step's "RunsAgainst" property to "FirefoxOnly" and set the step that clicks the link in the image above to "InternetExplorerOnly". This way, executing in IE remains automated and only executing in an alternative browser requires manual intervention. Add a Coded Step. The code will perform different actions (such as mouse clicks and/or key presses) based on which browser is used. This will handle the different Certificate screens you encounter across browsers. Here's an example for Chrome:
- Tools > Options > Advanced > Encryption > Certificates > Select one automatically
(ActiveBrowser.BrowserType == BrowserType.Chrome)
ActiveBrowser.BrowserType = BrowserType.Chrome
Ensure you Add an Assembly Reference to System.Windows.Forms.