Saturday, 1 July 2017

Selenium TestNG Framework Tutorial: Annotations, Assertions and Test Execution

 


Introduction

Selenium WebDriver is a popular tool for automating web applications. However, Selenium alone does not provide a complete test management framework for organising, executing and reporting automated test cases.

This is where TestNG becomes useful.

TestNG is a Java testing framework inspired by JUnit and NUnit. It provides features such as annotations, assertions, test prioritisation, grouping, parameterisation, dependencies and parallel execution.

When combined with Selenium WebDriver, TestNG helps automation testers build structured, maintainable and reusable test automation suites.

In this tutorial, we will understand TestNG concepts and learn how to integrate TestNG with Selenium using practical Java examples.

1. What Is TestNG?

TestNG stands for Test Next Generation. It is a testing framework designed to simplify test organisation and execution.

It is commonly used in Selenium automation projects to:

  • Organise test cases.

  • Control test execution order.

  • Run tests in groups.

  • Validate expected and actual results.

  • Execute tests with different data sets.

  • Support parallel execution.

  • Generate execution reports.

TestNG is particularly useful when developing a Selenium automation framework for a real-world application.

2. Installing TestNG in a Selenium Java Project

You can use TestNG with Eclipse and Maven.

Step 1: Create a Maven Project

Open Eclipse and create a new Maven project.

Step 2: Add Dependencies

Add Selenium and TestNG dependencies to your pom.xml file.

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.38.0</version>
    </dependency>

    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.11.0</version>
        <scope>test</scope>
    </dependency>

</dependencies>

These are example dependency versions. Use compatible current versions when setting up a new project.

Step 3: Install the TestNG Eclipse Plugin

In Eclipse:

  1. Open the Eclipse Marketplace.

  2. Search for TestNG.

  3. Install the TestNG plugin.

  4. Restart Eclipse if prompted.

You can also execute TestNG tests through Maven without relying on the Eclipse plugin.

3. Understanding TestNG Annotations

Annotations are one of the most important features of TestNG. They control when different test methods and configuration methods execute.

Common TestNG annotations include:

AnnotationPurpose
@BeforeSuiteRuns before the test suite
@AfterSuiteRuns after the test suite
@BeforeTestRuns before the relevant XML test
@AfterTestRuns after the relevant XML test
@BeforeClassRuns before the first test method in a class
@AfterClassRuns after all test methods in a class
@BeforeMethodRuns before each test method
@AfterMethodRuns after each test method
@TestMarks a test method

Example of TestNG Annotations

import org.testng.annotations.*;

public class AnnotationExample {

    @BeforeSuite
    public void beforeSuite() {
        System.out.println("Before Suite");
    }

    @BeforeClass
    public void beforeClass() {
        System.out.println("Before Class");
    }

    @BeforeMethod
    public void beforeMethod() {
        System.out.println("Before Test Method");
    }

    @Test
    public void testLogin() {
        System.out.println("Executing Login Test");
    }

    @AfterMethod
    public void afterMethod() {
        System.out.println("After Test Method");
    }

    @AfterClass
    public void afterClass() {
        System.out.println("After Class");
    }

    @AfterSuite
    public void afterSuite() {
        System.out.println("After Suite");
    }
}

The annotations help testers control test setup, execution and cleanup.

4. Writing a Selenium TestNG Test Case

Let us create a simple Selenium test that opens a webpage and verifies its title.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.*;

public class SeleniumTestNGExample {

    WebDriver driver;

    @BeforeMethod
    public void setUp() {
        driver = new ChromeDriver();
        driver.get("https://example.com");
    }

    @Test
    public void verifyPageTitle() {

        String actualTitle = driver.getTitle();

        Assert.assertEquals(
            actualTitle,
            "Example Domain"
        );
    }

    @AfterMethod(alwaysRun = true)
    public void tearDown() {

        if (driver != null) {
            driver.quit();
        }
    }
}

In this example:

  • @BeforeMethod launches the browser and opens the webpage.

  • @Test executes the validation.

  • Assert.assertEquals() compares the actual and expected page titles.

  • @AfterMethod closes the browser even if the test fails.

5. TestNG Assertions

Assertions are used to verify whether an application behaves as expected.

TestNG provides several assertion methods.

Assert Equals

Assert.assertEquals(actual, expected);

Checks whether two values are equal.

Assert True

Assert.assertTrue(driver.getTitle().contains("Example"));

Checks whether a condition is true.

Assert False

Assert.assertFalse(driver.getTitle().contains("Error"));

Checks whether a condition is false.

Assert Not Null

Assert.assertNotNull(driver);

Checks whether an object is not null.

Hard Assertions and Soft Assertions

A hard assertion stops the current test method when an assertion fails.

Soft assertions allow execution to continue after an assertion failure. The tester must call assertAll() to report accumulated failures.

import org.testng.asserts.SoftAssert;

SoftAssert softAssert = new SoftAssert();

softAssert.assertEquals(actualTitle, expectedTitle);
softAssert.assertTrue(driver.getCurrentUrl().contains("example"));

softAssert.assertAll();

6. TestNG Priority

TestNG allows test methods to be assigned priorities.

@Test(priority = 1)
public void loginTest() {
    System.out.println("Login Test");
}

@Test(priority = 2)
public void dashboardTest() {
    System.out.println("Dashboard Test");
}

@Test(priority = 3)
public void logoutTest() {
    System.out.println("Logout Test");
}

Lower numeric priorities execute before higher numeric priorities under normal TestNG execution.

However, priority should not be used as a substitute for proper test independence or dependency management.

7. TestNG Groups

Groups allow related test cases to be organised and executed together.

@Test(groups = {"smoke"})
public void loginTest() {
    System.out.println("Smoke Test");
}

@Test(groups = {"regression"})
public void paymentTest() {
    System.out.println("Regression Test");
}

You can select groups for execution through a TestNG XML configuration file.

8. TestNG XML Configuration

A TestNG XML file helps control which test classes, methods or groups should execute.

Example testng.xml:

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">

<suite name="AutomationSuite">

    <test name="LoginTests">

        <classes>
            <class name="SeleniumTestNGExample"/>
        </classes>

    </test>

</suite>

You can run this configuration as a TestNG Suite from Eclipse or through a compatible Maven TestNG setup.

9. TestNG Parameterisation

Parameterisation allows the same test method to execute with different input values.

TestNG supports parameters through @Parameters and data-driven execution through @DataProvider.

Using DataProvider

