distributing testing and test reporting with selenium

18
Work Together Effectively Distributed Testing and Test Reporting with Selenium Christina Thalayasingam (Software Quality Assurance Engineer) 22 nd March 2016

Upload: christina-thalayasingam

Post on 16-Apr-2017

392 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Distributed Testing and Test Reporting with Selenium

Christina Thalayasingam(Software Quality Assurance Engineer)22nd March 2016

Page 2: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Agenda• Introduction to Selenium• Selenium Components• Selenium Grid Introduction• Extent Reports for Test Reporting• Demonstration

Page 3: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

What is Selenium ?• Selenium is a free (open source) automated testing suite for web

applications across different browsers and platforms.• Selenium provides a rich set of testing functions.• Selenium has 4 modules.

Page 4: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Selenium Components

Selenium WebDriver

Selenium Grid

Selenium IDE

Selenium RC

Page 5: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

What is Selenium Grid ?• It’s allows you to run multiple tests across different browsers,

operating systems, and machines• Grid uses hub-node concept

– The hub is the central point where you load your test– Nodes are the selenium instances that will execute the tests that you loaded on

the hub

Page 6: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Grid 1.0 vs Grid 2.0

Page 7: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

What is a Hub?• The hub is the central point where you load your tests into.• There should only be one hub in a grid.• The hub is launched only on a single machine.• The machine containing the hub is where the tests will be run, but

you will see the browser being automated on the node

Page 8: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

What is a Node ?• Nodes are the Selenium instances that will execute the tests that

you loaded on the hub.• There can be one or more nodes in a grid.• Nodes can be launched on multiple machines with different

platforms and browsers. • The machines running the nodes need not be the same platform as

that of the hub.

Page 9: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Configuring Selenium Grid

Node 1http://192.168.1.26:5566

Browser - Firefox

Node 2http://192.168.1.26:5567

Browser - Chrome

Node 3http://192.168.1.26:5568

Browser - IE

Hubhttp://192.168.1.71:4444

Page 10: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Demo!

Page 11: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Designing Test Scripts• To design test scripts that will run on the grid, we need to use

DesiredCapabilites and the RemoteWebDriver objects.– DesiredCapabilites is used to set the type of browser and OS that we will automate– RemoteWebDriver is used to set which node (or machine) that our test will run

against.

• To use the DesiredCapabilites object, you must first import this package

• To use the RemoteWebDriver object, you must import these packages.

Page 12: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

•Demo!

Page 13: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

ExtentReportsFeatures• Very simple to use• Beautiful and responsive UI• Provides dashboard for the entire test run• Organizes all used media (Screen-captures) for the run in a single

view• Supports TestNG and Junit

Page 14: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Log Status of ExtentReports

Add the necessary information to extract PASS, FAIL, ERROR, INFO, etc..

extent.log(LogStatus.PASS, "Checking for the user");extent.log(LogStatus.FAIL, "Checking for the user");extent.log(LogStatus.WARNING, "User not present");extent.log(LogStatus.ERROR, "Used creation did not get through");extent.log(LogStatus.FATAL, "404 Error");extent.log(LogStatus.INFO, "Launching browser");

Page 15: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Demo!

Page 16: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Questions

Page 17: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

We Are Hiring

www.zaizi.com/careers

Now looking for QA Automation Engineers

Page 18: Distributing Testing and Test Reporting with Selenium

Work Together Effectively

Thank you!