SlideShare uma empresa Scribd logo
1 de 82
1
 Test automation is the use of software
To set test preconditions.
To control the execution of tests.
 To compare the actual outcomes to predicted outcomes.
To report the Execution Status.
 Commonly, test automation involves automating a
manual process already in place that uses a
formalized testing process.
2
 Frequent regression testing
 Repeated test case Execution is required
 User Acceptance Tests
 Faster Feedback to the developers
 Reduce the Human Effort
 Test same application on multiple environments
3
Quick Test Professional By HP
Rational Functional Tester By Rational (IBM Company)
Silk Test By Borland
Test Complete By Automated QA
QA Run (Compuware )
Watir ( Open Source)
Selenium ( Open Source)
Sahi (Open Source)
4
 Selenium is a robust set of tools that supports
rapid development of test automation for web-
based applications.
 Selenium provides a rich set of testing functions
specifically geared to the needs of testing of a
web application.
 Selenium operations are highly flexible, allowing
many options for locating UI elements and
comparing expected test results against actual
application behavior.
5
 Supports Cross Browser Testing. The Selenium
tests can be run on multiple browsers.
 Allows scripting in several languages like Java,
C#, PHP and Python.
 Assertion statements provide an efficient way of
comparing expected and actual results.
 Inbuilt reporting mechanism.
6
 Selenium IDE
 Selenium Remote Control
 Selenium Grid
7
 Selenium IDE is an integrated development
environment for Selenium tests.
 It is implemented as a Firefox extension, and
allows you to record, edit, and replay the test in
firefox
 Selenium IDE allows you to save tests as HTML,
Java, Ruby scripts, or any other format
 It allows you to automatically add assertions to
all the pages.
 Allows you to add selenese commands as and
when required
8
 Using Firefox, first, download the IDE from the
SeleniumHQ downloads page When downloading from
Firefox, you’ll be presented with the Window A. (See
Next Slide)
 Select Install Now. The Firefox Add-ons window pops
up, first showing a progress bar, and when the download
is complete, displays the Window B. (See Next Slide)
 Restart Firefox. After Firefox reboots you will find the
Selenium-IDE listed under the Firefox Tools menu.
9
10
Window A Window B
To run the Selenium-IDE, simply select it from the Firefox Tools menu. It opens
as follows with an empty script-editing window and a menu for loading, or
creating new test cases. (See Next Slide)
11
Start and Stop
Recording
Selenese
Script
Editor
Selenium Log
Replay
Toolbar
Accessor
Area
12
Selenium Options allow you to
Set The Text Encoding Format
Set the Default Page Time Out
Set The Base URL recording
option
Adding Selenium Core and IDE
Extension
Add Automatic Page Title
Assertions
There are also other options
under development
 Open Firefox that has the IDE installed
 Open the base URL of the application to record.
 Keep the application in a common base state.
 Go To Tools  Selenium IDE and the IDE will be
opened
 Now perform the operations on the application as
you are testing the application.
 Once you are done with the recording click on the
stop recording button and save the test case
through the file menu. By default it will be saved as
a selenese script (HTML format)
13
 clicking a link - click or clickAndWait commands
 entering values - type command
 selecting options from a drop-down listbox - select
command
 clicking checkboxes or radio buttons - click
command
14
 Make sure the application is in the common base
state.
 Click on the run button. Here you can also control
the speed of the execution using the
toolbar
 Once the test is run you can view the test log in
the bottom of the IDE window
15
 In the Selenium IDE you
can create any number of
test cases and save them
as test suite.
 To Run the test Suite click
on the “Play entire test
suite” button as shown
below.
16
Test Suite with
Test1 & test2
 Test Runner allows you to run the test case in a browser
loaded with the Selenium-Core TestRunner.
 Test runner is invoked by clicking the below Shown
button in the IDE
17
On Clicking the Test Runner Button you will the
window as seen in the next slide
18
Click this button to run all the tests
Run a Test Case
Click the Run button to run the currently displayed test case.
Run a Test Suite
Click the Run All button to run all the test cases in the currently
loaded test suite.
Stop and Start
The Pause button can be used to stop the test case while it is
running. The icon of this button then changes to indicate the
Resume button. To continue click Resume.
Stop in the Middle
You can set a breakpoint in the test case to cause it to stop on a
particular command. This is useful for debugging your test case.
To set a breakpoint, select a command, right-click, and from the
context menu select Toggle Breakpoint.
19
Start from the Middle
You can tell the IDE to begin running from a specific
command in the middle of the test case. This also is
used for debugging. To set a start point, select a
command, right-click, and from the context menu
select Set/Clear Start Point.
Run Any Single Command
Double-click any single command to run it by itself.
This is useful when writing a single command. It lets
you immediately test a command you are constructing,
when you are not sure if it is correct. You can double-
click it to see if it runs correctly. This is also available
from the context menu.
20
 Selenese allows multiple ways of checking for UI
elements.
 Verifications and assertions are used to check if
 an element is present somewhere on the page?
 specific text is somewhere on the page?
 specific text is at a specific location on the page?
 Verifications and assertions are not one and the
same.
 If an assertion fails, the script will be aborted but if a
