About - Selenium

Definition

Development and Versions

Pre-requisites

Languages supported

Manual vs Automation

Choosing Selenium

Selenium - Components

Selenium IDE

Selenium RC

Selenium WebDriver

Selenium Grid

QTP

Selenium vs QTP

Selenium - IDE

Features

Install and configure

Selenium - Webdriver

About WebDriver

install and configure

First test case

Web element

Element Locators

Example of locators

Chropath

Web driver commands

Eclipse and TestNG

About Eclipse

Choose and download

About TestNG

Testng installation on eclipse

Testng Annotations

Pass Fail and Skip test cases

Run test cases in batch

testng.xml - Explanation

testng grouping

Running tests parallely

dependsOnMethods

dependsOnGroups

Prioritization

Passing parameters

Data providers

Read data from excel

Ant - XSLT reports

Testng listeners

Cross browser testing

Page Object Model



Selenium - Listeners
 
Suppose there are 1000 test cases and in that we want to perform some operation when one of the test cases passes or fails. Definitely, it's very hard to identify 1 test out of 1000 when it fails and perform some operation at execution time when it fails. So this has to be done while coding time only not when running or executing time. To help in this scenario we have Listeners - TestNG listeners.
Eg:

a) Let see a sample code:
package mypacakage;
Public class Listener1 () extends TestListenerAdapter{

//There are several methods in TestListenerAdapter like onTestSuccess, onTestFailure, onTestSkipped, onTestStart and onTestStopped etc.

Public void onTestSuccess(iTestResult tr){
}
Public void onTestFailure(iTestResult tr){
}
}
In the above code, there are predefined methods like onTestSuccess or onTestFailure to perform some operations when test case is a success or failure.

Lets see how the code in testng.xml looks like for listeners:
<Suite name="ListenersSuite">
<listeners>
<listener class-name="Mypackage.Listener1">
</listeners>
<Test name="LoginFunctionality">
<classes>
<class name=>
</classes>
</Test>
</Suite>


We just need to add listeners tag and specify the listeners class name.Here in our case listener class is Listener1 with the package name mypackage.

I conduct online tutions on Manual Testing, Selenium and the following. For more details contact anandaibmindia@gmail.com
Manual Testing - 1600/-           Selenium - 1600/-
           Jsp and Servlet -2000/-           Java training - 2000/-