@DataProvider(name = "loginData")
public Object[][] getLoginData() {

    return new Object[][] {
        {"user1", "pass1"},
        {"user2", "pass2"},
        {"user3", "pass3"}
    };
}

@Test(dataProvider = "loginData")
public void loginTest(String username, String password) {

    System.out.println(username);
    System.out.println(password);
}

This approach is useful for testing login functionality with multiple combinations of credentials.

10. Parallel Execution in TestNG

TestNG supports parallel execution through XML configuration.

Example:

<suite name="ParallelSuite" parallel="methods" thread-count="3">

    <test name="AutomationTests">
        <classes>
            <class name="SeleniumTestNGExample"/>
        </classes>
    </test>

</suite>

Parallel execution can reduce overall test duration. However, Selenium tests must use properly isolated WebDriver instances, commonly through ThreadLocal or another safe driver-management approach, to avoid browser-session conflicts.

11. TestNG Reports

TestNG generates execution reports after running tests.

Common output files include:

  • test-output/index.html

  • test-output/emailable-report.html

These reports help testers review:

  • Passed test cases.

  • Failed test cases.

  • Skipped tests.

  • Execution details.

  • Error information.

For larger automation projects, TestNG reports can also be integrated with reporting tools such as Allure or Extent Reports.

12. Best Practices for Selenium TestNG Frameworks

  1. Keep test methods focused on one validation objective.

  2. Use meaningful test method names.

  3. Separate browser setup and cleanup from test logic.

  4. Use assertions to validate actual application behaviour.

  5. Use DataProviders for multiple test inputs.

  6. Organise smoke and regression tests into groups.

  7. Avoid unnecessary dependencies between test cases.

  8. Use isolated WebDriver instances for parallel execution.

  9. Maintain reusable methods and Page Object Model classes.

  10. Integrate automated execution with CI/CD pipelines.

Frequently Asked Questions

1. What is TestNG in Selenium?

TestNG is a Java testing framework used with Selenium WebDriver to organise, execute and report automated test cases.

2. What are the most important TestNG annotations?

Common annotations include @Test, @BeforeMethod, @AfterMethod, @BeforeClass, @AfterClass, @BeforeSuite and @AfterSuite.

3. What is the difference between hard and soft assertions?

Hard assertions stop the current test method after a failure. Soft assertions collect failures and report them when assertAll() is called.

4. What is DataProvider in TestNG?

@DataProvider supplies multiple sets of test data to a test method.

5. Can TestNG execute Selenium tests in parallel?

Yes. TestNG supports parallel execution at suite, test, class and method levels, provided the automation framework manages browser sessions safely.

6. Is TestNG required for Selenium?

No. Selenium can be used with other test frameworks, but TestNG is a popular choice for Java-based automation projects.

Learn Selenium Automation Testing with Palium Skills

Palium Skills provides practical automation testing training for freshers, manual testers and working professionals.

The Selenium and Playwright training curriculum can include:

  • Selenium WebDriver with Java and Python.

  • TestNG annotations, assertions and DataProviders.

  • XPath and CSS Selector techniques.

  • Page Object Model and automation framework development.

  • API testing and integration.

  • Maven, Git and Jenkins.

  • Real-time automation projects.

  • Interview preparation and career guidance.

Training modes: Classroom sessions at South Kolkata and Salt Lake centres, and instructor-led live online training for learners across India.

Contact Palium Skills

South Kolkata Centre: 1st Floor, Sheeba Bhavan, 1/22 Poddar Nagar (Near South City Mall), Kolkata – 700068.

Salt Lake Centre: 5th Floor, RDB Boulevard, Block GP, Salt Lake Electronic Complex, Kolkata – 700091.

Build practical Selenium automation and software testing skills with Palium Skills through classroom and live online training.

Thursday, 1 June 2017

Page Object Model (POM) in Selenium: Complete Guide with Java Examples

 



As Selenium automation projects grow, maintaining test scripts becomes increasingly challenging. A simple automation script may work well for a few test cases, but larger applications can have hundreds of pages, elements and workflows.

If element locators and test logic are repeated across multiple scripts, even a small change in the application can require updates in several places.

The Page Object Model (POM) is a popular design pattern used in Selenium automation testing to solve this problem.

POM separates webpage-specific elements and interactions from test execution logic. This makes automation frameworks easier to maintain, reuse and expand.

In this tutorial, we will understand the Page Object Model, its advantages, project structure and implementation using Selenium WebDriver with Java and TestNG.

1. What Is Page Object Model in Selenium?

Page Object Model is a design pattern in which each application page or meaningful page component is represented by a separate Java class.

Each page class generally contains:

  • Web element locators.

  • Methods to interact with those elements.

  • Page-specific operations.

  • Reusable functionality.

For example, an e-commerce application may contain:

  • Login Page

  • Home Page

  • Product Page

  • Shopping Cart Page

  • Checkout Page

Each of these can be represented by a separate Java class.

Instead of writing the same element locators repeatedly in test cases, testers maintain them in their corresponding page classes.

2. Why Is Page Object Model Required?

Consider a login page containing username, password and login button elements.

Without POM, the same locators may be repeated in several test scripts.

If the username field's ID changes, multiple test cases may need modification.

With POM, the locator is maintained in one page class. Updating it there can benefit every test that uses that class.

Advantages of POM

  1. Maintainability: Element locators are organised centrally.

  2. Reusability: Page methods can be reused across test cases.

  3. Readability: Test scripts become easier to understand.

  4. Scalability: New pages and workflows can be added systematically.

  5. Reduced duplication: Common page interactions do not need to be repeated.

  6. Separation of responsibilities: Page interactions are separated from test execution and validation.

3. Typical Selenium POM Framework Structure

A Maven-based Selenium automation project may use the following structure:

SeleniumAutomationFramework
│
├── src/main/java
│   ├── pages
│   │   ├── LoginPage.java
│   │   ├── HomePage.java
│   │   └── ProductPage.java
│   │
│   └── utilities
│       └── DriverFactory.java
│
├── src/test/java
│   ├── tests
│   │   ├── LoginTest.java
│   │   └── ProductTest.java
│   │
│   └── base
│       └── BaseTest.java
│
├── pom.xml
└── testng.xml

The exact folder structure may vary depending on project requirements.

4. Creating a Login Page Class

Let us create a simple Login Page using Selenium WebDriver.

LoginPage.java

package pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class LoginPage {

    WebDriver driver;

    By username =
        By.id("username");

    By password =
        By.id("password");

    By loginButton =
        By.id("login");

    public LoginPage(WebDriver driver) {
        this.driver = driver;
    }

    public void enterUsername(String user) {
        driver.findElement(username).sendKeys(user);
    }

    public void enterPassword(String pass) {
        driver.findElement(password).sendKeys(pass);
    }

    public void clickLogin() {
        driver.findElement(loginButton).click();
    }

    public void login(String user, String pass) {
        enterUsername(user);
        enterPassword(pass);
        clickLogin();
    }
}

This class contains the locators and operations required to interact with the login page.

The constructor receives the WebDriver instance so that the page object uses the browser session managed by the test framework.

5. Creating a Base Test Class

A Base Test class can manage common browser setup and cleanup.

BaseTest.java

package base;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.*;

public class BaseTest {

    protected WebDriver driver;

    @BeforeMethod
    public void setUp() {

        driver = new ChromeDriver();

        driver.manage().window().maximize();

        driver.get("https://example.com");
    }

    @AfterMethod(alwaysRun = true)
    public void tearDown() {

        if (driver != null) {
            driver.quit();
        }
    }
}

This example creates a fresh browser session before each test method and closes it afterward.

For larger projects, browser creation can be moved into a reusable Driver Factory.

6. Creating a Login Test Using POM

Now we can use the LoginPage class in a TestNG test.

LoginTest.java

package tests;

import base.BaseTest;
import pages.LoginPage;

import org.testng.Assert;
import org.testng.annotations.Test;

public class LoginTest extends BaseTest {

    @Test
    public void verifySuccessfulLogin() {

        LoginPage loginPage =
            new LoginPage(driver);

        loginPage.login(
            "testuser",
            "Test@123"
        );

        Assert.assertTrue(
            driver.getCurrentUrl().contains("dashboard")
        );
    }
}

The test method does not need to know how the username field or login button is located.

It simply calls the page method and validates the result.

The URL and element locators are illustrative; they should be replaced with those of the application under test.

7. What Is Page Factory in Selenium?

Page Factory is a Selenium support feature that provides a convenient way to initialise page elements using annotations such as @FindBy.

Example:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class LoginPage {

    @FindBy(id = "username")
    WebElement username;

    @FindBy(id = "password")
    WebElement password;

    @FindBy(id = "login")
    WebElement loginButton;

    public LoginPage(WebDriver driver) {

        PageFactory.initElements(driver, this);
    }

    public void login(String user, String pass) {

        username.sendKeys(user);
        password.sendKeys(pass);
        loginButton.click();
    }
}

Page Factory is optional. A POM framework can also use ordinary By locators and findElement() calls.

Modern Selenium frameworks often prefer explicit locator management because it makes element lookup and wait behaviour easier to control.

8. Difference Between POM and Page Factory

FeaturePage Object ModelPage Factory
TypeDesign patternSelenium support feature
PurposeOrganises page-specific codeInitialises page elements
Element definitionCommonly uses By locatorsCommonly uses @FindBy
RequirementCan be implemented without Page FactoryUsed within a page-object design
FlexibilityHighProvides a convenient annotation-based approach

Page Factory does not replace POM. It is one optional way of implementing page objects.

9. Best Practices for Building a POM Framework

  • Maintain separate page classes for application pages or components.

  • Keep locators and page interactions inside page classes.

  • Keep assertions and test scenarios primarily in test classes.

  • Use meaningful method and class names.

  • Avoid duplicating browser setup across test classes.

  • Use explicit waits for dynamic elements.

  • Maintain reusable utility methods carefully.

  • Keep test data separate from test logic.

  • Use Maven for dependency management.

  • Integrate the framework with Git and CI/CD tools.

10. Common POM Interview Questions

1. What is Page Object Model in Selenium?

POM is a design pattern that represents application pages or components as separate classes containing locators and interaction methods.

2. What are the benefits of POM?

It improves maintainability, reusability, readability and scalability while reducing duplicated code.

3. Is Page Factory mandatory for POM?

No. Page Factory is optional. POM can be implemented using standard Selenium locators and WebDriver methods.

4. Where should assertions be written in a POM framework?

Assertions are generally placed in test classes so that page objects focus on page interactions and the tests focus on validation.

5. Can POM be used with TestNG?

Yes. POM is commonly combined with TestNG to organise page interactions and manage test execution.

6. Can POM be used with Selenium Python?

Yes. The Page Object Model is a design pattern and can be implemented in Python using Selenium and frameworks such as PyTest.

Learn Selenium Automation Framework Development with Palium Skills

Learning Selenium commands is only the first step toward becoming an automation test engineer. Developing a reusable automation framework is an important practical skill.

Palium Skills offers Selenium and Playwright automation testing training covering:

  • Selenium WebDriver with Java and Python.

  • Page Object Model and framework development.

  • TestNG and PyTest.

  • XPath and CSS Selector.

  • Data-driven automation testing.

  • API testing and integration.

  • Maven, Git and Jenkins.

  • Real-time automation projects.

  • Interview preparation and career guidance.

Training modes: Classroom training at South Kolkata and Salt Lake centres, plus instructor-led live online sessions for learners across India.

Contact Palium Skills

South Kolkata Centre: 1st Floor, Sheeba Bhavan, 1/22 Poddar Nagar (Near South City Mall), Kolkata – 700068.

Salt Lake Centre: 5th Floor, RDB Boulevard, Block GP, Salt Lake Electronic Complex, Kolkata – 700091.

Build practical Selenium automation frameworks with Palium Skills through classroom and live online training.

Monday, 1 May 2017

Data-Driven Testing Using Selenium and Excel: Complete Java Tutorial

 


Introduction

In software testing, the same functionality often needs to be tested with multiple sets of input data. For example, a login page may need validation using valid credentials, incorrect passwords, blank fields and invalid usernames.

Writing a separate Selenium test script for every input combination can make an automation project repetitive and difficult to maintain.

Data-driven testing solves this problem by separating test data from test logic. Instead of hardcoding input values into test scripts, testers maintain data in external sources such as Excel spreadsheets, CSV files, databases or JSON files.

In Selenium automation using Java, Excel is a popular option for managing test data. The Apache POI library helps Java programs read and process Excel workbooks.

This tutorial explains how to integrate Selenium, Java, Excel and TestNG to create a basic data-driven automation test.

1. What Is Data-Driven Testing?

Data-driven testing is an automation approach in which a single test script executes multiple times using different input data.

