How to launch chrome browser in selenium webdriver
In this Post I am going to cover below points:
- How to download Eclipse
- How to download selenium jars
- How to Download Chrome driver
- How to install selenium jar in eclipse
- Code snippet to launch chrome browser using selenium driver
Let's start:
1. How to download Eclipse:
i. Go to Eclipse official site
ii. Based on your machine configuration download Eclipse version
Simply unzip once the download is finished. And click on eclipse executable file (No installation is required)
2. How to download selenium jars:
i. Go to Selenium Official site
ii. Download Latest stable version of Selenium Standalone jar file
3. How to Download Chrome driver:
i. From the website where we download the selenium standalone server jar, Just scroll down to see browsers
Click on documentation under Chrome
Then download chromedriver based on chrome browser installed in your machine.
i. Now open Eclipse
ii. Right click on project and click on build path then Configure build path
iii. Now click on libraries and click on Add External JARs then add jar file and then click on Apply and close
5. Code snippet to launch chrome browser using selenium driver:
Below is the code snippet to launch chrome driver using selenium webdriver
package launch_browsers;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class LaunchChromeBrowser {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","chrome driver path");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
}
}
Watch below YouTube video to understand better.

Comments
Post a Comment