Beruflich Dokumente
Kultur Dokumente
Page 1 of 16
So, In order to govern the same origin policy without the need of making a separate copy of
Application under test on the Selenium Core, Selenium Remote Control was introduced. While
Jason Huggins was demoing Selenium, another fellow colleague at ThoughtWorks named Paul
Hammant suggested a work around of same origin policy and a tool that can be wired up with a
programming language of our choice. Thus Selenium RC came into existence.
Unlike selenium IDE, selenium RC supports a wide range of browsers and platforms.
Workflow Description
Selenium server deciphers and converts the test commands into JavaScript commands
and sends them to the browser.
Browser executes the commands using selenium core and sends results back to the
selenium server
Page 3 of 16
When all these packages are downloaded install first Java JDK. After install setup the
Environment
variables
(java
home,
path).
After that extract Eclipse to folder C:\ECLIPSE
After Eclipse, extract Selenium RC and Selenium Client Drivers to folder C:\SELENIUM
Page 4 of 16
Navigate url:https://www.eclipse.org/downloads/download.php?file=/oomph/epp/neon/R/eclipseinst-win64.exe
The next step is launching Eclipse(execute eclipse.exe from eclipse folder). After few seconds
there will be displayed a window. Here You can create a Workspace. Click on Browse and select
Your work location, make new folder (i.e. C:\ Selenium_JUnit) and click OK.
Page 5 of 16
Now You will be navigated to the Eclipse home screen. Click on Workbench
Page 6 of 16
The next step is Project creation. Click on File -> New -> Project. In wizard click on Java ->
Java Project. Click on Next.
On next screen fill the Project Name field, select Use default JRE and click on Finish.
After click on Finish, the Project will be created. On next window click on Yes and Your project
will be displayed at the left side.
By expanding the project the there will be displayed default src folder and under this folder
another folder JRE System Library. Here are listed the JRE system library files associated to
the project.
Next step is configuring the Selenium Client driver to this Project. Right Click on created project
at the left side. On new window select Build Path -> Configure Build Path. Click on Libraries tab
Page 7 of 16
and
after
click
on
Add
External
JARs
button.
Select Selenium Client Drivers from C:\SELENIUM folder (Selenium Server JAR file
should not be added) and Click on OK button. Now the build path is configured and the project
is ready to be used.
Right Click on src in package explorer and select New -> Other- > Java- > Package and
click on Next.
On next window You will create a new Java package. Enter Your package name into Name field
and click on Finish.
Page 8 of 16
The package is created and listed in explorer at the left side under the folder src.
Next step is adding a java class. Right Click on Package in package explorer and select New ->
Other > Java -> Class.
Click on the Next button and on next window fill the Name field and click on Finish. The .java
file is created.
Page 9 of 16
After
creation
of
first
class
or
test
run
selenium
server
from
Later write sample program to launch browser and site like below and execute
Page 10 of 16
cmd
prompt,
Page 11 of 16
Selenium Grid
With selenium RC, life of a tester has always been positive and favorable until the emerging
trends raised a demand to execute same or different test scripts on multiple platforms and
browsers concurrently so as to achieve distributed test execution, testing under different
environments and saving execution time remarkably. Thus, catering these requirements selenium
grid was brought into the picture.
Selenium Grid was introduced by Pat Lightbody in order to address the need for executing the
test suites on multiple platforms simultaneously.
Eclipse IDE should be installed in your computer. Please see Download and Install Eclipse to
setup Eclipse to you system.
Steps to follow:
1) Launch the Eclipse IDE and from Help menu, click Install New Software.
3) Type name as you wish, lets take TestNG and type http://beust.com/eclipse/ as location.
Click OK.
Page 13 of 16
4) You come back to the previous window but this time you must see TestNG option in the
available software list. Just Click TestNG and press Next button.
5) Click I accept the terms of the license agreement then click Finish.
6) You may or may not encounter a Security warning, if in case you do just click OK.
7) Click Next again on the succeeding dialog box until it prompts you to Restart the Eclipse.
8) You are all done now, just Click Yes.
9) Proceed with your workplace.
Page 14 of 16
10) After restart, verify if TestNG was indeed successfully installed. Right click on you project
and see if TestNG is displayed in the opened menu.
5).Create new file under the project and paste the above code and save it as testngsuite.xml and
modify that xml according to over need like below by adding other testing classes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite guice-stage="DEVELOPMENT" name="Default suite">
<test verbose="2" name="Default test">
<classes>
<class name="webdriver.sample2"/>
<class name="webdriver.sample3"/>
<class name="webdriver.sample"/>
Page 15 of 16
6).Save the file and right click on the testingsute.xml file and run as testng class and observe all
the testing classes add to the testing file will execute one by one after completion of execution
refresh the project and click on emailable-report.html suite results will be displayed
Page 16 of 16