package com.practiceCode;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
/**
* @Blog Name: Selenium Code Example
* @author Deepak Gupta
* @Created Date 17-10-2017
*
*/
public class DisableSSLCertificateInChromeBrowser {
WebDriver driver;
@BeforeTest
public void setUp() {
try {
// Handle https - Your connection is not private
DesiredCapabilities dc = DesiredCapabilities.chrome();
dc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") +
"/drivers/chromedriver.exe"); driver = new ChromeDriver(); } catch (Exception e) { e.printStackTrace(); } } @Test public void testDisableSSLCertificateInChromeBrowser() { driver.get("https://www.google.co.in"); } @AfterTest public void tearDown() throws InterruptedException { driver.quit(); } }
"/drivers/chromedriver.exe"); driver = new ChromeDriver(); } catch (Exception e) { e.printStackTrace(); } } @Test public void testDisableSSLCertificateInChromeBrowser() { driver.get("https://www.google.co.in"); } @AfterTest public void tearDown() throws InterruptedException { driver.quit(); } }
No comments:
Post a Comment