verification fails the script will continue.
21
22
verifyTextPresent
This command is used to
check if a particular text is
present in a page or not.
To add this command , While
recording the test steps right
click on the text item that you
want verify. Once right clicked
you can find an option “Show
all commands”. On Clicking it
you will find an option
“verifyTextPresent”, select it
verifyTitle
 This command is used to
check if the page title is
correct or not.
 To add this command ,
While recording the test
steps right click any where
on the page that you want
verify. Once right clicked you
can find an option “Show all
commands”. On Clicking it
you will find an option
“verifyTitle”, select it
23
verifyElementPresent
 This command is used to
verify if a page element is
present in the page or not.
 To add this command , While
recording the test steps right
click any element on the page
that you want verify. Once
right clicked you can find an
option “Show all
commands”.OnClicking it you
will find an option
“verifyElementPresent”, select
it
24
verifyValue
 This method is used to check
if edit box has particular value
or if the check box is on.
Basically this method returns
the value of present in the
object.
 To add this command , While
recording the test steps right
click any element on the page
that you want verify the value
of. Once right clicked you can
find an option “Show all
commands”. On Clicking it you
will find an option “verifyValue”,
select it.
25
 Assertions are same as Verifications. The only
difference is, if the assertions fail the script will
abort. But the script will continue run in case a
verification point fails.
 The steps for inserting the assertions is same
as that of verification point.
 While recording Right Click  Show all
commands  select an assertion.
26
 assertTextPresent
This will assert if the text is present in the page.
 assertText
This will assert if a particular element is having the particular text.
 assertTitle
This will assert if the page is having a proper title.
 assertValue
This will assert if a Text box or check box has a particular value
 assertElementPresent
This will assert if a particular UI Element is present in the page.
27
waitForPageToLoad
This command will make the script to wait till the page loads.
Syntax is waitForPageToLoad(timeout); Time out is the
maximum time the script will wait for the page to load.
28
waitForAlert
This command will wait for the alert message to appear
waitForTable
This command will wait for the Web table to completely
load in the page
waitForTitle
This command will for the page Title to appear on the
browser.
Other waitFor commands
Selenium has several other wait command like
waitForText, waitForPopup and so on. These commands
are generically called Synchronization commands
29
 Store command are used to fetch the values from
the application and store it in a variable. These
variables can be used latter for validation purpose.
 The Store command can be used to retrieve the
page title, text from the page and other attributes
from the application.
30
 Echo command is
used to print the value
in to the selenium IDS
log.
 When printing a
variable use ${var}
 There are some
limitations for this
methods this has to
be used with caution
31
 Can run the test only on Firefox
 No Programming login (like loops, conditional
statements) can be applied
 Selenium IDE can execute scripts created in
Selenese only.
 It is difficult to use Selenium IDE for checking
complex test cases involving dynamic contents
32
 A solution to cross browser testing.
 A server, written in Java and so available on all
the platforms.
 Acts as a proxy for web requests from them.
 Client libraries for many popular languages.
 Bundles Selenium Core and automatically loads
into the browser
33
Software Required
 JDK , selenium-remote-control (this can be downloaded
from http://seleniumhq.org/download/)
Installation Procedure
 Selenium RC is simply a jar file and to run it we need
java installed. Once the Java is installed just unzip the
selenium-remote-control-zip which was downloaded
from the selenium site to a directory.
34
 First Generate the Script using selenium IDE in the
firefox IDE
 Once the Scripts are recorded add assertions where
ever required
 Now format the Selenese test into the language of your
choice. Please refer to the Image
35
 Once the Selenese script is converted into your
preferred language you can you can run them
using Selenium Server.
 For running the script you also need the client
driver for that particular language.
 To enhance the script we will require IDE like
netbeans or Eclipse IDE
 To Integrate the script and run them as a suite
we will require build integration tools like Maven
or Ant.
36
37
 Following are the steps to create a selenese test suite
and run a test suite using selenium RC
1) Record a test case using selenium IDE and save it as
“Test1.html” (say).
2) Record another test case using selenium IDE and save its as
“Test3.html” (say).
3) In this way you can record any number of test case using
selenium IDE and save them as <filename>.html
4) Then Create a New Test Suite using the File Menu. See the
Image Below.
38
39
Add the created test cases in to the suite as shown
in Image1
Once the test cases are added to the suite save
them as a test suite as in Image2
The Open the command prompt and navigate to
the directory where Selenium RC (server) is
placed.
In the command prompt Enter the command as
shown below.
Command :
 java -jar selenium-server.jar
-multiwindow -htmlSuite
"*iexplore"
"https://localhost/bookstore/"
"D:testa.html" "C:results.html“
 Once the command is run the
results will be stored in the
results.html file as shown
below.
40
Required Software
 Selenium RC Server jar , Selenium Java Client
Driver jar , JDK +, Eclipse (or any other IDE), Junit
jar and testing jar
 For building the frame work we require continuous
build integration tools like Ant, Maven or cruise
control.
41
Enables communication with Selenium Remote Control
Server.
 Functionality of Selenium is exposed via these drivers.
 Available in Ruby, Python, Java, C-Sharp …and so on.
 Give access to the rich features and libraries of the
language, including their unit testing framework.
 Makes it possible to develop automated scripts in the
same language as product.
 Which one you should use?
