Wednesday, March 7, 2012

IE/Chrome Driver code in Selenium 2.x

private WebDriver driver;

@Before
public void setUp() throws Exception {

DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
      ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
driver  = new InternetExplorerDriver(ieCapabilities);
}

--------------------


System.setProperty("webdriver.chrome.driver", "C:\\ChromeDriver\\chromedriver_win_19.0.1068.0\\chromedriver.exe");

driver = new ChromeDriver();

1 comment:

  1. Awesome post
    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It?s the old what goes around comes around routine. Did you acquired lots of links and I see lots of trackbacks??

    Big data online training

    ReplyDelete