Professional Documents
Culture Documents
Test Automation Using Selenium
Test Automation Using Selenium
Pre-Requisite:
Ensure you have java installed in your
system.
Download Eclipse
Download Test-NG Plug-in and install it.
2. Scope
This tutorial is designed for software testing
professionals who would like to learn the basics
of Selenium through practical examples. The
tutorial contains enough ingredients to get you
started with Selenium from where you can take
yourself to higher levels of expertise.
3. Selenium Suit
Selenium
IDE
Selenium
Integrated
Development Environment (IDE) is a Firefox
plugin that lets testers to record their actions as
they follow the workflow that they need to test.
Selenium RC - Selenium Remote Control (RC)
was the flagship testing framework that allowed
more than simple browser actions and linear
execution. It makes use of the full power of
programming languages such as Java, C#, PHP,
Python, Ruby and PERL to create more complex
tests.
Selenium WebDriver - Selenium WebDriver is
the successor to Selenium RC which sends
Fig 1.0
5. Naming Conventions
Environment Setup
Training
Data
Type
Prefix
Example
Boolean
bln
blnFlag
Integer
int
intCount
Long
lng
lngRowNumber
Double
dbl
dblWeight
Object
obj
objCurrent
Single
sng
sngPosition
String
str
strCurPage
Array
arr
arrCellData
7. Functions
Variant
vnt
vntPropValue
Names:
User-Defined
Type
udt
udtTransaction
Scope
Prefix
Example
Global
gStrAppPath
Module-Level
mintRowCount
Static
svntFlag
Variable Passed by
Reference
rintValue
Variables Passed by
Values
vintValue
Result Analysis
Local to the
Function
Header:
The function or procedure header should contain
the following:
Name of the project
None
strCurPage
6. Activities
The following major activities in each phase of
automation must be estimated.
Automation Initiation
Tool/Framework Feasibility Study
Environment Setup
POC
Framework Design/Implement
**************************************************
#Project Name : Test
#Function Name
: importdata.rb()
#Author : Open Source
#Description
: This function handles the
Suite Run, Object Repository, Keyword Driver
and creating Reports.
#Date of creation :
#Input Parameters:
#Name of person modifying: Tester #Date of
modification:
**************************************************
8. Function Complexity
Framework code should be designed and
developed with minimal possible loops and
conditions for reduced complexity and enhanced
maintainability.
9. Function Structures
The following tips provide guidance for creating
easy-to-read and easy-to-maintain code.
Modularize the code for increased reusability
and reduced redundancy.
11.
General Guidelines
a.
b.
c.
d.
e.
f.
g.
h.
10.
Comment Standards
6.1
References
1. http://www.seleniumhq.org
2. http://www.qaautomation.net
3. http://mestachs.wordpress.com/2012/08/
13/selenium-best-practices
6.2