package com.selenium; import org.openqa.selenium.WebDriver; import java.io.File; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; public class MercuryTestCase { WebDriver driver ; @BeforeMethod public void lauchBrowser() { File fileDriver = new File("C:\\Krithi\\Cognizant\\Selenium\\Himanshu\\IEDriverServer_x64_2.25.3\\IEDriverServer.exe"); System.setProperty("webdriver.chrome.driver","C:/Krithi/Cognizant/Selenium/Himanshu/Session2/lib/chromedriver.exe"); //System.setProperty("webdriver.ie.driver",fileDriver.getAbsolutePath()); //driver = new InternetExplorerDriver(); //driver = new FirefoxDriver(); driver = new ChromeDriver(); driver.get("http://newtours.demoaut.com/mercuryregister.php"); } @AfterMethod public void closeBrowser() { //driver.close(); driver.quit(); } }