Whatever make sense in your context. Most Popular is java and for the
training we will use java
42
Following are the steps for generating the
test scripts in java
1) Record the Script in Selenium IDE and format
them into Java
2) Create a Selenium Java project in Eclipse and
load all the necessary jar files
3) Copy the formatted Java code into the Eclipse
and run the test.
43
Steps of formatting the code into java
1) Open the Browser and open the
base URL of the application.
2) Open the Selenium IDE and start
recoding the test steps.
3) Once the recording is done go to
Menu  Options  Format 
Java(TestNG) –Selenium RC
4) You can see the java code in the
source tab of IDE. Save the test
case with .java extension.
44
 Eclipse is an open source community whose projects are
focused on building an extensible development platform
for building Java applications and frameworks. Eclipse is
one of the best Java IDE and as a matter of face
Eclipse is much more than a Java IDE.
 We can configure a selenium project in eclipse and even
run the scripts from eclipse.
 Using eclipse its easy to enhance the recorded script.
We can add power to the recorded script by
parameterizing the test inputs and even validate the
back values.
 Eclipse also allows us to write reusable code for efficient
test automation.
45
 Download the “Eclipse IDE for Java Developers” from
the http://www.eclipse.org/downloads/ page.
 Unzip the downloaded zip file from the above site into a
directory.
 Once the unzipping is over open the folder and double
click on the icon and it will open a dialog box as
shown below.
46
 Create a folder say (selenium) in any one of the
directory and change the workspace location to
the directory created by you. Then click ok
button.
 On doing so you will see the eclipse welcome
screen if you are doing it for the first time. On
the welcome screen click on the workbench icon
to open the project explorer.
 When you to try to open the eclipse from next
time it will directly show the project explorer as
shown in the next slide.
47
48
Package
Explorer
Scrip View
console
 File  New  Java
Project
49
• Specify the project name
and click finish
 Open the folder contain the selenium project that you
have just created. Inside that folder create another folder
with name “lib”
 Inside the lib folder place the following jar files.
junit-4.8.1.jar
selenium-java-client-driver.jar
selenium-server.jar
testng-5.12.jars
 After placing the jar file in lib come back to the eclipse
and click on the project explorer strip and press F5. You
should see the all the jar files under the lib folder in the
project explorer as shown in the Image in next slide.
50
51
 In the eclipse  Package
Explorer  right click on
the src (source) folder. In
that select New 
Package and give a name
to the package. See the
Picture1
 Now right click on the
created package and click
on new  class and
provide a class name.
You will see a java script
template as seen in the
next slide
52
 Your IDE should look like this
53
This is where you have copy the
Java code that you formatted in the
Selenium IDE
 Right Click on the
Project
 Select Build Path 
Configure Build path
 On the next window
click on the libraries
tab and click on the
add jars tab
54
 As you click on the
add jars button a
window showing all the
jar files will be opened.
Select all the jar files
and click on ok button
 By doing this step we
are almost ready to
write the script and run
it.
55
 Copy the code that was formatted in the selenium
IDE and paste it in the Eclipse IDE script template.
 Make sure the class name that you created and
the class name in the script are same
 Make sure that you have add the methods setUp
and tearDown
56
 Start the Selenium Server
 For this open the command prompt and go to the folder
where the selenium server is present.
 Run the command “java -jar selenium-server.jar”
 The Selenium server will start running and you can see
the message in the command prompt.
57
 Once the server is up go to the eclipse and right click on
the script.
 In that select Run As  JUnit Test. See the image
below. After this you will get will see that the script has
run successfully in the window that’s shown in the next
slide.
58
59
success
failure
setUp method
This method prepares the selenium server to run the
test. This method basically hooks to the selenium server
and opens up the base URL of the application
test*** method
The methods with the name test will actually run the
tests on the application. There can be any number of
test methods in the app
tearDown method
This method will run after the end of the test. This test
will disconnect with the server and makes room for the
next tests to run the tests.
60
61
The generated selenium command can be
enhanced by writing java commands. Using java
methods we can do parameterization and data
base validation.
More over java methods can be used for to
perform some complex validations and testing
activities.
The best way to use java methods is used to is
have a Java IDE like eclipse.
62
Java Data Types
Int, float, String, char, Boolean and double
63
Declarations
String s = “Selenium”;
Int i = 20;
float cur = 3.35;
Operators
* ,/ ,% ,+, - are the
mathematical operators
* ,/, %, have a higher
precedence than + or -
== Equal (careful)
!= Not equal
>= Greater than or equal
<= Less than or equal
> Greater than
< Less than
64
If Condition
if (name != “selenium”)
{
System.out.print(“Tool Changed”);
}
Else
{
System.out.print(“Tool is ok”);
}
65
Loop n times
for ( i = 0; i < n; n++ )
{
// this code body will execute n times
// I from 0 to n-1
}
66
Required Packages
 import java.util.Date;
 import java.text.SimpleDateFormat;
Sample Code
67
Implementation Steps
1) First get the values from the list box
2) To get the values from the list box or any other
HTML element we need to know its Xpath. (use
Xpath checker)
3) The values taken from the list box are stored in a
variable.
4) Use the indexOf method to find if “HTML” is
present in the extracted variable.
68
69
Xpath Locator
 Parameterization is to same run the script with
