i
WebDriver Introduction
Selenium WebDriver Architecture
Introduction to WebDriver API
Introduction to WebDriver – Code
Handling Dropdowns and Select class
Handling Multiple Dropdown values and Links
Handling Radio buttons and Checkboxes
Capture Screenshots and Email test results
Browser Navigation Methods
Handling tabs
Capturing screenshot, Handling tabs and pop-ups – Code
Handling tabs and Pop-ups – Code
Handling Alerts
Handling User Authentication and Input alerts
HtmlUnitDriver and Handling Captchas
Handling Web Tables
Synchronization
Handling WebTables, Synchronization issues, Firefoxprofiles – Code
Actions Class
Event Listeners, Event Firing Mouse, Coordinates – Code
Handling Mouse Hover in Selenium
JavascriptExecutor
Handling Iframes
IsElementPresent, IsEnabled, IsSelected
Working with Chrome Driver - Part 1
Working with FireFox Driver - Part 2
Working with Internet Explorer Driver - Part 3
Handling SSL Certificate
Desired Capabilities
How to Encode password in WebDriver
Handling JQuery Elements - Drag and Drop, Sliders, Resizable
Handling JQuery Elements - Drag and Drop, Sliders, Resizable – Code
Working on IE Browser using Actions
TestNG, Ant & Report Generation through XSLT
Introduction to TestNG and Annotations
TestNG Parameterization
Configuring ANT, Generating TestNG & XSLT Reports
Code for generating XSLT / Surefire Reports through MAVEN
TestNG Parameterization Excel Reading
Handling Multiple data providers
TestNG XSLT Jar, Build.xml & TestNG.xml file
Frameworks Introduction
Hybrid (DATA + KEYWORD) driven Framework
Framework Architecture
Reading Excel sheets
TestNG DataProvider
Data Provider with Hashtable
Handling Multiple Test Suites
Multiple DataProviders
Setting up Run-modes at Suite Level
Setting up Runmodes at TestCase Level
Creating a common utility for Run-modes
Hybrid Framework Code
What is an SSL Certificate?
SSL (Secure Sockets Layer) helps in establishing a secure connection between client and server. SSL certificates ensure to transfer data securely using a digital signature. SSL certificate ensures the security of sensitive information like customer bank details, Credit card details as communication between server and client happens over an encrypted environment.
A web site having an SSL certificate always shows the https:// an “s” is added after the “http” to identify the web site as SSL secured site.
Communication between the Clients and Servers through SSL Certificates:
Let us see how a browser interacts with a server through SSL certificates:
In some cases, we face issues with the SSL certification expired or not valid anymore, then the browser starts showing error pages instead of expected web pages. Let us see how popular browsers show errors
We get such situations while writing the Selenium test scripts, and if any Web site SSL certificate is expired, our test suite gets failed without running a single test.
So, let us see how to handle the SSL errors in selenium script by using the DesiredCapabilities class of the Selenium package.
SSL Certification error Handling in the Chrome browser:
We can use the DesiredCapabilities class to set the capability to handle the SSL certificate error. Let us see the sample code below:
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SSLCertificationErrorHandling
{
public static void main( String[] args )
{
DesiredCapabilities cap=DesiredCapabilities.chrome();
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
WebDriver driver=new ChromeDriver(cap);
driver.get(webUrl);
}
}
SSL Certificate error resolution in IE web browser:
We can handle SSL certification error situation in IE browser by using DesiredCapabilities class as shown in the below sample code:
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SSLCertificationErrorHandling
{
public static void main( String[] args )
{
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability("ignoreProtectedModeSettings", true);
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
WebDriver driver=new InternetExplorerDriver(cap);
driver.get(webUrl);
}
}
SSL Certification error Handling in Firefox browser:
In Firefox, we need to follow below steps to handle SSL certification error:
FirefoxOptions options=new FirefoxOptions();
options.setCapability("acceptInsecureCerts", true);
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability(FirefoxOptions.FIREFOX_OPTIONS, options);
WebDriver driver=new FirefoxDriver(cap);
driver.get(WebUrl);
Let us see the complete sample code to handle the SSL certificate error in Firefox browser:
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SSLFirefox
{
public static void main( String[] args )
{
System.setProperty("webdriver.gecko.driver",driverPath);
FirefoxOptions options=new FirefoxOptions();
options.setCapability("acceptInsecureCerts", true);
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability(FirefoxOptions.FIREFOX_OPTIONS, options);
WebDriver driver=new FirefoxDriver(cap);
driver.get("https://hyperion-ui-test1.kubeodc-test.corp.intranet/#/home");
}
}
Note: As we do not have any web page available right now to produce SSL certification error, So I have kept the URL section as WebURL in the above examples.
Don't miss out!