Handling SSL Certificates Errors with Selenium WebDriver
Below are some of the sample SSL Certificate errors
- Firefox
2. IE
3. Chrome
How do we bypass these pages through selenium webdriver.
Its handled using the DesiredCapabilities class and setting up the Capability for handling SSL Error as below.
DesiredCapabilities capability = DesiredCapabilities.chrome(); // To Accept SSL certificate capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Then later pass the ‘capability’ object to the driver constructors as below.
- Firefox :
FirefoxDriver driver =new FirefoxDriver(capability);
2. Chrome :
System.setProperty(“webdriver.chrome.driver”, “E:/chromedriver.exe”);
ChromeDriver driver = new ChromeDriver(capability);
3. IE :
System.setProperty(“webdriver.ie.driver”, “E:/IEDriverServer.exe”);
InternetExplorerDriver driver = new InternetExplorerDriver(capability);
Hello Shama,
ReplyDeleteThe Article on Handling SSL Certificates Errors with Selenium WebDriver is nice give detail information about it.Thanks for Sharing the information about SSL Certificates. Software Testing Services
Really good information to show through this blog. I really appreciate you for all the valuable information that you are providing us through your blog.
ReplyDeletePen testing services
Vulnerability assessment services
Load Testing Services
Mobile app testing services