For example, consider a login application.

Test CaseUsernamePasswordExpected Result
TC01validuservalid123Login successful
TC02validuserwrong123Login unsuccessful
TC03invaliduservalid123Login unsuccessful
TC04blankblankValidation message

Instead of writing four separate scripts, one Selenium test method can execute all four scenarios using data supplied from an external file.

2. Advantages of Data-Driven Testing

  • Reuses the same automation script with multiple inputs.

  • Reduces duplicate test code.

  • Makes test data easier to maintain.

  • Helps validate positive and negative scenarios.

  • Supports larger regression test suites.

  • Allows testers and business teams to review test data separately from automation code.

3. Tools Required

To implement data-driven testing using Selenium and Excel, you will need:

  1. Java Development Kit (JDK).

  2. Eclipse or IntelliJ IDEA.

  3. Selenium WebDriver.

  4. Apache Maven.

  5. TestNG.

  6. Apache POI.

  7. Microsoft Excel or a compatible spreadsheet application.

4. Create a Maven Project and Add Dependencies

Create a Maven project in Eclipse or IntelliJ IDEA.

Add the following dependencies to your pom.xml file:

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.38.0</version>
    </dependency>

    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.11.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>5.4.1</version>
        <scope>test</scope>
    </dependency>

</dependencies>

These are example dependency versions. Check compatibility and use suitable current releases when creating a new project.

Apache POI provides Java APIs for working with Excel files, including .xlsx workbooks.

5. Create an Excel Test Data File

Create an Excel file named TestData.xlsx.

Add a worksheet called LoginData and enter the following information:

UsernamePasswordExpected Result
validuservalid123Success
validuserwrong123Failure
invaliduservalid123Failure
blankblankFailure

Save the file in the project's test resources folder, for example:

src/test/resources/TestData.xlsx

The test application must contain corresponding test accounts and predictable responses for these scenarios. The sample values above are illustrative.

6. Read Excel Data Using Apache POI

Apache POI provides classes such as:

  • FileInputStream – opens the Excel file.

  • Workbook – represents the workbook.

  • Sheet – represents a worksheet.

  • Row – represents a row.

  • Cell – represents a cell.

Create a utility class named ExcelUtils.java.

package utilities;

import java.io.FileInputStream;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class ExcelUtils {

    public static Object[][] getExcelData(String filePath)
            throws Exception {

        try (FileInputStream fis =
                 new FileInputStream(filePath);
             Workbook workbook = new XSSFWorkbook(fis)) {

            Sheet sheet = workbook.getSheet("LoginData");

            int rowCount = sheet.getLastRowNum();

            int columnCount =
                sheet.getRow(0).getLastCellNum();

            Object[][] data =
                new Object[rowCount][columnCount];

            DataFormatter formatter = new DataFormatter();

            for (int i = 1; i <= rowCount; i++) {

                Row row = sheet.getRow(i);

                for (int j = 0; j < columnCount; j++) {

                    Cell cell = row.getCell(
                        j,
                        Row.MissingCellPolicy.CREATE_NULL_AS_BLANK
                    );

                    data[i - 1][j] =
                        formatter.formatCellValue(cell);
                }
            }

            return data;
        }
    }
}

This utility reads the worksheet and returns its contents as a two-dimensional Java array.

The first row is treated as the header and excluded from the test data.

For production frameworks, additional checks should be added for missing worksheets, empty files and inconsistent column structures.

7. Connect Excel Data with TestNG DataProvider

TestNG provides the @DataProvider annotation to supply multiple sets of data to a test method.

Create a test class named LoginDataTest.java.

package tests;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import utilities.ExcelUtils;

public class LoginDataTest {

    @DataProvider(name = "loginData")
    public Object[][] getLoginData() throws Exception {

        String filePath =
            "src/test/resources/TestData.xlsx";

        return ExcelUtils.getExcelData(filePath);
    }

    @Test(dataProvider = "loginData")
    public void loginTest(
            String username,
            String password,
            String expectedResult) {

        System.out.println("Username: " + username);
        System.out.println("Password: " + password);
        System.out.println("Expected: " + expectedResult);
    }
}

When TestNG executes this test, it invokes the same test method once for each row returned by the DataProvider.

This example demonstrates data delivery. The next step is to connect the supplied data to actual Selenium browser interactions.

8. Execute Selenium Login Tests Using Excel Data

The following example shows how Excel data can be used to execute a Selenium login test.

package tests;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.Assert;
import org.testng.annotations.*;

public class SeleniumExcelTest {

    WebDriver driver;

    @BeforeMethod
    public void setUp() {

        driver = new ChromeDriver();

        driver.manage().window().maximize();

        driver.get("https://example.com/login");
    }

    @Test(dataProvider = "loginData",
          dataProviderClass = LoginDataTest.class)
    public void verifyLogin(
            String username,
            String password,
            String expectedResult) {

        driver.findElement(By.id("username"))
              .sendKeys(username);

        driver.findElement(By.id("password"))
              .sendKeys(password);

        driver.findElement(By.id("login"))
              .click();

        boolean loginSuccessful =
            driver.getCurrentUrl().contains("dashboard");

        if (expectedResult.equalsIgnoreCase("Success")) {
            Assert.assertTrue(
                loginSuccessful,
                "Expected successful login"
            );
        } else {
            Assert.assertFalse(
                loginSuccessful,
                "Expected login failure"
            );
        }
    }

    @AfterMethod(alwaysRun = true)
    public void tearDown() {

        if (driver != null) {
            driver.quit();
        }
    }
}

Important: This is an illustrative example. Replace the URL, element locators and success-condition logic with those of the actual application. In a production test, use an application-specific result message or other reliable validation instead of relying only on URL changes.

9. Excel vs CSV vs Database for Test Data

Data sourceAdvantagesTypical use
ExcelEasy to review and maintainSmall and medium test data sets
CSVLightweight and simpleStructured tabular data
DatabaseSupports large and structured datasetsEnterprise applications
JSONSupports nested data structuresAPI and complex test scenarios

The choice depends on project size, data complexity, team preferences and maintenance requirements.

10. Best Practices for Data-Driven Automation

  1. Keep test data separate from automation logic.

  2. Use meaningful Excel worksheet and column names.

  3. Avoid hardcoding file paths throughout the framework.

  4. Validate missing or blank cells.

  5. Use DataFormatter when reading mixed Excel cell types.

  6. Do not store real passwords or sensitive credentials in plain Excel files.

  7. Use a separate test-data management approach for large projects.

  8. Maintain reusable Excel-reading utilities.

  9. Capture test results and execution logs.

  10. Use TestNG reports to track passed and failed scenarios.

