package com.practiceCode;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
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 DisableInvalidExtensionInChromeBrowser {
WebDriver driver;
@BeforeTest
public void setUp() {
try {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") +
"/drivers/chromedriver.exe"); // Handle - disable the invalid Extension ChromeOptions options = new ChromeOptions(); options.addArguments("disable-infobars"); driver = new ChromeDriver(options); } catch (Exception e) { e.printStackTrace(); } } @Test public void testDisableInvalidExtensionInChromeBrowser() { driver.get("https://www.google.co.in"); } @AfterTest public void tearDown() throws InterruptedException { driver.quit(); } }
"/drivers/chromedriver.exe"); // Handle - disable the invalid Extension ChromeOptions options = new ChromeOptions(); options.addArguments("disable-infobars"); driver = new ChromeDriver(options); } catch (Exception e) { e.printStackTrace(); } } @Test public void testDisableInvalidExtensionInChromeBrowser() { driver.get("https://www.google.co.in"); } @AfterTest public void tearDown() throws InterruptedException { driver.quit(); } }
No comments:
Post a Comment