Security Certificates
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.
Internet Explorer
Chrome
FireFox
Safari
Solution
There are a few workarounds to consider:
Register Certificate for HTTPS Connection.
-
Change the browser settings to not prompt for certificates. In Firefox this setting is located under:
- Tools > Options > Advanced > Encryption > Certificates > Select one automatically
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:
if (ActiveBrowser.BrowserType == BrowserType.Chrome)
{
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Space);
}
If ActiveBrowser.BrowserType = BrowserType.Chrome Then
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab)
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Space)
End If