Software Testing and Automation-Lab Manual
Software Testing and Automation-Lab Manual
Ex.no : 01
Date : Develop the test plan for testing an e-commerce web/mobile application
(www.amazon.in).
Aim :
To Develop the test plan for testing an e-commerce web/mobile application
(www.amazon.in).
Test plan :
Scope
The scope of this test plan includes testing the core functionalities of the e-commerce application,
such as browsing products, adding items to the cart, placing orders, and managing user accounts. It
also covers testing across different platforms, including web and mobile.
Test Objectives
1) Validate the functionality of the e-commerce application.
2) Verify that the application is user-friendly and provides a smooth shopping experience.
3) Ensure that the application is secure and protects user data.
4) Test the application's compatibility across different browsers and devices.
5) Evaluate the performance and scalability of the application under various load conditions.
6) Identify and report any defects or issues found during testing.
Test Environment
1) Web browsers: Chrome, Firefox, Safari, and Edge.
2) Mobile devices: iOS and Android.
3) Test management tool: Jira or any other preferred tool.
4) Test automation tool: Selenium WebDriver or any other preferred tool.
5) Load testing tool: JMeter or any other preferred tool.
Test Approach
1) Requirements Analysis:
• Review the functional and non-functional requirements of the e-commerce application.
• Identify testable features and prioritize them based on criticality.
2) Test Design:
• Create test scenarios and test cases for each identified feature.
• Include positive and negative test cases to cover different scenarios.
• Define test data and test environment setup requirements.
3) Test Execution:
• Execute test cases manually or using test automation tools.
• Log defects in the test management tool and track their status.
• Perform regression testing after each bug fix or application update.
4) Performance Testing:
• Design and execute performance tests to evaluate the application's response time, throughput,
and scalability.
• Simulate different user loads and monitor system resources during testing.
• Identify performance bottlenecks and suggest improvements if needed.
5) Security Testing:
• Conduct security testing to identify vulnerabilities and ensure the application protects user
data.
• Test for common security issues like SQL injection, cross-site scripting (XSS), and
authentication vulnerabilities.
• Implement security best practices and follow industry standards.
6) Compatibility Testing:
• Test the application on different browsers, versions, and mobile devices.
• Verify that the application renders correctly and functions as expected across various
platforms.
Test Deliverables
1) Test plan document.
2) Test scenarios and test cases.
3) Test execution reports.
4) Defect reports with severity and priority.
5) Performance test reports. 6) Security test reports.
Result :
Ex.no : 02
Date : Design the test cases for testing the e-commerce application
Aim :
To Design the test cases for testing the e-commerce application
Ecommerce websites function like any other web/mobile website. Hence it undergoes various types
of testing, such as:
• Functional Testing: If the tester wants to check if the checkout feature is working on the
website and scoped only to that feature, it is called functional testing.
• Usability Testing: When a customer wants to buy an item, searching, adding to the cart, and
making payment should be simple and easy. This is where usability testing kicks in.
• Performance Testing: When a single user is trying to access an ecommerce website, then it
should be extremely responsive.
• Mobile Application Testing: As there is a lot of penetration into the mobile space, many users
access the e-commerce websites on mobiles, So the website must have a good user
experience across different mobile.
• Test what parameters the search is based on – for example, product name, brand name,
category, etc.
• Test if the search results are relevant
• Number of results to be displayed per page
• Test whether the search API is being called at every keystroke. (This isn’t recommended, as it
would unnecessarily cause multiple API calls to the database) Filter Results
• Test if the user can filter based on all the parameters on the page
• The user should be able to see results with default search criteria when at least one of the
filter parameters isn’t mandatory
Downloaded by Mohamed Natheem L ([email protected])
lOMoAR cPSD| 49924226
• Test that all the product details are displayed correctly and that no empty/invalid details are
displayed.
• Product Images should be optimized for size and dimensions, which further helps in
performance testing.
• All the links(size, Pincode check, etc) about the product should be functional.
Shopping Cart
Checkout Page
Payments
Result :
Ex.no : 03
Date : Test the e-commerce application and report the defects in it.
Aim :
To test the e-commerce application and report the defects in it.
E-commerce applications/sites include web applications and mobile applications too. So, they
undergo all the typical test types.
• Functional Testing
• Usability Testing
• Security Testing
• Performance Testing
• Database Testing
• Mobile Application Testing A/B testing.
E-Commerce Testing Checklist
We have listed important segments and test cases for eCommerce website testing below.
• Home Page: Test that the correct text and images show up, whether static or dynamic. Links
to important pages (catalog, account login, cart) should also be visible and functional.
• Search and Navigation: Users should be able to search for relevant terms and be directed to
the exact page they are looking for. They should also be able to navigate to important
sections (product categories, cart, account info, etc.) with a couple of clicks. Test to check for
any bugs that may prevent a frictionless experience in this regard. Let’s take the example of
the Amazon India website.
• Catalog of products and services: All products and services should be listed clearly, with
adequate descriptions and explanatory images. Images should be easy to magnify, and the
Add To Cart option should be upfront and seamlessly responsive.
• Order processing mechanism: Once orders are placed, products and their details must
match what the user selected. They should be able to choose a preferred shipping method,
and their addresses should be correctly mapped to the order. Additionally, return and
exchange policies should be accessible for reading before placing an order.
1. Often, eCommerce websites use content management systems like Shopify, Woocommerce
to build the site in the shortest possible time.
2. However, these platforms offer integration with third-party services for various purposes –
gift cards, social media features, online payment management, etc.
Result
Ex.no : 04 Develop the test plan and design the test cases for an inventory control
Date : system.
Aim :
To Develop the test plan and design the test cases for an inventory control system.
Result
Ex.no : 05 Execute the test cases against a client server or desktop application and
Date : identify the defects.
Aim :
To Execute the test cases against a client server or desktop application and identify the
defects.
Functional Testing
• Unit Testing: Evaluate individual client and server components to verify that they perform
their specific functions correctly.
• Integration Testing: Assess how well client and server components integrate and work
together, ensuring that data is exchanged accurately.
• System Testing: Conduct end-to-end testing to validate that the entire client-server system
functions as expected in real-world scenarios.
Performance Testing
• Load Testing: Measure the system’s response and behavior under varying levels of user load
to identify performance bottlenecks.
• Stress Testing: Push the system beyond its intended capacity to determine breaking points
and assess its ability to recover.
• Scalability Testing: Evaluate how well the system scales to accommodate growing numbers
of clients or data transactions while maintaining performance.
Security Testing
• Authentication Testing: Verify that the authentication mechanisms (e.g., username/password,
tokens) work correctly and securely.
• Authorization Testing: Ensure that users can only access resources and functionalities they
are permitted to, and unauthorized access is prevented.
• Encryption Testing: Confirm that data transmission between the client and server is properly
encrypted to protect sensitive information.
Manual testing is a fundamental testing approach where human testers execute test cases without
Downloaded by Mohamed Natheem L ([email protected])
lOMoAR cPSD| 49924226
White-Box Testing
White-box testing is an approach where testers have access to the internal code and structure
of the application. They design tests to evaluate the correctness of the code, its logic, and the
execution paths within the application.
Testsigma
Testsigma, as an intelligent test automation platform for web and mobile applications, offers
significant advantages for automating client-server testing. With its no-code, scriptless automation
approach, Testsigma simplifies the test automation process, making it accessible to both technical
and non-technical team members.
Selenium
Selenium is a popular open-source automation testing tool primarily used for web applications. It
enables testers to automate interactions with web-based client applications, making it invaluable for
client-side testing.
JMeter
Apache JMeter is a versatile open-source tool designed for load testing, stress testing, and
performance testing of web applications and servers. JMeter helps assess how the server component
of a client-server application performs under various loads and concurrent user connections.
Wireshark
Wireshark is a widely used open-source network protocol analyzer that aids in network monitoring
and troubleshooting. For client-server testing, Wireshark is instrumental in capturing and analyzing
network traffic between the client and server components.
SoapUI
SoapUI is an open-source tool designed specifically for testing web services, making it suitable for
client-server applications that rely on RESTful APIs or SOAP-based services. With SoapUI, testers
can create and execute functional and load tests for the server-side components of client-server
applications.
• Use a checklist: A checklist can help you to make sure that you execute all of the test cases
and that you don't miss any important steps.
• Take your time: Don't rush through the test cases. Take your time to carefully follow the
instructions and to identify any defects.
• Be thorough: Don't just test the happy path. Test all of the different scenarios, including error
conditions and edge cases.
• Use a bug tracking system: A bug tracking system can help you to keep track of the defects
you find and to communicate with the developers.
Result
Ex.no : 06
Date : Test the performance of the e-commerce application
Aim :
To Test the performance of the e-commerce application.
• Reduce Risks: Many times, making major and considerable changes to a site can cause
notable strategic changes or even trigger significant losses.
• Increase Conversion Rates: By testing every aspect of an application and ensuring a smooth
visitor experience through site optimization, the application conversion rate is bound to
• Coupon codes or gift vouchers are provided to increase product sales and performance tests
ensure that coupon codes work well when applied to users in bulk.
• Multiple systems like email servers, social network sites, and enterprise content management
systems are involved in the backend and the performance test ensures flawless functioning of
Common Performance Testing Issues
• Slow DB server: Database size increases with the increase in product items of all ages, so
ensure to optimize DB queries.
Main Features to be Tested in eCommerce Applications
• Searching For a Product: eCommerce sites provide various search filters to make the search
experience faster, which include price range, product type, country, and age. Hence, ensure
that searching for a product among billions of records does not halt the system and return the
expected records.
• Virtual Reality: Modern eCommerce sites provide advanced-level features to visualize
products. Online shoppers can now see how they would look wearing an item virtually.
Hence, we need to ensure the smooth movement of virtual images for a better experience.
• Testing Payment Gateway Integration: Failed transactions are one of the main reasons why
most customers exit an application without completing the purchase. So it's important to
ensure the proper functioning of payment gateways.
• Product Details Page: A fast product listing is important because every consumer will be
attracted to the product by how it's presented and how it's visible to them.
Result
Ex.no : 07
Date : Automate the testing of e-commerce applications using Selenium.
Aim :
To automate the testing of e-commerce applications using Selenium.
Procedures :
Positive scenario :
Automate the 'User Registration and Login' of Amazon like an e-commerce website
Steps to Automate:
i. Open this URL http://automationpractice.com/index.php
ii. Click on the sign-in link.
iii. Enter your email address in the 'Create and Account' section. iv. Click on Create an
Account button.
v. Enter your Personal Information, Address, and Contact info.
vi. Click on the Register button.
vii. Validate that the user is created.
This code is contributed by Uday. We have provided the code for only positive scenarios, you
should try automating negative scenarios yourself.
Code :
Negative Scenarios
Steps to Automate:
Steps to Automate:
4. Test Case - Verify error messages for entering incorrect values in fields.
Steps to Automate:
5. Automate the 'Search Product' feature of Amazon like e-commerce website with
Selenium
(1).Test Case - Automate the 'Search Product' feature of the e-commerce website with Selenium.
Steps to Automate:
driver.get(URL);
driver.manage().window().maximize();
// Initialise Actions class object Actions actions=new Actions(driver);
driver.manage().timeouts().implicitlyWait(2000, TimeUnit.MILLISECONDS);
WebElement womenTab=driver.findElement(By.linkText("WOMEN"));
WebElement
TshirtTab=driver.findElement(By.xpath("//div[@id='block_top_menu']/ul/li[1]/ul/li[1]/ul//a[
@title='T-shirts']"));
actions.moveToElement(womenTab).moveToElement(TshirtTab).click().perform();
Thread.sleep(2000);
// Get Product Name
String
ProductName=driver.findElement(By.xpath("/html[1]/body[1]/div[1]/div[2]/div[1]/div[3]/div
[2]/ul[1]/li[1]/div[1]/div[2]/h5[1]/a[1]")).getText();
System.out.println(ProductName);
driver.findElement(By.id("search_query_top")).sendKeys(ProductName);
driver.findElement(By.name("submit_search")).click();
// Get Name of Searched Product
String
SearchResultProductname=driver.findElement(By.xpath("/html[1]/body[1]/div[1]/div[2]/div[
1]/div[3]/div[2]/ul[1]/li[1]/div[1]/div[2]/h5[1]/a[1]")).getText();
// Verify that correct Product is displaying after search
if(ProductName.equalsIgnoreCase(SearchResultProductname)) {
System.out.println("Results Matched;Test Case Passed");
}else{
System.out.println("Results NotMatched;Test Case Failed");
}
// Close the browser
driver.close();
}
}
6. Automate the 'Buy Product' feature of Amazon like an e-commerce website with Selenium The
most important function of an e-commerce website is buying a product, which includes various
steps like selecting a product, selecting size/color, adding to the cart, checkout, etc. You will find
every test scenario along with the automation code in the following section.
(1)Test Case - Automate the end-to-end "Buy Product" feature of the e-commerce website.
Steps to Automate:
}
}}
(2)Test Case - Verify that 'Add to Wishlist' only works after login.
Steps to Automate:
(3)Test Case - Verify that Total Price is reflecting correctly if the user changes quantity on the
'Shopping Cart Summary' Page.
Steps to Automate:
Result :
Ex.no : 08
Date : Integrate TestNG with the above test automation.
Aim :
To Integrate TestNG with the above test automation.
Procedures :
TestNG Framework?
TestNG is an open-source test automation framework for Java. It is developed on the same
lines as JUnit and NUnit. A few advanced and useful features provided by TestNG make it a
more robust framework than its peers. The NG in TestNG stands for ‘Next Generation.’
3. Click on ‘Eclipse Marketplace’. You will be directed to the marketplace modal. Type TestNG in
the search keyword and hit ‘Go’. The referenced snapshot is below:
4. If TestNG is not installed in your Eclipse, rather than the ‘Installed’ button you would see
‘install’. Click on install and your TestNG framework will be installed in your Eclipse. As a
good practice, Eclipse would recommend you to restart to use the features of the installed
plugin
5. Post-restarting your Eclipse, re-verify whether you can see options for creating a TestNG class
or not as below:
Step #1 – Create your first TestNG class by right-clicking on the package and selecting the’ Other’
folder from the ‘New’ option.
Step #2 – From the wizard modal, select the TestNG folder and select the TestNG class as below:
Step #3 – Click the ‘New’ button and choose any predefined annotations you wish to have in your
class as below:
Step #4 – Click on finish, and you are ready to start writing your first TestNG class. Reference
screenshot below, containing the defined methods with the annotations chosen in the step above:
Step #5 – We will automate the sign-up flow using these annotations in the code snippet below.
{
System.setProperty("webdriver.chrome.driver", ".\\Driver\\chromedriver.exe"); driver=new
ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
@BeforeMethod public
void openBrowser()
{
driver.get("https://www.browserstack.com/");
driver.findElement(By.id("signupModalButton")).click();
{
driver.quit();
}
}
Step #6 – To execute your report, you can either choose to run directly as a TestNG class or run the
XML file created which contains the class name and details. Below is the auto-created TestNG
XML file:
Step #7 – To access the TestNG report, you only need to refresh your project folder. A folder as
‘test output’ will be auto-generated. Within this folder, you shall see a file ‘index.html’ as below:
Step #8 – Double click on it and you can view your TestNG reports, showing the passed and failed
methods of the execution as below.
Step #9 – As a QA or tester, the next step is to validate your tests. If you did not validate your test
methods, it basically means your testing process is incomplete.
Result :
Ex.no : 09
Date : Build a data-driven framework using Selenium and TestNG
Aim :
To Build a data-driven framework using Selenium and TestNG.
Procedures :
Data Driven framework is used to drive test cases and suites from an external data feed. The
data feed can be data sheets like xls, xlsx, and csv files.
• To download Apache POI Jar files click here. Download the zip file or tar file as per
requirement and place them along with the set of Selenium JARs and configure your build
path.
• Now let’s understand how to write the first test case. An excel file to read the data from the
sheet. The user has entered different combinations of username and password in the sheet.
• Here, the target is to enter all these combinations of username and password into the Browser
stack Sign in page as shown below.
driver.findElement(By.name("user[password]")).sendKeys(password);
driver.findElement(By.name("commit")).click();
Thread.sleep(5000);
Assert.assertTrue(driver.getTitle().matches("BrowserStack Login | Sign Into The Best Mobile &
Browser Testing Tool"), "Invalid credentials");
System.out.println("Login successful");
}
@AfterMethod
void ProgramTermination() { driver.quit();
}
@DataProvider(name="testdata")
public Object[][] testDataExample(){
ReadExcelFile configuration = new ReadExcelFile("Path_of_Your_Excel_File"); int
rows = configuration.getRowCount(0);
for(int i=0;i<rows;i++)
{
signin_credentials[i][0] = config.getData(0, i, 0);
signin_credentials[i][1] = config.getData(0, i, 1);
}
return signin_credentials;
}
}
In the above code, there is a “TestDataExample() method” in which the user has created an
object instance of another class named “ReadExcelFile”. The user has mentioned the path
to the excel file. The user has further defined a for loop to retrieve the text from the excel
workbook. But to fetch the data from the excel file, one needs to write a class file for the
same.
Code :
In the code above, the user has used Apache POI libraries to fetch the data from the excel file.
Next, it will point to the data present in the excel file and then enter the relevant username
and password to the sign in page.
Result :