Tuesday, 8 November 2016

How to use chrome browser in selenium webdriver script

Hi folks
Today we will see how we can use chrome browser in selenium .With this we can also use internet explorer.
Here’s the code
import org.openqa.selenium.chrome.ChromeDriver;
public class usingchrome{
public static void main(String[] args) {
WebDriver driver;
driver=new ChromeDriver();
driver.get(“any website name”);
In setProperty first parameter will be like “webdriver.chrome.driver” for chrome and “webdriver.ie.driver” for internet explorer
and second parameter will be the path of the driver where it is located.