• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Steps to setup Selenium with Java to develop test scripts

Set up Selenium with Java

Precondition:- We need below files.

1) Eclipse

2) IDK7(or)JRE7

3) Selenium-Server –stand alone-2.39.0.jar

 

1) Eclipse:-It is an editer to develop the test scripts in Java.

2) JDK7(Or)JRE7:-

JDK-Java development kit

JRE-Java Runtime Environment

2To open Eclipse JDK or JRE should be installed in source machine.

2Check wheather JDK7 or JRE7 is installed in your machine by navigating to below path.

C:\program files /Java

2If JRE7 orJDK1.7 is not available in above path then take JDK7 Exe file from the given CD[mind Q] then install it.

3) Selenium-Server-Standalone-2.39.0.jar:-

2It is the actual selenium and it is a combination of RC, Web driver and Grid.

Note:-Eclipse & Selenium –Server-Standalone are normal files not necessary to install. Only JDK is to install. If not available

*We can download by using  internet web site Selenium w testing.com

3

Scripts

3

URL Eclipse

Accelerate your career with Selenium Training and become expertise Selenium developer.

1) Copy Eclipse and placed it in any desired drive

2) Create a folder with the name Lib or library in any desired drive.

3) Copy selenium –server-standalone-2.39.0.jar file pest it in Lib folder

4) check that JRE7(or)JDK 1.7 is available in C drive or not .If it is not available then install JDK7

5) Open  Eclipse by clicking on blue icon Eclipse.Exe

6) By default it provides some path in work space .If receive .We can update the path.

7) Workspace is the folder where it contains source code[Test scripts]

8) Click OK in workspace launcher window.

9) Click on Workbench to move into Eclipse.

10) Create a project by navigating to fileàNewàProject

11) Select Java project then click on Next

12) Give the project name as Selenium Automation  then click on Finish.

13) click Yes is open associated prospective window

14) Expand selenium Automation 2Right click of JRE system Lib2click on Build pathàselect configure build path.

15) click on Add external JAR  select selenium –server-standalone. Jar file from the Lib folder then click on open 2click on Ok

16) Go to Run 2click on External tool 2select external tool configuration.

17) Double click on program

18) click on Browse file system at location

19) select2C program file 2Java2JRE7àbinàjava.org

20) click on browse file system at working directory select Lib folder from the drive then click on OK.

E: Lib[it should contains selenium sever standard alone jar file]

21) Give the arguments as

–Jar selenium –server-standardalone-2.39.0.jar

|2click on OK2ApplyàRun

Note:-By default selenium will run on the port 4444.If resurveyed we can change the part

|2Go to Run 2click on external tool

3

External tool configuration

Update the arguments as

3

“Jar selenium –server-standalone-2.39.0.jar-port1234”

3

Click on apply2Run

2Write a program to search a selenium in Google.co.in

2Take a class by right click on the project click on New and select class

2Give the package name as “selenium RC”

Check out the top Selenium Interview Questions now!

Give the class name as “Google search”àName fired

 

Check the check box public static void min (string [] )

 

click finish

Package:-It is a folder name and it will be created under the SRC folder of project .The class will be created under the package.

Class:collection of objects is known as class. object can be anything provided it has to occupy some memory. Data types [variables] ,methods and instances are known as objects.

Public static void main:-  It is the Main method which is responsible for execution .The execution win start from main method .

2To take the element location or properties we have the bellow Add ons  available for on the browsers.

Fire fox  -firebug &inspection element

IE  -developer tool

G.chrome  -inspect element

Safari          –     inspect element

For an Indepth knowledge on Selenium, click on below

Summary
Review Date
Reviewed Item
Steps to setup Selenium with Java to develop test scripts
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Steps to setup Selenium with Java to develop test scripts"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.