0% found this document useful (0 votes)
68 views

Webdriver Configuration For Java

This document provides instructions for configuring the Java development environment for WebDriver automation testing. It outlines downloading and installing the required tools like JDK, Eclipse IDE, Selenium, TestNG, and ChromeDriver. It then describes the steps to configure Eclipse with these tools by creating a project, adding external JAR files, and including a sample test class to launch Chrome browser for testing.

Uploaded by

Ascertia Pk
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Webdriver Configuration For Java

This document provides instructions for configuring the Java development environment for WebDriver automation testing. It outlines downloading and installing the required tools like JDK, Eclipse IDE, Selenium, TestNG, and ChromeDriver. It then describes the steps to configure Eclipse with these tools by creating a project, adding external JAR files, and including a sample test class to launch Chrome browser for testing.

Uploaded by

Ascertia Pk
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

WEBDRIVER CONFIGURATION FOR JAVA

Tools required for automation using java language.

1. Latest JDK (Java SE Development Kit)


http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Eclipse IDE for Java Developers
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/mars2
3. Selenium Tool
http://www.seleniumhq.org/download/
4. Testng Jar file
http://www.java2s.com/Code/Jar/t/Downloadtestng685jar.htm
5. Jcommander jar file
http://www.java2s.com/Code/Jar/j/Downloadjcommanderjar.htm
6. Chrome Driver win32
https://chromedriver.storage.googleapis.com/index.html?path=2.29/
7. Gecko Driver for Fire Fox win32
https://github.com/mozilla/geckodriver/releases

Please use the following steps one by one to configure Eclipse with Web Driver.

1. Install JDK
a. Double click on jdk exe file and follow wizard.
b. Go to Environment Variables screen

Add User Variable with the variable value where you install the jdk.
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.8.0_131

Go to System Variables section and select Path variable. In path variable past the path of
your installed jdk till bin foler. For Example
“C:\Program Files\Java\jdk1.8.0_131\bin”
c. To check that JDK successfully installed. Open command prompt and type “javac” and
hit enter.
2. Download and double click on Eclipse to open it.
a. Create a new java project using following steps
File > New > Java Project
b. Add Package in src folder
New > Package
c. Add Package name with following convention
com.selenium.configuration.test
3. Add Testng Adson in Eclipse using following steps.
a. Go to Help > Eclipse Marketplace
b. Find TestNG for Eclipse and install it.
c. After installation restart the Eclipse
4. Add Selenium Jar files in the Project using following steps.
a. Download Selenium, TestNG and JCommander jar files.
b. Extract them into a folder.
c. Add them into main project
Left Click on project > Build Path > Configuration Build Path > Java Build Paht > Libraries
> Add External JARs > Select All Jar files > Click Ok

Now you have successfully created java environment.

To test the environment use the following steps.

1. Create a class name “InvokeChrome” in src > com.selenium.configuration.test package


2. Replace the code with the following one

package com.selenium.configuration.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

public class InvokeChrome {

public WebDriver driver;

@Test
public void ChromeProgram()
{
System.setProperty("webdriver.chrome.driver",
"F:\\Automation\\chromedriver.exe");

driver = new ChromeDriver();


driver.manage().window().maximize();
}
}

You might also like