You are on page 1of 4

Green University of Bangladesh

Department of Computer Science and Engineering(CSE)


Faculty of Sciences and Engineering
Semester: (Fall, Year:2023), B.Sc. in CSE (Day)

LAB REPORT NO - 03
Course Title: Software Quality Assurance
Course Code: CSE 454 Section: 201 D3

Lab Experiment Name: Automation Testing of a Web Application.

Student Details

Name ID

1. Md. Mahamudur Rahman 201902117

Lab Date :27.10.2023


Submission Date :02.11.2023
Course Teacher’s Name : Md. Mozdaher Abdul Quader

[For Teachers use only: Don’t Write Anything inside this box]

Lab Report Status


Marks: ………………………………… Signature:.....................
Comments:.............................................. Date:..............................
1.Title of the Lab Experiment
Automa�on Tes�ng of a Web Applica�on.

2.Objec�ves/Aim
• To increase tes�ng efficiency, automa�on is employed to execute
repe��ve test cases.
• To achieve comprehensive test coverage, automa�on is used to run a
wide range of test scenarios.
• To ensure consistency in tes�ng, automa�on eliminates human errors in
test case execu�on.
• To provide rapid feedback, automa�on enables quick detec�on of
so�ware defects.
• To perform effec�ve regression tes�ng, automa�on is used to verify the
stability of the so�ware with code changes.

3.Procedure/Analysis/Design
Automa�on Tes�ng Procedure:
• Select a web applica�on for tes�ng (e.g.,
htps://www.salmanhafeez.com).
• Iden�fy test cases to automate (e.g., login, search, checkout).
• Choose a tes�ng framework (e.g., TestNG) and a programming language
(e.g., Java).
• Develop test scripts for the iden�fied test cases.
• Execute the test scripts using Selenium WebDriver.
• Analyse the test results and generate reports.
4. Implementa�on :

4.1 Here is the usability tes�ng of Messenger App:


The purpose of this lab report let's consider automa�ng the login func�onality
of a sample commerce website using Selenium WebDriver with Java.
Test Case ID: TC_AUT_01
Test Scenario: Automated Login
Test Case Pre-Condi�on: Web applica�on is accessible.
Test Steps:
• Launch the web browser (e.g., Chrome).
• Navigate to the e-commerce website.
• Click on the "Login" link.
• Enter valid creden�als (username and password).
• Click the "Login" buton.
• Verify if the user is successfully logged in.
Expected Result: The user should be successfully logged in, and the website
should display the user's account page.

Test Automa�on Code (Java with Selenium WebDriver):

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

public class AutomatedLoginTest {


public sta�c void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "path/to/chromedriver.exe");
WebDriver driver = new ChromeDriver();

driver.get("htps://www.example-ecommerce-website.com");
driver.findElement(By.linkText("Login")).click();
driver.findElement(By.id("username")).sendKeys("your_username");
driver.findElement(By.id("password")).sendKeys("your_password");
driver.findElement(By.id("login-buton")).click();

if (driver.getCurrentUrl().equals("htps://www.example-ecommerce-
website.com/user/account")) {
System.out.println("Test Passed: User successfully logged in.");
} else {
System.out.println("Test Failed: Login unsuccessful.");
}

driver.quit();
}
}

5. Test Result/Output
The automated login test was executed, and the output in the console indicates
whether the test passed or failed.
Test Passed: User successfully logged in.

6. Analysis and Discussion


Automa�on tes�ng offers several advantages, including repeatability, speed,
and reliability. In this lab experiment, we automated the login func�onality of a
sample e-commerce website. This automa�on test can be integrated into a
con�nuous integra�on pipeline to ensure that login func�onality remains
opera�onal with each new so�ware release. Automa�on tes�ng is par�cularly
valuable for

You might also like