Raghav Arora : aroraglobalservices.blogspot.com
How to Configure Selenium WebDriver (Java)
1
Content
 Create a Project
 Configure Firefox
 Configure Chrome
 Configure Internet Explorer
 You must pre-download eclipse
March 29, 2014
2
How to Configure Selenium WebDriver (Java) |Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 Open eclipse
 Right click on Package Explorer > New > Java Project
March 29, 2014
3
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 Give a Project name and click Next
March 29, 2014
4
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 Go to Selenium downloads page and download Java Language bindings
 Extract it in your local drive
March 29, 2014
5
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 Right Click in your project > Properties
March 29, 2014
6
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 Java Build Path > Libraries
March 29, 2014
7
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 Click “Add Library..” button and add JAR files (include files in “libs” folder)
March 29, 2014
8
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Create a Project
 After import JAR files, you can see “Referenced Libraries” folder
March 29, 2014
9
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Configure Firefox
 Create new class file and enter following code
March 29, 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.com
March 29, 2014How to Configure Selenium WebDriver (Java) | Dasun Eranthika
11
 > 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
Configure Firefox
 Google opens through Firefox
March 29, 2014
12
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Configure Chrome
 Download chrome driver from selenium download page third party section
and extract it
March 29, 2014
13
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Configure Chrome
 Enter following code
March 29, 2014
14
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.com
Configure Chrome
 Google opens through Chrome
March 29, 2014
15
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Configure Internet Explorer
 Download Internet Explorer (IE) driver from selenium download page and
extract it.
March 29, 2014
16
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Configure Internet Explorer
 Enter following code
March 29, 2014
17
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.com
Configure Internet Explorer
 Google opens through IE
March 29, 2014
18
How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com
Code : Cross Browser
 Complete code
March 29, 2014
19
How to Configure Selenium WebDriver (Java) | Dasun Eranthika
aroraglobalservices.blogspot.com
20
“Back to Journey..”
I’m on….
March 29, 2014How to Configure Selenium WebDriver (Java) | Raghav Arora
aroraglobalservices.blogspot.com

Setup of project in web driver

  • 1.
    Raghav Arora :aroraglobalservices.blogspot.com How to Configure Selenium WebDriver (Java) 1
  • 2.
    Content  Create aProject  Configure Firefox  Configure Chrome  Configure Internet Explorer  You must pre-download eclipse March 29, 2014 2 How to Configure Selenium WebDriver (Java) |Raghav Arora aroraglobalservices.blogspot.com
  • 3.
    Create a Project Open eclipse  Right click on Package Explorer > New > Java Project March 29, 2014 3 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 4.
    Create a Project Give a Project name and click Next March 29, 2014 4 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 5.
    Create a Project Go to Selenium downloads page and download Java Language bindings  Extract it in your local drive March 29, 2014 5 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 6.
    Create a Project Right Click in your project > Properties March 29, 2014 6 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 7.
    Create a Project Java Build Path > Libraries March 29, 2014 7 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 8.
    Create a Project Click “Add Library..” button and add JAR files (include files in “libs” folder) March 29, 2014 8 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 9.
    Create a Project After import JAR files, you can see “Referenced Libraries” folder March 29, 2014 9 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 10.
    Configure Firefox  Createnew class file and enter following code March 29, 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.com
  • 11.
    March 29, 2014Howto Configure Selenium WebDriver (Java) | Dasun Eranthika 11  > 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
  • 12.
    Configure Firefox  Googleopens through Firefox March 29, 2014 12 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 13.
    Configure Chrome  Downloadchrome driver from selenium download page third party section and extract it March 29, 2014 13 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 14.
    Configure Chrome  Enterfollowing code March 29, 2014 14 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.com
  • 15.
    Configure Chrome  Googleopens through Chrome March 29, 2014 15 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 16.
    Configure Internet Explorer Download Internet Explorer (IE) driver from selenium download page and extract it. March 29, 2014 16 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 17.
    Configure Internet Explorer Enter following code March 29, 2014 17 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.com
  • 18.
    Configure Internet Explorer Google opens through IE March 29, 2014 18 How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com
  • 19.
    Code : CrossBrowser  Complete code March 29, 2014 19 How to Configure Selenium WebDriver (Java) | Dasun Eranthika aroraglobalservices.blogspot.com
  • 20.
    20 “Back to Journey..” I’mon…. March 29, 2014How to Configure Selenium WebDriver (Java) | Raghav Arora aroraglobalservices.blogspot.com