Open eclipse
¨> Right click on Package Explorer > New > Java Project
¨> Give a Project name and click Next
¨> Go to Selenium downloads page and download Java Language bindings
¨> Extract it in your local drive
¨> Right Click in your project > Properties
¨> Java Build Path > Libraries
¨> Click “Add Library..” button and add JAR files (include files in “libs” folder)
¨> After import JAR files, you can see “Referenced Libraries” folder
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Setup of project in web driver
1. Raghav Arora : aroraglobalservices.blogspot.com
How to Configure Selenium WebDriver (Java)
1
2. Content
Create a Project
Configure Firefox
Configure Chrome
Configure Internet Explorer
You must pre-download eclipse
March 28, 2014
2
How to Configure Selenium WebDriver (Java) |Raghav Arora
aroraglobalservices.blogspot.co
m
3. Create a Project
Open eclipse
Right click on Package Explorer > New > Java Project
March 28, 2014
3
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
4. Create a Project
Give a Project name and click Next
March 28, 2014
4
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
5. Create a Project
Go to Selenium downloads page and download Java Language
bindings
Extract it in your local drive
March 28, 2014
5
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
6. Create a Project
Right Click in your project > Properties
March 28, 2014
6
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
7. Create a Project
Java Build Path > Libraries
March 28, 2014
7
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
8. Create a Project
Click “Add Library..” button and add JAR files (include files in “libs”
folder)
March 28, 2014
8
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
9. Create a Project
After import JAR files, you can see “Referenced Libraries” folder
March 28, 2014
9
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
10. Configure Firefox
Create new class file and enter following code
March 28, 2014
10
How to Configure Selenium WebDriver (Java) | Raghav Arora
import org.openqa.selenium.firefox.FirefoxDriver;
public class Uers {
public static void main(String[] args) {
FirefoxDriver fd = new FirefoxDriver();
fd.get("http:/google.lk");
}
}
Site URL
aroraglobalservices.blogspot.co
m
11. Configure Firefox
Google opens through Firefox
March 28, 2014
11
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
12. Configure Chrome
Download chrome driver from selenium download page third party
section and extract it
March 28, 2014
12
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
13. Configure Chrome
Enter following code
March 28, 2014
13
How to Configure Selenium WebDriver (Java) | Raghav Arora
import org.openqa.selenium.chrome.ChromeDriver;
public class Uers {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:Seleniumchromedriver.exe");
ChromeDriver cd= new ChromeDriver();
cd.get("http://google.lk");
}
}
Site URL
Location of chromedriver
aroraglobalservices.blogspot.co
m
14. Configure Chrome
Google opens through Chrome
March 28, 2014
14
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
15. Configure Internet Explorer
Download Internet Explorer (IE) driver from selenium download
page and extract it.
March 28, 2014
15
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
16. Configure Internet Explorer
Enter following code
March 28, 2014
16
How to Configure Selenium WebDriver (Java) | Raghav Arora
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Uers {
public static void main(String[] args) {
System.setProperty("webdriver.ie.driver", "C:SeleniumIEDriverServer.exe");
InternetExplorerDriver id= new InternetExplorerDriver();
id.get("http://google.lk");
}
}
Site URL Location of IEdriver
aroraglobalservices.blogspot.co
m
17. Configure Internet Explorer
Google opens through IE
March 28, 2014
17
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m
18. Code : Cross Browser
Complete code
March 28, 2014
18
How to Configure Selenium WebDriver (Java) | Dasun Eranthika
aroraglobalservices.blogspot.co
m
19. 19
“Back to Journey..”
I’m on….
March 28, 2014How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.co
m