Frequently Asked Questions

1. What is data-driven testing in Selenium?

It is an approach where the same Selenium test script executes with multiple input data sets.

2. Which library is used to read Excel files in Selenium Java?

Apache POI is a widely used Java library for reading and writing Excel workbooks.

3. What is TestNG DataProvider?

@DataProvider supplies multiple sets of input data to a TestNG test method.

4. Can Selenium read Excel files directly?

Selenium does not provide native Excel-reading functionality. Java libraries such as Apache POI are commonly used for this purpose.

5. Can data-driven testing be implemented without Excel?

Yes. CSV, JSON, databases and other data sources can also be used.

6. Why is data-driven testing important?

It reduces duplicated scripts, improves test coverage and makes it easier to maintain multiple test scenarios.

Learn Selenium Automation Testing with Palium Skills

Palium Skills offers practical Selenium and Playwright automation testing training for freshers, manual testers and working professionals.

The training curriculum can include:

  • Selenium WebDriver with Java and Python.

  • Data-driven testing using Excel and Apache POI.

  • TestNG and PyTest frameworks.

  • XPath and CSS Selector techniques.

  • Page Object Model and framework development.

  • API testing and automation.

  • Maven, Git and Jenkins integration.

  • Real-time automation projects.

  • Interview preparation and career guidance.

Training modes: Classroom training at South Kolkata and Salt Lake centres, along with instructor-led live online sessions for learners across India.

Contact Palium Skills

South Kolkata Centre: 1st Floor, Sheeba Bhavan, 1/22 Poddar Nagar (Near South City Mall), Kolkata – 700068.

Salt Lake Centre: 5th Floor, RDB Boulevard, Block GP, Salt Lake Electronic Complex, Kolkata – 700091.

Build practical Selenium automation skills with Palium Skills through classroom and live online training.

Saturday, 1 April 2017

Selenium with Maven: Complete Integration Guide for Java Automation Testing

 



Introduction

Selenium WebDriver is one of the most widely used tools for automating web application testing. When working on real-time automation projects, testers need more than Selenium commands and Java programming. They also need an efficient way to manage dependencies, organise project files, execute test cases, and maintain automation frameworks.

This is where Apache Maven becomes important.

Maven is a build automation and project management tool used extensively in Java development. It simplifies the management of Selenium libraries, testing frameworks, reporting tools, and other dependencies. Instead of manually downloading and configuring JAR files, testers can declare the required libraries in a configuration file called pom.xml.

In this guide, we will explore how to integrate Selenium WebDriver with Maven and create a basic Java automation testing project.

1. What Is Maven?

Apache Maven is a Java-based build and dependency management tool. It helps developers and automation testers manage project configurations and dependencies in a consistent manner.

Some important Maven features include:

  • Dependency management: Downloads and manages Selenium, TestNG, JUnit and other libraries.

  • Standard project structure: Organises source code, test cases and resources.

  • Build automation: Supports compilation, testing and packaging.

  • Plugin integration: Provides plugins for test execution, reporting and other build activities.

  • Reproducible builds: Helps teams use consistent project configurations.

Maven uses an XML configuration file called pom.xml, where project details, dependencies and plugins are defined.

2. Why Use Maven with Selenium?

A basic Selenium Java project can work with manually downloaded JAR files. However, managing multiple libraries manually becomes difficult as the automation framework grows.

Maven makes the process easier.

Without MavenWith Maven
Download JAR files manuallyDependencies downloaded automatically
Configure libraries individuallyManage libraries centrally
Maintain complex project structuresFollow standard project structure
Update dependencies manuallyChange dependency versions in pom.xml
More difficult team collaborationEasier project sharing and consistency

For professional automation testing, Maven is particularly useful when Selenium is integrated with TestNG, JUnit, Apache POI, ExtentReports and CI/CD tools such as Jenkins.

3. Prerequisites for Selenium Maven Integration

Before creating the project, install the following tools:

  1. Java Development Kit (JDK): Install a supported JDK version and configure JAVA_HOME.

  2. IDE: Eclipse or IntelliJ IDEA.

  3. Apache Maven: Use the Maven installation bundled with your IDE or install Maven separately.

  4. Browser: Google Chrome, Firefox or Microsoft Edge.

  5. Selenium WebDriver: Managed through Maven dependencies.

You should also understand basic Java programming concepts, including classes, objects, methods and exception handling.

Modern Selenium 4 releases include Selenium Manager, which can automatically manage browser drivers in many standard configurations. This reduces the need for manual driver downloads.

4. Create a Selenium Maven Project in Eclipse

Follow these steps to create a Maven project.

Step 1: Open Eclipse

Launch Eclipse and select your preferred workspace.

Step 2: Create a Maven project

Navigate to:

File → New → Maven Project

Select the option to create a simple project or use the appropriate archetype.

Step 3: Enter project details

For example:

  • Group ID: com.palium.automation

  • Artifact ID: selenium-maven-project

  • Version: 1.0-SNAPSHOT

  • Packaging: jar

Click Finish.

Step 4: Verify the project structure

A standard Maven project follows this structure:

selenium-maven-project
│
├── pom.xml
│
└── src
    ├── main
    │   └── java
    │
    └── test
        ├── java
        └── resources

For a test-focused Selenium project, most test classes will be stored under src/test/java.

Configuration files, test data and suite XML files can be stored under src/test/resources.

5. Add Selenium Dependency in pom.xml

The pom.xml file is the heart of a Maven project.

Open pom.xml and add the Selenium Java dependency inside the dependencies section.

The following is an example using Selenium Java version 4.38.0. Always check the current stable release and compatibility requirements before using a version in a new project.

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.palium.automation</groupId>
    <artifactId>selenium-maven-project</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <selenium.version>4.38.0</selenium.version>
        <testng.version>7.11.0</testng.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium.version}</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.1</version>
                <configuration>
                    <release>17</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.4</version>
            </plugin>

        </plugins>
    </build>

</project>

The example uses Java 17. If you use another JDK version, update the compiler configuration and verify compatibility with your selected dependencies.

After saving the file, right-click the project and select:

Maven → Update Project

Maven will download the required libraries from the configured repositories.

6. Create Your First Selenium Test Using TestNG