multiple set of data.
 The data will be stored in a CSV file.
 We will have write a program to read the values
from the excel line by line and replace the
values.
 For reading the values from a CSV file we will
require the following packages
import java.io.File;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;
70
71
 Ant is a free tool from the Apache Jakarta Group
 Originally written by James Duncan Davidson
 on an airplane from Europe to the US...
 Like ‘make’ for Java – only better
 Uses an XML file to drive its action
 Extremely powerful and modular
 Easily extensible
 Written in Java so it is cross platform
72
 Download ANT and copy it into any of the
directory
 Create a JAVA_HOME environment Variable
 Create a ANT_HOME environment variables
 Add the ANT bin path to windows path
environment variable
 Create a build file to load all the jar files and
create targets to run the selenium tests using
the build file
73
74
 Start the selenium server through the command
prompt
 Then go the folder where the selenium tests are
stored
 Make sure that the build.xml file is present in
that location
 Now run the command “ant” from the command
prompt
 You can see the test running and the results will
be saved in the results.txt file.
75
76
Selenium-Grid
Selenium-Grid allows the Selenium-RC solution to scale for test
suites or test suites to be run in multiple environments.
• With Selenium-Grid multiple instances of Selenium-RC are
running on various operating system and browser configurations,
each of these when launching register with a hub. When tests are
sent to the hub they are then redirected to an available Selenium-
RC, which will launch the browser and run the test.
• This allows for running tests in parallel, with the entire test suite
theoretically taking only as long to run as the longest individual
test.
 Download Selenium Grid latest binary
distribution and unpack it on your computer.
 Go at the root of selenium grid directory and
validate your installation:
 cd selenium-grid-1.0
 ant sanity-check
 Go to the selenium distribution directory and
launch in a new terminal:
 ant launch-hub
 Check out that the Hub is running by looking at
its console in a browser:
http://localhost:4444/console (See the Browser in the next slide)
77
78
 In a new terminal enter the following command
 ant launch-remote-control
 Based on your target file you can run either in
sequence or in parallel
79
 Relatively easy to automate web UI tests
 Record/Replay for regression tests
 RC allows integration with CI and JUnit/FitNesse
tests
 Speed: RC->Browser communication is a speed
bottleneck (run in grid, overnight)
 UI is brittle, tests depending on the UI break a lot
(DSTL might fix this, page abstractions as well)
 Data-backed tests are not easily repeatable
(integrate with DB test engines)
 Use Selenium to verify workflow and session
 Don't put Selenium tests in your main development
build – run them overnight
 Have dedicated machines that run tests

Mais conteúdo relacionado

Mais procurados

Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using seleniumshreyas JC
 
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Aravindharamanan S
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium InstallationANKUR-BA
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - InstallationRajesh-QA
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorialprad_123
 
How to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipseHow to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipseHaitham Refaat
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsSauce Labs
 
Learn SELENIUM at ASIT
Learn SELENIUM at ASITLearn SELENIUM at ASIT
Learn SELENIUM at ASITASIT
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing ToolZeba Tahseen
 
Automation Testing on Selenium by Quontra Solutions
Automation Testing on Selenium by Quontra SolutionsAutomation Testing on Selenium by Quontra Solutions
Automation Testing on Selenium by Quontra SolutionsQUONTRASOLUTIONS
 

Mais procurados (15)

Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium Installation
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - Installation
 
What is selenium
What is seleniumWhat is selenium
What is selenium
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorial
 
Selenium ide made easy
Selenium ide made easySelenium ide made easy
Selenium ide made easy
 
Sel
SelSel
Sel
 
How to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipseHow to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipse
 
Selenium
SeleniumSelenium
Selenium
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason Huggins
 
Learn SELENIUM at ASIT
Learn SELENIUM at ASITLearn SELENIUM at ASIT
Learn SELENIUM at ASIT
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
 
Automation Testing on Selenium by Quontra Solutions
Automation Testing on Selenium by Quontra SolutionsAutomation Testing on Selenium by Quontra Solutions
Automation Testing on Selenium by Quontra Solutions
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 

Destaque

Destaque (11)

Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 

Semelhante a Automation Testing Using Selenium IDE

Selenium ide material (1)
Selenium ide material (1)Selenium ide material (1)
Selenium ide material (1)Sriram Angajala
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using seleniumjayeshvaghelaqa
 
Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)Wael Mansour
 
Everything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: TutorialEverything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: TutorialpCloudy
 
Introduction to Selenium
Introduction to SeleniumIntroduction to Selenium
Introduction to SeleniumKnoldus Inc.
 
Selenium training
Selenium trainingSelenium training
Selenium trainingRobin0590
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and ExtensionsYana Altunyan
 
How To Install TestNG in Eclipse Step By Step Guide.pdf
How To Install TestNG in Eclipse Step By Step Guide.pdfHow To Install TestNG in Eclipse Step By Step Guide.pdf
How To Install TestNG in Eclipse Step By Step Guide.pdfpCloudy
 
Top 30 Selenium Interview Questions.pptx
Top 30 Selenium Interview Questions.pptxTop 30 Selenium Interview Questions.pptx
Top 30 Selenium Interview Questions.pptxSyntax Technologies
 
