Web Application Test Automation - Project 1
Web Application Test Automation - Project 1
TestNG
Objective:
Build an end-to-end automation framework for testing a sample web application using Java,
Selenium WebDriver, and TestNG.
Project Deliverables:
1. Project Source Code
2. Documentation:
○ Requirement Specification
○ Test Plan
○ Test Cases Document
○ Setup Guide
○ Automation Report Samples
Project Outline:
1. Project Setup
● Tools/Technologies:
○ Java (Programming Language)
○ Selenium WebDriver (Automation Tool)
○ TestNG (Testing Framework)
○ Maven (Build Tool)
○ Apache POI (For Excel Integration if needed)
○ ExtentReports (For Custom Reports)
● Environment Setup:
○ Install Java Development Kit (JDK).
○ Install IntelliJ IDEA/Eclipse as the IDE.
○ Add required dependencies (Selenium, TestNG, etc.) to the pom.xml file for
Maven.
● OrangeHRM Demo
● The Internet
3. Project Workflow
Documents:
1. Requirement Specification
○ Define the application functionality to test and test scenarios.
2. Test Plan
○ Scope, objectives, tools, environment, schedule, deliverables, and risks.
3. Test Case Document
○ Test case ID, description, preconditions, test steps, expected results, and
actual results.
4. Setup Guide
○ Step-by-step guide to set up the automation project in a local system.
5. Sample Test Reports
○ Include ExtentReports/Allure Report screenshots as examples.
import base.BaseTest;
import org.testng.Assert;
import org.testng.annotations.Test;
import pages.LoginPage;
@Test
public void testValidLogin() {
LoginPage loginPage = new LoginPage(driver);
loginPage.enterUsername("Admin");
loginPage.enterPassword("admin123");
loginPage.clickLoginButton();
Assert.assertTrue(loginPage.isDashboardDisplayed(),
"Dashboard is not displayed");
}
@Test
public void testInvalidLogin() {
LoginPage loginPage = new LoginPage(driver);
loginPage.enterUsername("wrongUser");
loginPage.enterPassword("wrongPass");
loginPage.clickLoginButton();
Assert.assertTrue(loginPage.isErrorMessageDisplayed(),
"Error message is not displayed");
}
}