Lab Report 3
Lab Report 3
LAB REPORT NO - 03
Course Title: Software Quality Assurance
Course Code: CSE 454 Section: 201 D3
Student Details
Name ID
[For Teachers use only: Don’t Write Anything inside this box]
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 :
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.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.