Selenium by using JAVA
Selenium by using JAVASelenium by using JAVA
Selenium by using JAVAmahirayavarapu
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using JavaF K
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...sophiabelthome
 
Selenium Installation
Selenium InstallationSelenium Installation
Selenium InstallationSachin-QA
 

Semelhante a Automation Testing Using Selenium IDE (20)

Selenium ide material (1)
Selenium ide material (1)Selenium ide material (1)
Selenium ide material (1)
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Everything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: TutorialEverything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: Tutorial
 
Introduction to Selenium
Introduction to SeleniumIntroduction to Selenium
Introduction to Selenium
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
 
How To Install TestNG in Eclipse Step By Step Guide.pdf
How To Install TestNG in Eclipse Step By Step Guide.pdfHow To Install TestNG in Eclipse Step By Step Guide.pdf
How To Install TestNG in Eclipse Step By Step Guide.pdf
 
Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
 
Top 30 Selenium Interview Questions.pptx
Top 30 Selenium Interview Questions.pptxTop 30 Selenium Interview Questions.pptx
Top 30 Selenium Interview Questions.pptx
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium by using JAVA
Selenium by using JAVASelenium by using JAVA
Selenium by using JAVA
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...
 
Selenium Installation
Selenium InstallationSelenium Installation
Selenium Installation
 

Mais de QUONTRASOLUTIONS

Big data introduction by quontra solutions
Big data introduction by quontra solutionsBig data introduction by quontra solutions
Big data introduction by quontra solutionsQUONTRASOLUTIONS
 
Cognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsCognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsQUONTRASOLUTIONS
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutionsQUONTRASOLUTIONS
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutionsQUONTRASOLUTIONS
 
Software Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsSoftware Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsQUONTRASOLUTIONS
 
Introduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsIntroduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsQUONTRASOLUTIONS
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra SolutionsQUONTRASOLUTIONS
 
Introduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classIntroduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classQUONTRASOLUTIONS
 
Saas overview by quontra solutions
Saas overview  by quontra solutionsSaas overview  by quontra solutions
Saas overview by quontra solutionsQUONTRASOLUTIONS
 
Sharepoint taxonomy introduction us
Sharepoint taxonomy introduction   usSharepoint taxonomy introduction   us
Sharepoint taxonomy introduction usQUONTRASOLUTIONS
 
Introduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraIntroduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraQUONTRASOLUTIONS
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIQUONTRASOLUTIONS
 
Performance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsPerformance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsQUONTRASOLUTIONS
 
Obiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsObiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsQUONTRASOLUTIONS
 
Sharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usSharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usQUONTRASOLUTIONS
 

Mais de QUONTRASOLUTIONS (20)

Big data introduction by quontra solutions
Big data introduction by quontra solutionsBig data introduction by quontra solutions
Big data introduction by quontra solutions
 
Java constructors
Java constructorsJava constructors
Java constructors
 
Cognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsCognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutions
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutions
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutions
 
Cognos Overview
Cognos Overview Cognos Overview
Cognos Overview
 
Hibernate online training
Hibernate online trainingHibernate online training
Hibernate online training
 
Java j2eeTutorial
Java j2eeTutorialJava j2eeTutorial
Java j2eeTutorial
 
Software Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsSoftware Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutions
 
Introduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsIntroduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutions
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
 
Introduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classIntroduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training class
 
Saas overview by quontra solutions
Saas overview  by quontra solutionsSaas overview  by quontra solutions
Saas overview by quontra solutions
 
Sharepoint taxonomy introduction us
Sharepoint taxonomy introduction   usSharepoint taxonomy introduction   us
Sharepoint taxonomy introduction us
 
Introduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraIntroduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By Quontra
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST API
 
Performance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsPerformance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutions
 
Obiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsObiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutions
 
Sharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usSharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra us
 
Qa by quontra us
Qa by quontra   usQa by quontra   us
Qa by quontra us
 

Último

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 