Once the dependencies have been downloaded, create a Java test class under:

src/test/java

Create a class named GoogleSearchTest.java.

package com.palium.automation;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;

import org.testng.annotations.Test;
import org.testng.annotations.AfterMethod;

import java.time.Duration;

public class GoogleSearchTest {

    WebDriver driver;

    @Test
    public void searchTest() {

        driver = new ChromeDriver();

        driver.manage().window().maximize();

        driver.get("https://www.google.com");

        WebDriverWait wait = new WebDriverWait(
            driver, Duration.ofSeconds(10)
        );

        WebElement searchBox = wait.until(
            ExpectedConditions.visibilityOfElementLocated(
                By.name("q")
            )
        );

        searchBox.sendKeys("Selenium with Java");
        searchBox.submit();

        wait.until(
            ExpectedConditions.titleContains("Selenium")
        );
    }

    @AfterMethod
    public void closeBrowser() {

        if (driver != null) {
            driver.quit();
        }
    }
}

This example demonstrates how Maven-managed Selenium and TestNG dependencies can be used together.

The test launches Chrome, opens Google, enters a search term and waits for the page title to contain the expected text.

Website layouts and behaviour can change, so use a suitable test application and stable locators when developing production automation scripts.

7. Execute Selenium Tests Using Maven Commands

Maven provides several commands for managing the automation project.

Maven CommandPurpose
mvn cleanRemoves the previous build output
mvn compileCompiles main source code
mvn testRuns tests configured for the Maven test lifecycle
mvn clean testCleans the project and executes tests
mvn packageExecutes preceding lifecycle phases and packages the project
mvn installBuilds and installs the project artifact in the local repository

To run your Selenium TestNG tests from the project directory, execute:

mvn clean test

The Maven Surefire Plugin runs test classes according to its naming conventions and configuration.

If you want to execute a specific TestNG suite XML file, configure Surefire explicitly:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.5.4</version>
    <configuration>
        <suiteXmlFiles>
            <suiteXmlFile>
                src/test/resources/testng.xml
            </suiteXmlFile>
        </suiteXmlFiles>
    </configuration>
</plugin>

The suite file must exist at the specified location. It is not automatically selected merely because TestNG is included as a dependency.

8. Integrating Maven with a Selenium Automation Framework

For a real-time project, testers generally create a structured automation framework rather than keeping all scripts in one Java class.

A sample structure is:

selenium-maven-project
│
├── pom.xml
│
└── src
    ├── main
    │   └── java
    │       ├── pages
    │       ├── utilities
    │       └── base
    │
    └── test
        ├── java
        │   ├── tests
        │   └── listeners
        │
        └── resources
            ├── testdata
            └── testng.xml

A professional Selenium framework may include:

  • Page Object Model (POM)

  • TestNG or JUnit

  • Explicit waits

  • Data-driven testing

  • Apache POI for Excel test data

  • Logging and reporting

  • Screenshot capture on failure

  • Configuration management

  • Cross-browser execution

  • Git and GitHub integration

  • Jenkins-based continuous integration

Maven makes it easier to add and maintain the libraries required for these features.

9. Common Problems During Selenium Maven Integration

Problem 1: Maven dependencies are not downloaded

Check your internet connection, repository access and Maven configuration. In Eclipse, use Maven Update Project and check the console for dependency-resolution errors.

Problem 2: Java version mismatch

Verify that the JDK configured in your IDE matches the compiler version declared in pom.xml.

Problem 3: Browser driver errors

Use a compatible browser version and a supported Selenium release. Selenium Manager can handle many standard driver-management scenarios, but network restrictions and unusual browser configurations may require additional setup.

Problem 4: Tests are not executing

Verify that the test classes are under src/test/java, that their names match Surefire discovery conventions, and that the TestNG provider and suite configuration are correct.

Problem 5: Build succeeds but browser tests fail

Check browser availability, application accessibility, locators, synchronization and environment-specific settings.

10. Why Selenium with Maven Is Important for Automation Testers

Knowledge of Selenium WebDriver alone is not sufficient for developing and maintaining enterprise-level automation solutions.

Employers expect automation testers to understand project organisation, dependency management, test execution and framework development.

Selenium with Maven is particularly useful for:

  • Building scalable Java automation frameworks.

  • Managing multiple testing libraries.

  • Running test suites consistently.

  • Integrating automation with Jenkins.

  • Supporting team-based development.

  • Maintaining automation projects over time.

It is an important skill for aspiring Automation Test Engineers and Software Development Engineers in Test (SDETs).

11. Learn Selenium with Java at Palium Skills

Palium Skills offers practical Selenium Automation Testing training designed for freshers, manual testers, working professionals and individuals planning to enter software testing.

The training covers Selenium WebDriver with Java, Maven integration, TestNG, Page Object Model, XPath, CSS selectors, waits, data-driven testing, automation framework development and practical project implementation.

Training options include:

  • Classroom training at South Kolkata and Salt Lake centres.

  • Instructor-led live online sessions for learners across India.

  • Hands-on automation exercises.

  • Practical framework development.

  • Real-time project-oriented learning.

Learners can also explore related training in Selenium with Python, Playwright with Java, Playwright with Python and API automation testing.

Contact Palium Skills

South Kolkata Centre: 1st Floor, Sheeba Bhavan, 1/22 Poddar Nagar, Near South City Mall, Kolkata – 700068.

Salt Lake Centre: 5th Floor, RDB Boulevard, Block GP, Salt Lake Electronic Complex, Kolkata – 700091.

Contact Palium Skills to enquire about Selenium with Java classroom and live online training.

Frequently Asked Questions (FAQs)

1. What is Maven in Selenium?

Maven is a Java build and dependency management tool used to manage Selenium libraries, testing frameworks and project configurations.

2. Why is Maven used with Selenium WebDriver?

Maven simplifies dependency management, project organisation, test execution and integration with tools such as TestNG and Jenkins.

3. How do I add Selenium to a Maven project?

Add the selenium-java dependency to the pom.xml file and update the Maven project to download the required libraries.

4. Can I use TestNG with Selenium Maven?

Yes. Add the TestNG dependency and configure Maven Surefire Plugin to execute your TestNG tests.

5. Which command runs Selenium tests using Maven?

The commonly used command is mvn clean test, provided the test framework and Maven test execution configuration are correctly set up.

6. Is Maven required for Selenium automation?

No. Selenium can be used without Maven, but Maven is highly useful for professional Java automation projects because it simplifies dependency and build management.

