Professional Documents
Culture Documents
Automation Using Selenium
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
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.
Advantage of Framework
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