Creating the first script

Type the following code. What the following script does is simply opens a new Chrome browser and navigates to the URL http://www.google.com:

public class FirstTest {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver",
"C:\SeleniumWD\src\main\resources\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
}

Right-click the file and click Run as Java Application and hurrah! A chrome browser opens and http://www.google.com gets loaded.

You have successfully created your first Selenium Script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.119.251