7. Can Maven be integrated with Jenkins?

Yes. Jenkins can execute Maven commands such as mvn clean test to run Selenium automation suites as part of a CI/CD pipeline.

8. Is Selenium with Maven suitable for freshers?

Yes. Learning Selenium with Java and Maven helps freshers understand how automation projects are organised and executed in professional testing environments.


Start learning Selenium with Java and Maven at Palium Skills and develop practical skills for automation testing projects.

Wednesday, 1 March 2017

Selenium Grid for Parallel Testing: Architecture, Setup and Execution Guide

 


Introduction

Automation testing plays an important role in ensuring the quality and reliability of modern web applications. As applications become larger and more complex, automation teams need to execute hundreds or even thousands of test cases efficiently.

Running every Selenium test sequentially can consume considerable time. For example, if 100 test cases take approximately 30 seconds each, executing them one after another may take around 50 minutes, excluding setup and reporting overhead.

Selenium Grid addresses this challenge by allowing automation tests to run across multiple machines, browsers and operating systems. Instead of executing all tests on a single local browser, Selenium Grid distributes sessions across available browser environments.

This approach is particularly useful for large automation projects, regression testing, cross-browser compatibility testing and continuous integration pipelines.

In this guide, we will understand Selenium Grid architecture, learn how to configure it, and explore parallel execution using Java and TestNG.

1. What Is Selenium Grid?

Selenium Grid is a component of the Selenium ecosystem that enables remote browser automation and parallel test execution.

It allows testers to run Selenium WebDriver tests on different browser environments simultaneously.

For example, a test suite can be executed across:

  • Google Chrome on Windows.

  • Firefox on Linux.

  • Microsoft Edge on Windows.

  • Chrome on a remote virtual machine.

  • Multiple browser instances on separate machines.

Rather than requiring every tester to execute tests manually on individual systems, Selenium Grid provides a centralised way to manage remote browser sessions.

Why use Selenium Grid?

Some important benefits include:

  1. Faster test execution: Multiple tests can run simultaneously.

  2. Cross-browser testing: Execute tests on different browsers.

  3. Remote execution: Run browser tests on separate machines.

  4. Scalability: Add more execution capacity when required.

  5. CI/CD integration: Connect automated tests with Jenkins and other build pipelines.

  6. Environment coverage: Validate applications across different operating systems and browser configurations.

2. Selenium Grid Architecture Explained

Selenium Grid 4 uses a distributed architecture. Its main components include the Router, Distributor, Session Map, New Session Queue, and Nodes.

<AsyncImage query="Selenium Grid 4 architecture diagram Router Distributor Session Map New Session Queue Nodes browser instances" aspectRatio="16:9" width="100%" />

Major Selenium Grid components

1. Router

The Router acts as the entry point for incoming WebDriver requests. It directs requests to the appropriate Grid components.

2. Distributor

The Distributor is responsible for allocating new browser sessions to suitable Nodes based on the requested capabilities and available resources.

3. Session Map

The Session Map maintains information about active sessions and the Nodes where those sessions are running.

4. New Session Queue

When a new session cannot be allocated immediately, the request can wait in the New Session Queue until a suitable Node becomes available.

5. Node

A Node provides the browser execution environment. It can support one or more browser sessions, depending on its configuration and available resources.

6. Event Bus

The Event Bus enables communication between the different Grid components.

How Selenium Grid works

The general execution flow is:

  1. A Java automation test creates a RemoteWebDriver request.

  2. The request reaches the Grid Router.

  3. The Grid processes the requested browser capabilities.

  4. The Distributor identifies a suitable Node.

  5. The Node starts the required browser session.

  6. WebDriver commands are routed to the active session.

  7. The test executes and receives responses from the browser.

This architecture allows automation teams to separate test execution from the machine running the test code.

3. Selenium Grid 4: Important Features

Selenium Grid 4 introduced a more modular architecture and improved support for distributed execution.

Some important features include:

  • Standalone mode for simple local setups.

  • Hub and Node mode for distributed environments.

  • Fully distributed deployment for larger environments.

  • Support for browser sessions across multiple Nodes.

  • Grid status and monitoring interfaces.

  • Docker-based deployment options.

  • Improved infrastructure for managing sessions.

For most learners, starting with Standalone mode and then progressing to Hub and Node configuration is a practical learning approach.

4. Prerequisites for Setting Up Selenium Grid

Before configuring Selenium Grid, ensure that you have:

  • Java Development Kit (JDK).

  • Selenium 4 Java libraries.

  • Chrome, Firefox or Edge browser.

  • Maven or another Java build tool.

  • Selenium Server standalone JAR.

  • Basic knowledge of Selenium WebDriver and Java.

You can obtain Selenium Server from the official Selenium website:

https://www.selenium.dev/downloads/

Use a Selenium Server version compatible with your Selenium Java client and the environment in which the Grid will run.

5. Setting Up Selenium Grid in Standalone Mode

Standalone mode is the easiest way to start learning Selenium Grid.

In this mode, the Grid components run together in a single process.

Step 1: Download Selenium Server

Download the Selenium Server JAR from the official Selenium downloads page.

For example, the downloaded file may be named:

selenium-server-4.x.x.jar

Step 2: Start Selenium Grid

Open a terminal in the directory containing the downloaded JAR and

Wednesday, 1 February 2017

Selenium Automation Framework Development from Scratch Using Java

 

Introduction

Selenium WebDriver is widely used for automating web application testing. However, writing individual test scripts is not enough when an organisation needs to automate hundreds of test cases across multiple application modules.

A professional automation project requires a structured framework that makes test scripts reusable, maintainable, scalable and easy to execute.

This is where Selenium Automation Framework Development becomes important.

A Selenium automation framework is a structured collection of reusable components, coding standards, libraries, test data, configuration files and execution mechanisms designed to support automated software testing.

Using Java, Selenium WebDriver, Maven and TestNG, testers can develop a framework that supports functional testing, regression testing, data-driven testing, reporting and parallel execution.

This article explains how to build a practical Selenium automation framework from scratch.

1. What Is a Selenium Automation Framework?

A Selenium automation framework provides a standard structure for designing, developing, executing and maintaining automated test cases.

Instead of writing browser setup, login steps, test data and reporting logic repeatedly in every test script, the framework separates these responsibilities into reusable components.

For example, a typical e-commerce automation project may include:

  • Login and logout testing.

  • Product search.

  • Product selection.

  • Shopping cart validation.

  • Checkout testing.

  • Payment workflow validation.

  • Order confirmation.

