Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 14

Automation using Selenium

Agenda

Selenium Framework

What is Framework ?
Directory Structure of Framework
Understanding of POM
How to write Scripts in Framework
Advantages of Framework

Reporting in Selenium Web driver


TestNG Report
ReportNG Report

Asserts
Hard Assert
Soft Assert
Custom Assert

Data Provider
Data Provider
Custom Data Provider

What is Framework ?
A framework generally provides some base functionality which you
can use and extend to make more complex applications.
A framework is an environment, where you are given a set of tools to
work with this tools come in the form of libraries, configuration files,
reporting etc.

Directory Structure of Framework

Directory Structure of Framework


Config - Keeps all the configuration files such as property files
InputTestData - Has files containing input data for application
util - Utility package contains all generic functions & business functions
such as email configuration setting
and all other utilities
TestLogs - Contains log file corresponding to tests
base - Classes for accessing persistent storage, such as to a database
pageObjects - Page classes for particular pages

Advantage of Framework

Well defined architectural design


Less time to test large data
Script execution in multiple environments
Easier, faster and efficient analysis of result logs
Communication of results
Easy debugging and script maintenance
Robust and stable due to error and exception handling
100% reliability of utility scripts, online execution, report packs

Page Object Model

Web
Page

PO
Class

Report

Base
Class

Data
provider

Test
Cases

Advantage of Framework
Well defined architectural design
Less time to test large data
Script execution in multiple environments
Easier, faster and efficient analysis of result logs
Communication of results
Easy debugging and script maintenance
Robust and stable due to error and exception handling
100% reliability of utility scripts, online execution, report packs

ReportNG Report
ReportNG is a simple HTML reporting plug-in for the TestNG unittesting framework. It is intended as a replacement for the default
TestNG HTML report. The default report is comprehensive but is not
so easy to understand at-a-glance. ReportNG provides a simple,
colour-coded view of the test results.
ReportNG generates 100% valid XHTML 1.0 files. The output can
be customised by over-riding the default stylesheet with your own
CSS file.

ReportNG
Step 1: Add the below Jars Files to your project.

reportng-1.1.4.jar

velocity-dep-1.4.jar

guice-3.0.jar
Step 2: The Most important step, to make sure reportNG reports, we
need to disable the default TestNG Listeners.
It can be done by following the below steps:
Right Click on Properties
Click on TestNG
You will find an option as "Disable default listeners", check the
checbox.
Click on "Apply" button, it will show as message as "Project
preferences are saved".
Now Click on "OK" button.

ReportNG Report
Step 3: We need to add the below two listeners to testng.xml file.
<listeners>
<listener classname="org.uncommons.reportng.HTMLReporter"/>
<listener
class-name="org.uncommons.reportng.JUnitXMLReporter"/>
</listeners>

ReportNG
Sample ReportNg report

ReportNG
Report NG Report with screen capture

You might also like