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 - Grouping
 
Suppose there is a situation where we need to execute basic tests only or suppose we need to execute functional tests only or we need to test only regression tests only (where Basic,Functional and Regression are three groups) or you want execute only few tests under one group, then testNG grouping comes into picture. We have a provision to set a test under one or more groups:
eg:
public class groupDemo(){
@Test (groups= {"basic", "functional" })
public void login(){
system.out.println("inside login");
}

@Test (groups= { "functional" })
public void payment (){
system.out.println("inside payment");
}
}


Now inside testng.xml you can mention which groups need to be executed or run as follows:


<Test name="TestA">
<groups>
<run>
<include ="functional">
</run>
</groups>
<Classes>
<class name="GroupDemo">
</Classes>
</Test>
</suite>


In the above case both login and payment test cases are executed. In case above if we set include only to "basic" then only one test method (login) will be executed.
b) There is another way we need to learn in testng.xml. That is to define groups inside another group. The code looks like this:


<Suite name="SuiteA"></Suite>
<Test name="TestA">
<groups>
<define name="all">
<include name="basic">
<include name="functional">
</define>
<run>
<include name="all">
</run>
</groups>
</Test>
</suite>
In the above testng.xml example all(basic and functional) groups tests will be executed. In the above example if insated of <include name="basic"> , if we write <exclude name="basic">, then all the basic functionality will not get executed.

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/-