Without a framework, each test may contain repeated browser setup and application interaction code.

With a framework, common functionality can be reused across multiple test cases.

2. Types of Selenium Automation Frameworks

Several framework approaches are used in Selenium automation projects.

A. Data-Driven Framework

In a data-driven framework, test data is maintained separately from test scripts.

Data may be stored in:

  • Excel spreadsheets.

  • CSV files.

  • JSON files.

  • Database tables.

  • Test framework data providers.

The same test can execute multiple times using different input values.

B. Keyword-Driven Framework

A keyword-driven framework uses predefined keywords to represent testing actions.

Examples include:

  • LOGIN

  • CLICK

  • ENTER_TEXT

  • SELECT_DROPDOWN

  • VERIFY_TEXT

  • LOGOUT

A keyword engine interprets these instructions and performs the corresponding actions.

C. Hybrid Framework

A hybrid framework combines multiple approaches, such as:

  • Page Object Model.

  • Data-driven testing.

  • Reusable utility methods.

  • Keyword-based operations.

  • TestNG execution.

  • Reporting and logging.

Hybrid frameworks are commonly used in enterprise automation projects because they support flexible test design.

D. Behaviour-Driven Development Framework

BDD frameworks use business-readable scenarios to describe expected application behaviour.

Cucumber is a popular option for implementing BDD with Selenium and Java.

3. Technologies Required to Build a Selenium Framework

The following technologies can be used to develop a Java-based Selenium automation framework.

TechnologyPurpose
JavaProgramming language
Selenium WebDriverBrowser automation
MavenDependency and build management
TestNGTest execution and assertions
Page Object ModelPage-level code organisation
Apache POIExcel test data management
Log4j or SLF4J with an implementationLogging
ExtentReports or another reporting solutionTest reporting
Git and GitHubSource code management
JenkinsCI/CD integration
Selenium GridDistributed and parallel execution

The exact tools can vary depending on project requirements.

4. Create a Selenium Maven Project

Start by creating a Maven project in Eclipse or IntelliJ IDEA.

Use the following project details:

  • Group ID: com.palium.framework

  • Artifact ID: selenium-automation-framework

  • Packaging: jar

A recommended project structure is:

selenium-automation-framework
│
├── pom.xml
│
├── src
│   ├── main
│   │   └── java
│   │       ├── base
│   │       ├── pages
│   │       └── utilities
│   │
│   └── test
│       ├── java
│       │   ├── tests
│       │   └── listeners
│       │
│       └── resources
│           ├── config.properties
│           ├── testdata
│           └── testng.xml
│
└── test-output

Explanation of the folders

  • base: Browser setup and common test initialisation.

  • pages: Page Object Model classes.

  • utilities: Reusable helper methods.

  • tests: Actual automation test classes.

  • listeners: Test execution listeners and reporting integrations.

  • resources: Configuration files, test data and suite definitions.

This separation makes the

Tuesday, 10 January 2017

Top 10 Skills in Demand in 2017

This is a very trying time for IT Companies and as well as for the workforce. A large number of workforce is gradually growing old and finding that their skills are no longer relevant.
Seeing the writing on the wall, some people have quickly moved onto emerging skills that are short of manpower and hence there is growing demand in those skills.
A word of caution is warranted. One needs to understand that these are not based on any methodology and do not have solid numbers to back them up. That is the reason, you will find multiple such lists floating around in the internet. One needs to read them carefully and understand their implications and take an informed decision based on one's own situation and career ambitions.
Below is a reproduction based on 'Economic Times' article. There is another list published by Linkedin which can be found on this site as well.

Skills that will help you stay relevant in the job market
It’s a fact that no one is indispensable. Enterprises and individuals will always find a way to survive and thrive if your services are no longer available. Here's a list of top 10 skills that can help you stay relevant in job market.

1. User Interface (UI) design
JOBS AVAILABLE: User experience designer, user interface designer, user interface designer (computer software applications), creative director
MEDIAN ANNUAL SALARY RANGE: Rs 5-10 Lakh

2. Mobile development
JOBS AVAILABLE: Android and iOS developers, technical architect, lead software engineer, project manager (IT).
MEDIAN ANNUAL SALARY RANGE Rs 4.5-9 Lakh

3. Web architecture & development framework
JOBS AVAILABLE: Web developer, software engineer, programmer, project manager.
MEDIAN ANNUAL SALARY RANGE Rs 3-10 Lakh

4. Automation Testing using tools like Selenium, Appium, JMeter etc.

Testing is a critical function in any application development methodology. Companies are cutting down on costs and one way is to reduce headcount and work using open source tools. But Testing is an area where companies cannot afford to cut back costs. Hence they are adopting Open Source Automation tools like Selenium which have become very popular and are considered hot skills in the market.
JOBS AVAILABLE: Tester, Senior Testing, Testing Architect
MEDIAN ANNUAL SALARY RANGE Rs 4-8 Lakh

5. Cloud Computing
JOBS AVAILABLE: IT architect, cloud software engineer, software architect, technical consultant.
MEDIAN ANNUAL SALARY RANGE Rs 5-20 Lakh.
 

6. Storage systems and management
JOBS AVAILABLE: IT consultant, principal software engineer, test engineer, system engineer, system administrator.
MEDIAN ANNUAL SALARY RANGE Rs 4.5-10 Lakh.

7. Network and information security
JOBS AVAILABLE BASED: Network security engineer, network security analyst, information security analyst, information security officer
MEDIAN ANNUAL SALARY RANGE Rs 4-10 Lakh.

8. Algorithm design /coding
JOBS AVAILABLE: Software development engineer, lead software engineer, software developer.
MEDIAN ANNUAL SALARY RANGE Rs 6-10 Lakh.

9. Statistical analysis & data mining
JOBS AVAILABLE: Data scientist, senior business analyst, data analyst, statistician data scientist.
MEDIAN ANNUAL SALARY RANGE Rs 3-7 Lakh.

10. Digital, SEO/SEM marketing
JOBS AVAILABLE: Digital marketing manager, online marketing manager, SEO marketing strategist, SEO manager, SEO analyst
MEDIAN ANNUAL SALARY RANGE Rs 3-6 Lakh.

How Does Payroll Work in India? A Step-by-Step Guide

  How Does Payroll Work in India? Step-by-Step Guide   Summary: Understand how payroll works in India, including salary structure, attendan...