Selenium Ide Basic
Selenium Ide Basic
Selenium
Test Automation
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.
Softsmith Infotech
Softsmith Infotech
Selenium
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.
Softsmith Infotech
Softsmith Infotech
Selenium Features
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.
Supports multiple OS
Supports integration with different IDEs
Softsmith Infotech
Different Ides
Eclipse
NetBeans
IntelliJidea
Softsmith Infotech
Selenium Features
Supports integration with different IDEs
Supports integration with different unit
testing framework
C#-Nunit
Java-Junit and TestNg
Php-phpunit
Supports integration with number of CI tools
Like Jenkins ,Codeshape or teamcity
Supports both TDD and BDD based
approaches
Softsmith Infotech
10
Selenium Components
Selenium
Selenium
Selenium
Selenium
Softsmith Infotech
11
Selenium IDE
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
Softsmith Infotech
12
Softsmith Infotech
13
Selenium Installation
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)
Softsmith Infotech
14
Selenium IDE - UI
Start and Stop
Recording
Replay
Toolbar
Selenese
Script
Editor
Accessor
Area
Selenium Log
Softsmith Infotech
15
Selenium Options
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
Softsmith Infotech
16
17
General Selenese
Commands
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
Softsmith Infotech
18
19
20
21
Test Runner
22
Running Options
Run a Test Case
Click the Run button to run the currently displayed test
case.
23
Running Options
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.
24
Softsmith Infotech
25
Verification Commands
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
Softsmith Infotech
26
Verification Commands
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
Softsmith Infotech
27
Verification Commands
verifyElementPresent
This command is used to
verify if a page element is
present in the page or not.
28
Verification Commands
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.
Softsmith Infotech
29
Assertions
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.
Softsmith Infotech
30
Assertion Statements
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.
Softsmith Infotech
31
Selenium WaitFor
Commands
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.
Softsmith Infotech
32
33
Store Commands
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.
Softsmith Infotech
34
Echo Command
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
Softsmith Infotech
35
36
Links
http://gojko.net
http://www.openqa.org
http://www.solutionsiq.com/agile2008/agile-2008domain.php
http://storytestiq.solutionsiq.com
http://www.cubictest.com
http://fitnesse.info/webtest