Steps to setup Selenium with Java to develop test scripts

Ratings:
(4)
Views:0
Banner-Img
  • Share this blog:

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

If you want to enrich your career and become a professional in Selenium, then visit Tekslate
- a global online training platform: " Selenium  Training"  This course will help you to
achieve excellence in this domain.

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 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 checkbox public static void mai (string [] )  

click finish

Package:-It is a folder name and it will be created under the SRC folder of the 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 that 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

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox