Software Testing Project

Software Testing Project, Project Explanation, Writing Sanity Test cases, Writing Comprehensive Test cases, and Automate Tests with Selenium.

Software Testing Project Part -1 (Theory)

(Project Link for Practic)

Automate a Web Application using Selenium WebDriver, Java, TestNG, and Maven.

Test Level: System Testing, Acceptance Testing

Test Type: Functional & Regression Testing

Test Method: Automated Testing

Test Tool: Selenium

Note: We conduct Functional Automated Testing in System and Acceptance Testing levels using Selenium.

Software Testing Project Index

1. Project Information
2. Project Overview
3. Stakeholders of the Project
4. Interface of the Project/AUT
5. Features to be tested in Admin Interface
6. Features to be tested in User Interface
7. Test Requirements, Test Scenarios, Test Cases, and Test Data
8. Derive Sanity Test Scenarios for Admin Interface
9. Derive Sanity Test Scenarios for User Interface
10. Derive Comprehensive (All Possible) Test Cases for Admin Interface
11. Derive Comprehensive (All Possible) Test Cases for User Interface


Test Execution Levels
Sanity Testing
Comprehensive Testing
Re Testing & Regression Testing Cycle 1
Defect Reporting & Tracking
.
Re Testing & Regression Testing Cycle 2
.
Re Testing & Regression Testing Cycle 3
.
Final Regression
Tc1-Pass
Tc2-Pass
Tc3-Pass – Executing this test case on the modified build is called Regression Testing
Tc4-Failed – Executing this test case on the modified build is called Re Testing
Tc5


1. Project Information

Domain: Ecommerce
(Software Project Business Area)

ERP
BFSI
Banking
Insurance
Telecom
Healthcare
Ecommerce
Retail Market
Travel
Others (Games etc…)

Sub Domain: B2C (Business to Customer)

Application: Online Shopping

Application Type: Public Web Application (Internet Application)

Development Technologies: LAMP (Linux, Apache, MySQL, PHP)

2. Project Overview

i. Admin Interface/Server-side (Application Master Data (Add/Edit/Delete), and Maintenance (User management,
Operations management etc…) of the application

ii. User Interface/Clint side: Perform specified Business operations
——————————

Two types of Online Shopping Applications
Type 1: Vendor develops their own online shopping portal to sell their product
Type 2: Some third party develops online shopping portal sell & buy products

Admin Interface:
Add / Edit/Delete Manufacturer/s
Add/Edit/delete Category/s
Add / Edit/Delete Product/s
Add / Edit/Delete/Set as Default Currency
Reports

User Interface
View Products, Product Search, Advanced Search
Customer Registration, Customer Login,
Shopping Cart (Add Product/s, Update Quantity, Remove Product….)
Checkout (Change Address, Add Comments, Payment Method, Edit Details, Order Confirmation…)

3. Stakeholders of the Project

An individual, group, or organization, who may affect, be affected by or perceive itself to be affected by a decision or activity, or outcome of a project

Project Leader
Senior Management
Project Team Members
Project Customer
Project Testers
Subcontractors, Consultants, etc…

4. Interfaces of the Project/AUT

Three Interfaces of Software Application,
i. Admin Interface
ii. User Interface
iii. Database Interface

i. Admin Interface:
https://gcreddy.com/project/admin/

Username: gcreddy
Password: Temp@2020

2. User Interface
https://gcreddy.com/project/

5. Features to be Tested in Admin Interface

i.Launch Application
ii. Login to Admin Interface of the Application
iii. Redirecting Operation from Admin to User Interface
iv. Add /Edit/Delete Manufacturer
v. Add /Edit/Delete Category
vi. Add /Edit/Delete Product
vii. Add /Edit/Delete/Set as Default Currency
viii. Reports (User, product etc…)

6. Features to be tested in user Interface

i. Launch Application
ii. View Product/s
iii. Search Products/s
iv. Advanced Search
v. Customer Registration
vi. Customer Login
vii. Buy Product/s (Login, Choose product/s, Update Quantity, Delete Product/s, Change Details, Select Payment Option, Checkout…)
viii. Track Order status…

Business Flow/s of the User Interface

i. Launch Application + View Products + Search Product/s….
ii. Launch Application + Registration + Login…
iii. Launch Application + Login + Buy product/s
iv. Launch Application + View Products + Buy Product/s + Login /Register…
v. Launch Application + Login + Buy product/s (Choose product/s, Choose Quantity, Change Details, Select Payment Option, Checkout…) Etc…

7. Test Requirements, Test scenarios, Test Cases, and Test Data…

Business Requirements (BRS…)
Software Requirements (SRS…)
Test Requirements…
Test Scenarios(Positive and Negative…)
Test Cases (Positive and Negative…)
* Collect Test Data…
Note: Test Data is not required for all Test cases…

Soft Requirements / Test Requirements
i. Functional Requirements
ii. Non Functional Requirements
Performance Requirements
Usability Requirements
Reliability Requirements etc…

Functional Requirement: Admin User Login to gcrShop Application’s Admin Interface…

Test Scenarios:

i. Admin Login with a valid username and valid password (Positive Test Scenario)
ii. Admin Login with invalid username and valid password (Negative Test Scenario)
iii. Admin Login with a valid username and invalid password (Negative Test Scenario)
iv. Admin Login with invalid username and invalid password (Negative Test Scenario)
v. Admin Login with a blank username and blank password (Negative Test Scenario)
etc…

Test Case:

1. Test Case ID: TC_Adm_001
2. Test Case Name/Description: Verify Admin Login to the Application (with valid test data)
3. Test Suite ID: TS_Adm_01
4. Priority: P0
5. Precondition: None
6. Steps to be Executed:
i. Launch Browser
ii. Enter valid URL
iii. Enter valid Username
iv. Enter valid Password
v. Click Default/Login Button

7. Test Data:
i. Username: admin
ii. Password:admin@123
Or
Ref: input.xlsx…
8. Post Condition: Get Index page of the Application
9. Software & Hardware: Hardware Configuration, Windows 10 OS etc…
10. Expected Result: Index Page of the Application
11.Actual Result:
12. Status/Test Result:
13. Comments…
……………………………………..
Performance Requirement: Admin Login to the Application with 1000 concurrent users in 5 seconds…

Usability Requirement: Verify Field Alignments and Font Sizes in Admin Login Page

Reliability Requirement: Redirecting from Admin Interface to User Interface, 20 times…

8. Derive Sanity Test Scenarios for Admin Interface

i. Launch Application
ii. Verify required elements availability in the Admin interface home page/login page
iii. Verify Admin Login with valid username and password
iv. Verify required elements availability on the Index page
v. Add Manufacturer
vi. Add Category
vii. Add Product
viii. Add Currency
Etc…

9). Derive Sanity Test Scenarios for User Interface

i. Verify the Launch of User Interface with valid url
ii. Verify required elements availability in the home page
iii. Verify Customer Registration with valid data
iv. Verify Customer Login
v. Verify Shopping Cart
vi. Verify Checkout
vii. Verify Log Off

10. Derive Comprehensive (All Possible) Test Cases for Admin Interface

i. Verify Launch Application with valid URL
ii. Verify all elements availability in the Admin interface home page/login page
iii. Verify “Redirect” functionality from Admin to User Interface before Login
iii. Verify Admin Login with valid username and Password
iv. Verify Admin Login with invalid Username and valid Password
v. Verify Admin Login with Valid Username and Invalid password
vi. Verify Admin Login with invalid Username and invalid password
vii. Verify Admin Login with Username Blank and Valid password
viii. Verify Admin Login with Valid Username and password blank
ix. Verify Admin Login with Username and Password Blank
x. Verify Admin Login Locking functionality
xi. Verify all elements available on the Index page
xii. Verify “Redirect” functionality from Admin to User Interface after Login
xiii. Add Manufacturer
xiv. Edit Manufacturer
xv. Delete Manufacturer
xvi. Add Category
xvii. Edit Category
xviii. Delete Category
xix. Add Product
xx. Edit Product
xxi. Delete Product
xxii. Move Product
xxiii. Add Currency
xxiv. Edit Currency
xxv. Delete Currency
xxvi. Set Default Currency
xxvii. Verify Customer Report
xxviii. Verify Product Report
xxix. Verify “Logoff”

11. Derive Comprehensive (All Possible) Test Cases for User Interface

i. Verify the Launch of User Interface with valid URL
ii. Verify all elements available on the home page
Verify Customer Registration with valid data
.
.
.
Verify Customer Login with valid Email Address and Password
.
.
.
Verify Shopping Cart
Verify “Shopping Cart” before selecting any product
Verify “Shopping Cart” after selecting a product
Verify “Shopping Cart” by adding multiple products
Verify “Shopping Cart” by Updating Product/s Quantity
Verify “Shopping Cart” by Removing Product/s
.
Verify Checkout before selecting any product
Verify Checkout after selecting a product and before Login
Verify Checkout after selecting a product and after Login
Verify “Chang Address” in “Checkout” Process
Verify “Add Comment
Verify “Payment Option”
Verify “Order Confirmation”
Verify “Logoff”

selenium project
Software Testing Live Project

Software Testing Project Part-2 (Practical)

Automating Manual Test Cases using Selenium

Selenium WebDriver – Test Tool

Eclipse IDE – Writing Programs for Java, Python, PHP, etc…/Writing Test Scripts

Java – Writing Programs / Writing Test Scripts

JUnit / TestNG Testing Framework – Unit Testing for Java/System Testing with Selenium

Maven – Build Automation Tool for Java Projects/Maintenance of Selenium Test Environment

Selenium Integration with Maven

Build Automation Tool for Java Projects/Maintenance of Selenium Test Environment

Advantages of Maven Integrating with Selenium

a. Selenium Test Environment Setup
(You can add all required Software dependencies like Selenium WebDriver, TestNG etc…to Maven Project (POM XML) then it will download and add those jar file/s to your project)

b. Maintenance of Selenium Test Environment
(If any new version of Software is there, add that new version dependency to POM (Maven) then it will update your software)

c. Maintain Common configuration for all Team Members
(Configure Selenium Test Environment in a computer and share the POM XML file to all team members of the project then your team will have a common configuration.

Navigation for creating “Maven Project” in Eclipse IDE:

Launch Eclipse IDE

File Menu
New
Project
Type Maven and Select Maven Project,
Enter
Next
Next
Enter Group Id
Enter Artifact Id
Finish
* Then It will create a New Maven project

Note: “Maven” is a built-in component of Eclipse IDE

Sanity Test Scenarios for User Interfaces of gcrShop Application

i) Verify Launch User Interface of the Application
ii) Verify Mandatory Elements availability in User interface home page
iii) Verify Customer Registration
iv) Verify Customer Login
v) Verify Shopping Cart
vi) Verify Checkout Process
vii) Verify Logoff

Selenium Sanity Test Cases for User Interface of the Application

public class User_Sanity {
WebDriver driver;

@BeforeMethod
public void launchBrowser() {
System.setProperty(“webdriver.chrome.driver”, “C:\\Users\\user\\Downloads\\chromedriver.exe”);
driver = new ChromeDriver();
driver.manage().window().maximize();
}

@AfterMethod
public void closeBrowser() {
driver.close();
}

@Test (priority=1)
public void verifyLaunchApp() throws InterruptedException {
driver.get(“https://gcreddy.com/project/”);
Thread.sleep(2000);

String pageTitle = driver.getTitle();
Assert.assertEquals(“GCR Shop”, pageTitle);
}

@Test (priority=2)
public void verifyElements() throws InterruptedException {
driver.get(“https://gcreddy.com/project/”);
Thread.sleep(2000);

boolean element1 = driver.findElement(By.linkText(“create an account”)).isDisplayed();
Assert.assertEquals(element1, true);

boolean element2 = driver.findElement(By.linkText(“login”)).isDisplayed();
Assert.assertEquals(element2, true);
}

@Test (priority=3)
public void verifyCustomerReg() throws InterruptedException {
driver.get(“https://gcreddy.com/project/create_account.php”);
driver.findElement(By.xpath(“//*[@id=\”bodyContent\”]/form/div/div[2]/table/tbody/tr[1]/td[2]/input[2]”)).click();
driver.findElement(By.name(“firstname”)).sendKeys(“abcd”);
driver.findElement(By.name(“lastname”)).sendKeys(“xyz”);
driver.findElement(By.id(“dob”)).sendKeys(“10/10/1990”);

driver.findElement(By.name(“email_address”)).sendKeys(“decseleniuma2020@gmail.com”);
driver.findElement(By.name(“street_address”)).sendKeys(“abcd sdf”);
driver.findElement(By.name(“postcode”)).sendKeys(“500072”);
driver.findElement(By.name(“city”)).sendKeys(“Hyderabad”);
driver.findElement(By.name(“state”)).sendKeys(“Telangana”);

Select dropDown = new Select (driver.findElement(By.name(“country”)));
dropDown.selectByVisibleText(“India”);

driver.findElement(By.name(“telephone”)).sendKeys(“9876765654”);

driver.findElement(By.name(“password”)).sendKeys(“abcd321”);
driver.findElement(By.name(“confirmation”)).sendKeys(“abcd321”);
driver.findElement(By.id(“tdb4”)).click();

driver.findElement(By.name(“password”)).sendKeys(“abcd321”);
driver.findElement(By.name(“confirmation”)).sendKeys(“abcd321”);
driver.findElement(By.id(“tdb4”)).click();
Thread.sleep(3000);

String message = driver.findElement(By.tagName(“h1”)).getText();
//System.out.println(message);

Assert.assertEquals(message, “Your Account Has Been Created!”);
}

@Test (priority=4)
public void verifyLogin() {
driver.get(“https://gcreddy.com/project/login.php”);
driver.findElement(By.name(“email_address”)).sendKeys(“decseleniuma2020@gmail.com”);
driver.findElement(By.name(“password”)).sendKeys(“abcd321”);
driver.findElement(By.id(“tdb1”)).click();

boolean elementExists = driver.findElement(By.linkText(“Log Off”)).isDisplayed();
Assert.assertEquals(elementExists, true);
}

@Test (priority=5)
public void verifyShoppingCart() {
driver.get(“https://gcreddy.com/project/index.php”);
driver.findElement(By.xpath(“//*[@id=\”columnRight\”]/div/div[1]/a”)).click();
String message = driver.findElement(By.xpath(“//*[@id=\”bodyContent\”]/div/div”)).getText();
//System.out.println(message);

Assert.assertTrue(message.contains(“Your Shopping Cart is empty!”));
}

@Test (priority=6)
public void verifyCheckout() throws InterruptedException {
driver.get(“https://gcreddy.com/project/index.php”);
driver.findElement(By.linkText(“login”)).click();
driver.findElement(By.name(“email_address”)).sendKeys(“decselenium2020@gmail.com”);
driver.findElement(By.name(“password”)).sendKeys(“abcd321”);
driver.findElement(By.id(“tdb1”)).click();

driver.findElement(By.xpath(“//*[@id=\”bodyContent\”]/div/div[2]/table/tbody/tr/td[3]/a[1]/img”)).click();
driver.findElement(By.id(“tdb5”)).click();
Thread.sleep(2000);
driver.findElement(By.id(“tdb6”)).click();
Thread.sleep(2000);
driver.findElement(By.id(“tdb6”)).click();
Thread.sleep(2000);
driver.findElement(By.id(“tdb6”)).click();
Thread.sleep(2000);
driver.findElement(By.id(“tdb5”)).click();
}

}


Software Testing Project Part-3 (Practical)

Test Scenarios for Admin Interface

(https://gcreddy.com/project/admin/login.php)

i. Verify “Launch Admin Interface” of the Application
ii. Verify Mandatory Elements availability in Admin interface home page
iii. Redirect Functionality (From Admin to User Interface)
iv. Verify Admin Login with valid data
v. Verify admin login with invalid data
vi. Verify Admin Login Locking Functionality
vii. Verify Admin LogOff functionality

Selenium WebDriver Test Cases:

@BeforeMethod
public void launchBrowser() {
System.setProperty(“webdriver.chrome.driver”, “C:\\Users\\user\\Downloads\\chromedriver.exe”);
driver = new ChromeDriver();
driver.manage().window().maximize();
}

@AfterMethod
public void closeBrowser() {
driver.close();
}

@Test (priority=1)
public void verifyLaunchApp() throws InterruptedException {
driver.get(“https://gcreddy.com/project/admin/”);
Thread.sleep(2000);
String pageTitle = driver.getTitle();
Assert.assertEquals(pageTitle, “osCommerce Online Merchant Administration Tool”);
}

@Test (priority=2)
public void verifyElements() throws InterruptedException {
driver.get(“https://gcreddy.com/project/admin/”);
Thread.sleep(2000);

boolean ele1 = driver.findElement(By.name(“username”)).isDisplayed();
Assert.assertEquals(ele1, true);

boolean ele2 = driver.findElement(By.name(“password”)).isDisplayed();
Assert.assertEquals(ele2, true);

boolean ele3 = driver.findElement(By.id(“tdb1”)).isDisplayed();
Assert.assertEquals(ele3, true);
}

@Test (priority=3)
public void verifyPageRedirection() throws InterruptedException {
driver.get(“https://gcreddy.com/project/admin/”);
Thread.sleep(2000);
driver.findElement(By.linkText(“Online Catalog”)).click();
Thread.sleep(2000);
String url = driver.getCurrentUrl();

Assert.assertEquals(url, “https://gcreddy.com/project/”);
}

@Test (priority=4)
public void verifyAdminLogin() throws InterruptedException {
driver.get(“https://gcreddy.com/project/admin/”);
driver.findElement(By.name(“username”)).sendKeys(“gcreddy”);
driver.findElement(By.name(“password”)).sendKeys(“Temp@2020”);
driver.findElement(By.id(“tdb1”)).click();
Thread.sleep(2000);
String url = driver.getCurrentUrl();

Assert.assertEquals(url, “https://gcreddy.com/project/admin/index.php”);
}

@Test (priority=5)
public void verifyLogoff() throws InterruptedException {
driver.get(“https://gcreddy.com/project/admin/”);
driver.findElement(By.name(“username”)).sendKeys(“gcreddy”);
driver.findElement(By.name(“password”)).sendKeys(“Temp@2020”);
driver.findElement(By.id(“tdb1”)).click();

Assert.assertEquals(driver.getCurrentUrl(), “https://gcreddy.com/project/admin/index.php”);
Thread.sleep(3000);
driver.findElement(By.linkText(“Logoff”)).click();
Thread.sleep(3000);
Assert.assertEquals(driver.getCurrentUrl(), “https://gcreddy.com/project/admin/login.php”);
}

@Test (priority=6)
public void verifyErrorMessage() {
driver.get(“https://gcreddy.com/project/admin/”);
driver.findElement(By.name(“username”)).sendKeys(“abcdef”);
driver.findElement(By.name(“password”)).sendKeys(“Temp@0000”);
driver.findElement(By.id(“tdb1”)).click();

String errorMessage = driver.findElement(By.className(“messageStackError”)).getText();

Assert.assertTrue(errorMessage.contains(“Error: Invalid administrator login attempt.”));
}

@Test (priority=7)
public void adminLoginLocking() throws IOException, InterruptedException {
FileReader file = new FileReader(“C:\\Users\\user\\Desktop\\input.txt”);
BufferedReader br = new BufferedReader (file);
int count =0;
int iteration=0;
String line;

while ((line=br.readLine()) !=null) {
count =count+1;

if (count>1) {
String inputData[] = line.split(“, “, 2);
iteration=iteration+1;

driver.get(“https://gcreddy.com/project/admin/”);
driver.findElement(By.name(“username”)).sendKeys(inputData[0]);
driver.findElement(By.name(“password”)).sendKeys(inputData[1]);
driver.findElement(By.id(“tdb1”)).click();

String errorMessage = driver.findElement(By.className(“messageStackError”)).getText();
Thread.sleep(3000);
if (iteration<=3) {
Assert.assertTrue(errorMessage.contains(“Error: Invalid administrator login attempt.”));
}
else if (iteration>3) {
Assert.assertTrue(errorMessage.contains(“Error: The maximum number of login attempts has been reached. Please try again in 5 minutes.”));
}
br.close();
file.close();
}
}
}

}

Follow me on social media: