Lec 1 || Launching Chrome Browser || Selenium-Java
In this tutorial you will learn how to open/ launch Chrome browser in selenium once after you have setup your selenium environment in eclipse IDE. Following are the steps to open Chrome web browser and launching any url (http:\\google.com) in it.
1. Create a Java Project.
2. Create a package.
3. Create a class.
4. follow the steps as mentioned in the program below.
Script
package seleniumQA;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Day1 {
public static void main(String[] args) {
// Set browser property eg. browser and its webdriver loctation on your
hard drive
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Arun Datt Kaushik\\Downloads\\Selenium\\chromedriver.exe");
//Launching browser
WebDriver driver = new ChromeDriver();
//Launching url in browser
driver.get("https://www.google.com");
}
}
No comments:
Post a Comment