Último (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 

Automation Testing Using Selenium IDE

  • 1. 1
  • 2.  Test automation is the use of software To set test preconditions. To control the execution of tests.  To compare the actual outcomes to predicted outcomes. To report the Execution Status.  Commonly, test automation involves automating a manual process already in place that uses a formalized testing process. 2
  • 3.  Frequent regression testing  Repeated test case Execution is required  User Acceptance Tests  Faster Feedback to the developers  Reduce the Human Effort  Test same application on multiple environments 3
  • 4. Quick Test Professional By HP Rational Functional Tester By Rational (IBM Company) Silk Test By Borland Test Complete By Automated QA QA Run (Compuware ) Watir ( Open Source) Selenium ( Open Source) Sahi (Open Source) 4
  • 5.  Selenium is a robust set of tools that supports rapid development of test automation for web- based applications.  Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application.  Selenium operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior. 5
  • 6.  Supports Cross Browser Testing. The Selenium tests can be run on multiple browsers.  Allows scripting in several languages like Java, C#, PHP and Python.  Assertion statements provide an efficient way of comparing expected and actual results.  Inbuilt reporting mechanism. 6
  • 7.  Selenium IDE  Selenium Remote Control  Selenium Grid 7
  • 8.  Selenium IDE is an integrated development environment for Selenium tests.  It is implemented as a Firefox extension, and allows you to record, edit, and replay the test in firefox  Selenium IDE allows you to save tests as HTML, Java, Ruby scripts, or any other format  It allows you to automatically add assertions to all the pages.  Allows you to add selenese commands as and when required 8
  • 9.  Using Firefox, first, download the IDE from the SeleniumHQ downloads page When downloading from Firefox, you’ll be presented with the Window A. (See Next Slide)  Select Install Now. The Firefox Add-ons window pops up, first showing a progress bar, and when the download is complete, displays the Window B. (See Next Slide)  Restart Firefox. After Firefox reboots you will find the Selenium-IDE listed under the Firefox Tools menu. 9
  • 10. 10 Window A Window B To run the Selenium-IDE, simply select it from the Firefox Tools menu. It opens as follows with an empty script-editing window and a menu for loading, or creating new test cases. (See Next Slide)
  • 12. 12 Selenium Options allow you to Set The Text Encoding Format Set the Default Page Time Out Set The Base URL recording option Adding Selenium Core and IDE Extension Add Automatic Page Title Assertions There are also other options under development
  • 13.  Open Firefox that has the IDE installed  Open the base URL of the application to record.  Keep the application in a common base state.  Go To Tools  Selenium IDE and the IDE will be opened  Now perform the operations on the application as you are testing the application.  Once you are done with the recording click on the stop recording button and save the test case through the file menu. By default it will be saved as a selenese script (HTML format) 13
  • 14.  clicking a link - click or clickAndWait commands  entering values - type command  selecting options from a drop-down listbox - select command  clicking checkboxes or radio buttons - click command 14
  • 15.  Make sure the application is in the common base state.  Click on the run button. Here you can also control the speed of the execution using the toolbar  Once the test is run you can view the test log in the bottom of the IDE window 15
  • 16.  In the Selenium IDE you can create any number of test cases and save them as test suite.  To Run the test Suite click on the “Play entire test suite” button as shown below. 16 Test Suite with Test1 & test2
  • 17.  Test Runner allows you to run the test case in a browser loaded with the Selenium-Core TestRunner.  Test runner is invoked by clicking the below Shown button in the IDE 17 On Clicking the Test Runner Button you will the window as seen in the next slide
  • 18. 18 Click this button to run all the tests
  • 19. Run a Test Case Click the Run button to run the currently displayed test case. Run a Test Suite Click the Run All button to run all the test cases in the currently loaded test suite. Stop and Start The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume. Stop in the Middle You can set a breakpoint in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, select a command, right-click, and from the context menu select Toggle Breakpoint. 19
  • 20. Start from the Middle You can tell the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a start point, select a command, right-click, and from the context menu select Set/Clear Start Point. Run Any Single Command Double-click any single command to run it by itself. This is useful when writing a single command. It lets you immediately test a command you are constructing, when you are not sure if it is correct. You can double- click it to see if it runs correctly. This is also available from the context menu. 20
  • 21.  Selenese allows multiple ways of checking for UI elements.  Verifications and assertions are used to check if  an element is present somewhere on the page?  specific text is somewhere on the page?  specific text is at a specific location on the page?  Verifications and assertions are not one and the same.  If an assertion fails, the script will be aborted but if a verification fails the script will continue. 21
  • 22. 22 verifyTextPresent This command is used to check if a particular text is present in a page or not. To add this command , While recording the test steps right click on the text item that you want verify. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyTextPresent”, select it
  • 23. verifyTitle  This command is used to check if the page title is correct or not.  To add this command , While recording the test steps right click any where on the page that you want verify. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyTitle”, select it 23
  • 24. verifyElementPresent  This command is used to verify if a page element is present in the page or not.  To add this command , While recording the test steps right click any element on the page that you want verify. Once right clicked you can find an option “Show all commands”.OnClicking it you will find an option “verifyElementPresent”, select it 24
  • 25. verifyValue  This method is used to check if edit box has particular value or if the check box is on. Basically this method returns the value of present in the object.  To add this command , While recording the test steps right click any element on the page that you want verify the value of. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyValue”, select it. 25
  • 26.  Assertions are same as Verifications. The only difference is, if the assertions fail the script will abort. But the script will continue run in case a verification point fails.  The steps for inserting the assertions is same as that of verification point.  While recording Right Click  Show all commands  select an assertion. 26
  • 27.  assertTextPresent This will assert if the text is present in the page.  assertText This will assert if a particular element is having the particular text.  assertTitle This will assert if the page is having a proper title.  assertValue This will assert if a Text box or check box has a particular value  assertElementPresent This will assert if a particular UI Element is present in the page. 27
  • 28. waitForPageToLoad This command will make the script to wait till the page loads. Syntax is waitForPageToLoad(timeout); Time out is the maximum time the script will wait for the page to load. 28
  • 29. waitForAlert This command will wait for the alert message to appear waitForTable This command will wait for the Web table to completely load in the page waitForTitle This command will for the page Title to appear on the browser. Other waitFor commands Selenium has several other wait command like waitForText, waitForPopup and so on. These commands are generically called Synchronization commands 29
  • 30.  Store command are used to fetch the values from the application and store it in a variable. These variables can be used latter for validation purpose.  The Store command can be used to retrieve the page title, text from the page and other attributes from the application. 30
  • 31.  Echo command is used to print the value in to the selenium IDS log.  When printing a variable use ${var}  There are some limitations for this methods this has to be used with caution 31
  • 32.  Can run the test only on Firefox  No Programming login (like loops, conditional statements) can be applied  Selenium IDE can execute scripts created in Selenese only.  It is difficult to use Selenium IDE for checking complex test cases involving dynamic contents 32
  • 33.  A solution to cross browser testing.  A server, written in Java and so available on all the platforms.  Acts as a proxy for web requests from them.  Client libraries for many popular languages.  Bundles Selenium Core and automatically loads into the browser 33
  • 34. Software Required  JDK , selenium-remote-control (this can be downloaded from http://seleniumhq.org/download/) Installation Procedure  Selenium RC is simply a jar file and to run it we need java installed. Once the Java is installed just unzip the selenium-remote-control-zip which was downloaded from the selenium site to a directory. 34
  • 35.  First Generate the Script using selenium IDE in the firefox IDE  Once the Scripts are recorded add assertions where ever required  Now format the Selenese test into the language of your choice. Please refer to the Image 35
  • 36.  Once the Selenese script is converted into your preferred language you can you can run them using Selenium Server.  For running the script you also need the client driver for that particular language.  To enhance the script we will require IDE like netbeans or Eclipse IDE  To Integrate the script and run them as a suite we will require build integration tools like Maven or Ant. 36
  • 37. 37
  • 38.  Following are the steps to create a selenese test suite and run a test suite using selenium RC 1) Record a test case using selenium IDE and save it as “Test1.html” (say). 2) Record another test case using selenium IDE and save its as “Test3.html” (say). 3) In this way you can record any number of test case using selenium IDE and save them as <filename>.html 4) Then Create a New Test Suite using the File Menu. See the Image Below. 38
  • 39. 39 Add the created test cases in to the suite as shown in Image1 Once the test cases are added to the suite save them as a test suite as in Image2 The Open the command prompt and navigate to the directory where Selenium RC (server) is placed. In the command prompt Enter the command as shown below.
  • 40. Command :  java -jar selenium-server.jar -multiwindow -htmlSuite "*iexplore" "https://localhost/bookstore/" "D:testa.html" "C:results.html“  Once the command is run the results will be stored in the results.html file as shown below. 40
  • 41. Required Software  Selenium RC Server jar , Selenium Java Client Driver jar , JDK +, Eclipse (or any other IDE), Junit jar and testing jar  For building the frame work we require continuous build integration tools like Ant, Maven or cruise control. 41
  • 42. Enables communication with Selenium Remote Control Server.  Functionality of Selenium is exposed via these drivers.  Available in Ruby, Python, Java, C-Sharp …and so on.  Give access to the rich features and libraries of the language, including their unit testing framework.  Makes it possible to develop automated scripts in the same language as product.  Which one you should use? Whatever make sense in your context. Most Popular is java and for the training we will use java 42
  • 43. Following are the steps for generating the test scripts in java 1) Record the Script in Selenium IDE and format them into Java 2) Create a Selenium Java project in Eclipse and load all the necessary jar files 3) Copy the formatted Java code into the Eclipse and run the test. 43
  • 44. Steps of formatting the code into java 1) Open the Browser and open the base URL of the application. 2) Open the Selenium IDE and start recoding the test steps. 3) Once the recording is done go to Menu  Options  Format  Java(TestNG) –Selenium RC 4) You can see the java code in the source tab of IDE. Save the test case with .java extension. 44
  • 45.  Eclipse is an open source community whose projects are focused on building an extensible development platform for building Java applications and frameworks. Eclipse is one of the best Java IDE and as a matter of face Eclipse is much more than a Java IDE.  We can configure a selenium project in eclipse and even run the scripts from eclipse.  Using eclipse its easy to enhance the recorded script. We can add power to the recorded script by parameterizing the test inputs and even validate the back values.  Eclipse also allows us to write reusable code for efficient test automation. 45
  • 46.  Download the “Eclipse IDE for Java Developers” from the http://www.eclipse.org/downloads/ page.  Unzip the downloaded zip file from the above site into a directory.  Once the unzipping is over open the folder and double click on the icon and it will open a dialog box as shown below. 46
  • 47.  Create a folder say (selenium) in any one of the directory and change the workspace location to the directory created by you. Then click ok button.  On doing so you will see the eclipse welcome screen if you are doing it for the first time. On the welcome screen click on the workbench icon to open the project explorer.  When you to try to open the eclipse from next time it will directly show the project explorer as shown in the next slide. 47
  • 49.  File  New  Java Project 49 • Specify the project name and click finish
  • 50.  Open the folder contain the selenium project that you have just created. Inside that folder create another folder with name “lib”  Inside the lib folder place the following jar files. junit-4.8.1.jar selenium-java-client-driver.jar selenium-server.jar testng-5.12.jars  After placing the jar file in lib come back to the eclipse and click on the project explorer strip and press F5. You should see the all the jar files under the lib folder in the project explorer as shown in the Image in next slide. 50
  • 51. 51
  • 52.  In the eclipse  Package Explorer  right click on the src (source) folder. In that select New  Package and give a name to the package. See the Picture1  Now right click on the created package and click on new  class and provide a class name. You will see a java script template as seen in the next slide 52
  • 53.  Your IDE should look like this 53 This is where you have copy the Java code that you formatted in the Selenium IDE
  • 54.  Right Click on the Project  Select Build Path  Configure Build path  On the next window click on the libraries tab and click on the add jars tab 54
  • 55.  As you click on the add jars button a window showing all the jar files will be opened. Select all the jar files and click on ok button  By doing this step we are almost ready to write the script and run it. 55
  • 56.  Copy the code that was formatted in the selenium IDE and paste it in the Eclipse IDE script template.  Make sure the class name that you created and the class name in the script are same  Make sure that you have add the methods setUp and tearDown 56
  • 57.  Start the Selenium Server  For this open the command prompt and go to the folder where the selenium server is present.  Run the command “java -jar selenium-server.jar”  The Selenium server will start running and you can see the message in the command prompt. 57
  • 58.  Once the server is up go to the eclipse and right click on the script.  In that select Run As  JUnit Test. See the image below. After this you will get will see that the script has run successfully in the window that’s shown in the next slide. 58
  • 60. setUp method This method prepares the selenium server to run the test. This method basically hooks to the selenium server and opens up the base URL of the application test*** method The methods with the name test will actually run the tests on the application. There can be any number of test methods in the app tearDown method This method will run after the end of the test. This test will disconnect with the server and makes room for the next tests to run the tests. 60
  • 61. 61
  • 62. The generated selenium command can be enhanced by writing java commands. Using java methods we can do parameterization and data base validation. More over java methods can be used for to perform some complex validations and testing activities. The best way to use java methods is used to is have a Java IDE like eclipse. 62
  • 63. Java Data Types Int, float, String, char, Boolean and double 63 Declarations String s = “Selenium”; Int i = 20; float cur = 3.35; Operators * ,/ ,% ,+, - are the mathematical operators * ,/, %, have a higher precedence than + or -
  • 64. == Equal (careful) != Not equal >= Greater than or equal <= Less than or equal > Greater than < Less than 64
  • 65. If Condition if (name != “selenium”) { System.out.print(“Tool Changed”); } Else { System.out.print(“Tool is ok”); } 65 Loop n times for ( i = 0; i < n; n++ ) { // this code body will execute n times // I from 0 to n-1 }
  • 66. 66
  • 67. Required Packages  import java.util.Date;  import java.text.SimpleDateFormat; Sample Code 67
  • 68. Implementation Steps 1) First get the values from the list box 2) To get the values from the list box or any other HTML element we need to know its Xpath. (use Xpath checker) 3) The values taken from the list box are stored in a variable. 4) Use the indexOf method to find if “HTML” is present in the extracted variable. 68
  • 70.  Parameterization is to same run the script with multiple set of data.  The data will be stored in a CSV file.  We will have write a program to read the values from the excel line by line and replace the values.  For reading the values from a CSV file we will require the following packages import java.io.File; import java.io.BufferedReader; import java.io.FileReader; import java.util.StringTokenizer; 70
  • 71. 71
  • 72.  Ant is a free tool from the Apache Jakarta Group  Originally written by James Duncan Davidson  on an airplane from Europe to the US...  Like ‘make’ for Java – only better  Uses an XML file to drive its action  Extremely powerful and modular  Easily extensible  Written in Java so it is cross platform 72
  • 73.  Download ANT and copy it into any of the directory  Create a JAVA_HOME environment Variable  Create a ANT_HOME environment variables  Add the ANT bin path to windows path environment variable  Create a build file to load all the jar files and create targets to run the selenium tests using the build file 73
  • 74. 74
  • 75.  Start the selenium server through the command prompt  Then go the folder where the selenium tests are stored  Make sure that the build.xml file is present in that location  Now run the command “ant” from the command prompt  You can see the test running and the results will be saved in the results.txt file. 75
  • 76. 76 Selenium-Grid Selenium-Grid allows the Selenium-RC solution to scale for test suites or test suites to be run in multiple environments. • With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are sent to the hub they are then redirected to an available Selenium- RC, which will launch the browser and run the test. • This allows for running tests in parallel, with the entire test suite theoretically taking only as long to run as the longest individual test.
  • 77.  Download Selenium Grid latest binary distribution and unpack it on your computer.  Go at the root of selenium grid directory and validate your installation:  cd selenium-grid-1.0  ant sanity-check  Go to the selenium distribution directory and launch in a new terminal:  ant launch-hub  Check out that the Hub is running by looking at its console in a browser: http://localhost:4444/console (See the Browser in the next slide) 77
  • 78. 78
  • 79.  In a new terminal enter the following command  ant launch-remote-control  Based on your target file you can run either in sequence or in parallel 79
  • 80.  Relatively easy to automate web UI tests  Record/Replay for regression tests  RC allows integration with CI and JUnit/FitNesse tests
  • 81.  Speed: RC->Browser communication is a speed bottleneck (run in grid, overnight)  UI is brittle, tests depending on the UI break a lot (DSTL might fix this, page abstractions as well)  Data-backed tests are not easily repeatable (integrate with DB test engines)
  • 82.  Use Selenium to verify workflow and session  Don't put Selenium tests in your main development build – run them overnight  Have dedicated machines that run tests