You are on page 1of 16

Open2Test Test Automation Framework for

Selenium Web Driver - Quick Start Guide


Version 1.0
Apr 2013

DISCLAIMER
Verbatim copying and distribution of this entire article
royalty, in any medium, provided this notice is preserved.

are

permitted

worldwide,

without

Table of Contents

TABLE OF CONTENTS
1

PURPOSE..................................................... 3

ENVIRONMENT SETUP .............................................. 4

FRAMEWORK

AT

GLANCE ............................................ 5

3. PROJECT SETUP
4

USAGE

TEST RESULTS

OF

Open2Test.org

IN

ECLIPSE ........................................ 7

KEYWORDS ............................................. 14
FOR A

KEYWORD-DRIVEN SCRIPT .......................... 15

Page ii

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

PURPOSE
This document explains the support settings and how to get started with
keyword-driven scripting using Selenium WebDriver.

www.Open2Test.org

Page 3

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Environment Setup
The following jar files are required to run the Open2Test Selenium
Webdriver Framework.

jexcelapi_2_6_12 or higher

junit-4.9 or higher

selenium-server-standalone-2.7.0 or higher

www.Open2Test.org

Page 4

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Framework at Glance
Input Files:
a. Selenium Utility Excel:
The TestSuite, TestScript, Object Repository and Report
location should be mentioned in Selenium_Utility excel.

File\Folder Name

Location

Test Suite
Test Script
Object Repository
Summary Report
Screen Shot Report
Detailed Report

D:/path/Test_Suite1.xls
D:/path/
D:/path/TestData/ObjectRepository.xls
D:/path/Test Reports/
D:/path/Test Reports/ScreenShot_Report/
D:/path/Test Reports/Detailed_Report/

Folder

Note: The selenium utility excel file should be placed in


D:\Selenium_Utility.xls.If you wish to place the utility file in some
other location, you must update the path in the ReadUtilFile() function
in the framework.
b. Object Repository Excel:
Collect
the
properties
of
Object_Repository.xls like below

Object Name
Welcome to Open2Test.org
logo.jpg
Home
About Us
Tech Docs
News
Roadmap
Comment
Support
Contact Us
banner.jpg
Learn More
Learn More_1
Name
emailID
selectframework
Agreement

www.Open2Test.org

Object
Type
Page
Image
Link
Link
Link
Link
Link
Link
Link
Link
Image
Link
Link
Textbox
Textbox
ComboBox
Textbox

Parent
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

objects

and

define

it

in

ObjectPath
name=
xpath=/html[1]/body[1]/div[1]/div[1]/img[1]
link=Home
link=About Us
link=Tech Docs
link=News
link=Roadmap
link=Comment
link=Support
link=Contact Us
xpath=/html[1]/body[1]/div[1]/div[2]/div[1]/img[1]
link=Learn More
link=Learn More
id=name
id=emailID
xpath=//select
id=Agreement

Page 5

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide
Terms & Conditions
Input
new.gif
More news
Sitemap
Privacy Policy

Link
Textbox
Image
Link
Link
Link

1
1
1
1
1
1

link=Terms & Conditions


id=submit
xpath=/html[1]/body[1]/div[1]/div[2]/div[2]/div[2]/p[1]/img[1]
link=More news
link=Sitemap
link=Privacy Policy

c. Test suite Excel:


Mention the test scripts in the Test suite excel in the order you
wish to execute them.

Run
r
r
r
r
r

Test Scripts
Mantis_Create Project
Mantis_Report Issue
Mantis_View Issue and Delete Project
Mantis_Fail
Call Tariff Addition and Amendment

d. Test Script Excel


Write the keywords for the test script like below
Run

Keyword

ObjectDetails

Action

LaunchApp

www.open2test.org

importdata

D:\001_D_Files\path\TestData\TestData.xls

loop

perform

Textbox;name

set:dt_username

perform

Textbox;emailID

set:dt_email

check

Textbox;emailID

enabled:true

Action2

Comments

Sheet1
3

call
r

perform

ComboBox;selectframework

select:Web Framework (V2) for Selenium

perform

Textbox;Agreement

click

perform

Link;Terms & Conditions

click

perform

Button;input

click

screencapture

Endloop

www.Open2Test.org

Page 6

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

3. Project Setup in Eclipse


Create a Java project in Eclipse

www.Open2Test.org

Page 7

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Note: Please note that JavaSE-1.7 has to be used

www.Open2Test.org

Page 8

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Add the required jar files to the library:

www.Open2Test.org

Page 9

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

www.Open2Test.org

Page 10

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Remove the contents of the new class and Copy the framework into the new
class file

www.Open2Test.org

Page 11

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

www.Open2Test.org

Page 12

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

www.Open2Test.org

Page 13

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Usage of Keywords
The keywords for the test scenario should be entered in the Sheet1 of
the Microsoft Excel placed in the Test Scripts folder. The syntax for
the keywords can be referred from Selenium Keywords Reference Dictionary
Document.

www.Open2Test.org

Page 14

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

Test Results for a Keyword-Driven Script


Test execution results can be viewed and analyzed as soon as the run
session ends. To access the test results, go to the Test_Reports folder
customized using the test automation framework. Two folders will be
available: one showing the summary report for test suite execution, and
anoter folder called Detailed_Report that displays the detailed stepwise test results for each test script. A screenshot will be available
for the failure scripts under ScreenShot_Report.

www.Open2Test.org

Page 15

Open2Test Test Automation Framework for


Selenium Web Driver Quick Start Guide

COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the terms of the
GNU Library General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this
library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301, USA.

www.Open2Test.org

Page 16

You might also like