0% found this document useful (0 votes)
25 views

Software Testing Exp 1,2

The document describes a test plan and test case for testing an e-commerce application. The test plan outlines test objectives, scope, and test cases that cover functionality like user registration, product search, adding items to cart, checkout/payment, and account management. A sample test case is designed to test user registration by prompting for username, password, and email, and checking if registration succeeds or fails.

Uploaded by

NambiRaja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Software Testing Exp 1,2

The document describes a test plan and test case for testing an e-commerce application. The test plan outlines test objectives, scope, and test cases that cover functionality like user registration, product search, adding items to cart, checkout/payment, and account management. A sample test case is designed to test user registration by prompting for username, password, and email, and checking if registration succeeds or fails.

Uploaded by

NambiRaja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.Develop the test plan for testing an e-commerce website/mobile application (www.amazon.

in)

Program:-

public class ECommerceTestPlan {

public static void main(String[] args) {

printTestPlan();

public static void printTestPlan() {

// Test Objectives

String[] testObjectives = {

"Verify user registration functionality",

"Test product search functionality",

"Test adding/removing items to/from the cart",

"Verify checkout and payment process",

"Test user account management"

};

// Test Scope

String testScope = "This test plan covers functional testing of the www.amazon.in e-commerce
application.";

// Test Cases

String[] testCases = {

"TC001: Verify user can register with valid information",


"TC002: Verify user cannot register with invalid information",

"TC003: Verify user can search for products and view details",

"TC004: Verify user can add items to the cart and remove them",

"TC005: Verify the checkout and payment process",

"TC006: Verify user can update their account information"

};

// Print the test plan

System.out.println("E-Commerce Test Plan");

System.out.println("-------------------");

System.out.println("Test Objectives:");

for (String objective : testObjectives) {

System.out.println("- " + objective);

System.out.println("Test Scope: " + testScope);

System.out.println("Test Cases:");

for (String testCase : testCases) {

System.out.println("- " + testCase);

OUTPUT:-

E-Commerce Test Plan

-------------------Test Objectives:
- Verify user registration functionality

- Test product search functionality

- Test adding/removing items to/from the cart

- Verify checkout and payment process

- Test user account management

Test Scope: This test plan covers functional testing of the www.amazon.in e-commerce application.

Test Cases:

- TC001: Verify user can register with valid information

- TC002: Verify user cannot register with invalid information

- TC003: Verify user can search for products and view details

- TC004: Verify user can add items to the cart and remove them

- TC005: Verify the checkout and payment process

- TC006: Verify user can update their account information

2.Design the test case for testing the e-commerce application

Program:-

import java.util.Scanner;

public class UserRegistrationTestCase {

public static void main(String[] args) {

// Initialize a Scanner for user input

Scanner scanner = new Scanner(System.in);


// Prompt the user for input

System.out.println("User Registration Test Case");

System.out.print("Enter username: ");

String username = scanner.nextLine();

System.out.print("Enter password: ");

String password = scanner.nextLine();

System.out.print("Enter email: ");

String email = scanner.nextLine();

// Close the scanner

scanner.close();

// Check if any of the input fields are empty

if (username.isEmpty() || password.isEmpty() || email.isEmpty()) {

System.out.println("Test Case: User Registration - Failed (One or more fields are empty)");

} else {

// Execute the test case

boolean registrationResult = registerUser(username, password, email);

// Check the test result

if (registrationResult) {

System.out.println("Test Case: User Registration - Passed");


} else {

System.out.println("Test Case: User Registration - Failed");

public static boolean registerUser(String username, String password, String email) {

// Simulate the user registration process

// In a real application, this would interact with the e-commerce system

// and return true if registration is successful, or false otherwise.

// For this simple example, let's assume registration is always successful.

return true;

OUTPUT:-

User Registration Test Case

Enter username: Mark antony

Enter password: Anaconda

Enter email: [email protected]

Test Case: User Registration - Passed

You might also like