Articles → SELENIUM → Create Your First Selenium Project
Create Your First Selenium Project
Webdriver Class
Create Your First Selenium Project
- Open Eclipse
- Click on File → New → Java Project
Click to Enlarge
- In the next window, enter the project name and click on ‘Finish’.
Click to Enlarge
- A Project is created in package explorer as shown in figure below
Click to Enlarge
- Next step is to add a package, right click on the project → New → Package
Click to Enlarge
- Enter the package name and click on ‘Finish’
Click to Enlarge
- Next step is to add a class. For doing that right click on the package → New → Class
Click to Enlarge
- Enter the class name and click on ‘Finish’
Click to Enlarge
- Next step is to configure path. For that right click on JRE System Library [JavaSE – 1.8] → Build path → Configure Build Path..
Click to Enlarge
- From the window, click on ‘Add External JARs..’.
Click to Enlarge
- Once you click on the button, a file dialog will open to select ‘selenium-server-standalone-2.53.1.jar’.
- Select the file and click on ‘Open’ and finally close the ‘Configure Build Path..’ window.
Download Iedriverserver
Click to Enlarge
Write Your First Selenium Code
package com.FirstSeleniumProject;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class MyClass {
public static void main(String[] args) {
WebDriver driver;
String service = "IEDriverServer.exe path";
System.setProperty("webdriver.ie.driver", service);
driver = new InternetExplorerDriver();
driver.get("http://google.com/");
}
}
Output
Click to Enlarge