STA Lab Manual Final - 2024
STA Lab Manual Final - 2024
NH- 47, Palakkad Main Road, Navakkarai Po, Coimbatore – 641 105.
DEPARTMENT OF
ARTIFICIAL INTELLIGENCE
AND DATA SCIENCE
RECORD NOTEBOOK
Name: ___________________________________________
Year/Semester: ___________________________________
Academic Year:___________________________________
(Approved by AICTE, New Delhi & Affiliated to Anna University, Chennai)
NH- 47, Palakkad Main Road, Navakkarai Po, Coimbatore – 641 105.
DEPARTMENT OF
CERTIFICATE
This is to certify that Mr./Ms._____________________________________
Reg. No._____________________________________________ of____ Semester
____Year B.Tech. (Artificial Intelligence and Data Science) has completed his/her
practical work in the_____________________________________________
laboratory during the academic year 2024-25.
Average:
Exp. No.: Date:
Lab Objectives:
The purpose of this test plan is to outline the testing approach for an e-commerce web/mobile
application, specifically www.amazon.in. The goal is to ensure that the application functions
as intended, meets user requirements, and provides a seamless shopping experience.
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
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
By following this test plan, you can ensure comprehensive testing of the e-commerce
web/mobile application (www.amazon.in). It covers functional, performance, security, and
compatibility testing, enabling you to deliver a high-quality and reliable application to end-
users.
Exp. No.: Date:
OBJECTIVE:
There are many features in an e-Commerce website – hero carousel/slider, search, filter,
product details, payments, checkout, etc. each having a pre-defined functionality. For
example, every search bar should show relevant results, i.e., searching for electronics should
show all categories like mobiles, TVs, cameras, etc.
Going ahead, we’ll pick a few significant features and list the test cases for eCommerce
website:
The user should be able to navigate to all the pages in the website
There should be a fallback page for any page load errors.
Verify that all the links and banners work properly
Search results should be displayed with the most relevant item being shown first
All data related to the product – title, price, images, and description are all visible
clearly
Maintain a session for each user and test verify the session times out after a while
Login/Registration test cases for Online Shopping Website
Test for valid username and password
Test “Forgot Password” and Reset Password functionality
Validate If user is registered or not, and if not, provide an option to create an account
Show Login screen by default for registered user
Test that all fields are mandatory
Seller Product Creation Test Cases
For sellers who want to create their catalog, they should be able to add their products,
and this flow should be tested.
Test that authenticated sellers can access authorized product creation panels under
authorized categories.
Test the maximum product creation limit to avoid adding more products to the
catalog.
Test that seller’s products are visible after some time
Test the product creation process is working fine for the seller
Test that there are no duplicate products
Search Bar Test Cases for Online Shopping Website
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
Example of a filter
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
Validation messages for invalid filter criteria
When at least one filter criteria are required, and the user selects none, proper error
messages are shown
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 f urther helps
in performance testing.
If there’s breadcrumb navigation, each link in the breadcrumb should be functional.
Below is an example of breadcrumb navigation.
All the links(size, Pincode check, etc) about the product should be functional.
Shopping Cart
OBJECTIVE:
We have listed important segments and test cases for eCommerce website testing below.
Homepages of retail sites are busy. They have a lot going on. But almost all of them have a
Hero Image:
When the user hovers over it, is it still going to scroll to the next one?
Does it render the same way in different browsers and different screen resolutions?
2. Search
Search algorithms are very important for the success of a retail site because we can’t always
place what the users want to see right in front of their eyes.
Search based on the Product name, brand name, or something more broadly, the
Different sorts of options have to be available- based on Brand, Price, and Reviews/ratings
etc.
Once a user finds a product either through search or by browsing or by clicking on it from the
Check:
Reviews
Delivery options
Shipping information
In-stock/Out of stock
Breadcrumb navigation for the categories (highlighted in red below). If navigation such as
4. Shopping Cart
This is the penultimate stage before the user commits to the purchase.
If the user adds the same item to the cart while continuing to shop, the item count in
The user can add more items to the cart and the total should reflect the same
Update the content added to the cart which should also reflect in the total
Proceed to checkout
Apply coupons
Don’t check out, close the site, and come back later. The site should retain the items
in the cart
5. Payments
Check for different payment options
If allowing you to check out as a Guest, simply finish the purchase and provide an
User sign up
If you are storing a customer’s credit card or any other financial information, perform
If the user is signed up for a long time, make sure the session is timed out or not.
Every site has a different threshold. For some, it is 10 minutes. For some, it might be
different.
The most popular FAQ I get from e-commerce testers is: Do I have to test every
category/every product?
If you are a returning customer you will be shown some recommended products on
Since these are dynamic elements, the best way to test these parts of the application is to test
Check your Data Mining/BI systems and check from the backend the queries that populate
these sections.
7. After-Order Tests
Check:
Returns
8. Other Tests
Login
FAQs
Contact Us page
Since e-commerce applications operate on an international scale, they need to fulfill certain
requirements before they can be launched. For this reason, web apps have to go through
diverse forms of testing to ensure that every facet of the system works flawlessly.
always remain that may disrupt your app functionality. Thus, the quality of any application is
crucial for customer satisfaction and retention. Functional testing sets the foundation for a
Order tracking
Checkout page
shocking 88% of people will not return to a website they had a bad experience with. So,
refusing to invest in a mobile-first design implementation can cost far more than one could
expect.
However, Testing every possible device on the market is impossible. Testing on the right
likes to get stuck on the payments page. So, it is crucial to ensure a safe, smooth, and secure
Verify that all the data exchanges and transmissions between the user’s device and the
Encryption of the user’s data like credit/debit card details, bank account credentials,
Validate whether there is any information loss during the transmission and ensure that
With BrowserStack App Live, you can be assured of uncompromising e-commerce app
testing security. Pristine devices and browsers are available for everyone, every time. Simply
need to sign up, choose the browser-device-OS combination, and start testing to ensure
operability.
Slow performance can kill performance even on a web app that gets a great score. That is
why performance testing is crucial in SDLC. It guarantees that the e-commerce apps function
Stress testing
Load testing
Volume testing
Spike testing
Scalability testing
Last but not least, every e-commerce website needs to be accessed from multiple browsers-
OS-device combinations. The only way to ensure this is to perform end-to-end cross-browser
So, as you can see, conducting thorough e-commerce automation testing is vital to reduce
bugs and improve performance. Some of the key benefits of E-Commerce mobile app testing
are:
With BrowserStack by your side in your product release cycle, your team can test mobile
apps on real mobile devices and verify their performance in real-world circumstances.
Instead of setting up and maintaining a massive on-premise device lab, teams and individual
testers can simply log in to access 3000+ real Android and iOS devices on the cloud for e
Commerce testing.
Exp. No.: Date:
DEVELOP THE TEST PLAN AND DESIGN THE TEST CASES FOR AN
INVENTORY CONTROL SYSTEM
OBJECTIVE:
To develop the test plan and design the test cases for an inventory control system
Creating a practical test plan and test cases for an inventory control system involves
considering real-world scenarios and ensuring that the system meets the practical needs of
users.
Test Plan
1. Introduction
Brief overview of the inventory control system and its practical significance.
2. Test Objectives
3. Scope
Testing of key features used in daily operations (e.g., product addition, order processing,
reporting).
Testing will be conducted in an environment that mirrors the actual production environment.
5. Test Deliverables
6. Testing Schedule
Testing will be conducted during regular business hours to simulate typical usage patterns.
7. Test Team
9. Test Approaches
Test Cases
Practical scenario: Test the system's ability to efficiently add new products to the inventory
upon receipt.
Practical scenario: Test the system's responsiveness in processing and fulfilling customer
orders in a timely manner.
3. Stock Replenishment
Practical scenario: Test the system's capability to trigger stock replenishment based on
predefined thresholds.
4. Batch Management
Practical scenario: Verify the system's ability to manage and track batches effectively,
especially for perishable goods.
Practical scenario: Evaluate the system's reporting features for quick and informed decision-
making by management.
6. User Accessibility
Practical scenario: Test the user interface for simplicity and accessibility for users with
varying technical expertise.
7. Mobile Access
Practical scenario: Verify the usability of the system via mobile devices for users who need
on-the-go access.
8. System Resilience
Practical scenario: Test the system's ability to recover gracefully from unexpected
interruptions, ensuring minimal disruption to daily operations.
Practical scenario: Validate seamless integration with POS systems to ensure accurate real-
time stock updates.
Practical scenario: Test the system's ability to communicate with vendors for streamlined
procurement and order processing.
Exp. No.: Date:
OBJECTIVE:
To execute the test cases against a client server or desktop application and identify
the defects.
2 Tier Applications
3 Tier Applications
In Client-Server application testing, the client sends requests to the server for specific
information and the server sends the response back to the client with the requested
information. Hence, this testing is also known as two-tier application testing. Few client-
server applications are Email, Web Server, FTP, etc
The picture below depicts what the Client-Server application looks like:
This type of testing is usually done for 2 tier applications (usually developed for LAN). We
will be having Front-end and Backend here.
Characteristics
Merits:
All the data is located at the central location (Server), hence data is protected easily by
providing access to authorized users.
Data can be accessed efficiently even if the server is located away from the clients.
Demerits:
If multiple clients send requests to the same server in parallel, it leads to congestion in
the network because the server may get overloaded.
Due to any reason, if a server fails then none of the client requests can be fulfilled and
this leads to the disruption of the client-server network.
The cost of setting up and maintaining the server is high.
Web Application is a Three-Tier Application:
This has a browser (monitors data) [monitoring is done using HTML, Dhtml, XML,
JavaScript] -> webserver (manipulates data) [manipulations are done using programming
languages or scripts like adv java, asp, JSP, VBScript, JavaScript, Perl, ColdFusion, php] ->
database server (stores data) [data storage and retrieval is done using databases like Oracle,
SQL Server, Sybase, MySQL].
Client/Server Application:
Web Application:
As per the difference in both, the applications come from where and how to access the
resources. In Client-Server, once the connection is made, it will be in the state on connected,
whereas in case the web testing HTTP protocol is stateless, then there comes logic of cookies,
which is not in Client-Server. For Client-Server application, users are well known, whereas
for web application any user can log in and access the content, he/she will use it as per his
intentions.
So, there are always issues of security and compatibility for a Web Application.
Exp. No.: Date:
E-commerce testing helps assess, verify, validate, and test e-commerce websites and apps.
It mainly checks for functionality, usability, security, compatibility, and performance of the
app or website. Besides that, e-commerce mobile app testing also helps evaluate whether the
app conforms to all standards, procedures, and regulations required for secure transactions.
All the pages of the e-commerce website are tested systematically, and transactions
There is no compromise on any crucial factors such as customer data security, mobile
Testing, validating and verifying that the site or application is secured enough from
Whether the application complies with the international standards, regulations, and
loopholes and get them fixed in a short cycle for faster product releases.
In the severe business of e-commerce mobile app development and testing, creating
ecommerce test cases and having a checklist is of prime concern. Let’s look at this quick
page should be good enough to bear the traffic load. The user-friendly home page/screen
empowers the entire mobile app and hence the QA team should scrutinize and test the
2. Search & Navigation: Total revenue in the Mobile App market is estimated to
hit US$420.70bn in 2022. Site search & navigation are two key revenue-driving factors
extensively used by your visitors to explore any mobile app and make buying decisions.
Hence, ensuring they are free of bugs gives a frictionless user experience from one app screen
to another.
3. Product Category and Filters: While testing an E-commerce app/ website, the QA team
should test all categories as wrong product mapping can make users bounce. Hence validating
4. Product Details: Testing the product detail page is critical during performance testing of
the E-commerce application. Also, without a good product description page, an e-commerce
5.Checkout and Payment Process: When any system involves the payment process, it
becomes serious. As we know, frauds and scams are prevalent in the online market, so, we
Selenium is a robust set of tools that supports rapid development of test automation
for web-based applications. Selenium provides a rich set of testing functions specifically
geared to the needs of testing of a web application. These operations are highly flexible,
allowing many options for locating UI elements and comparing expected test results against
actual application behavior. One of Selenium‘s key features is the support for executing one‘s
tests on multiple browser platforms.
Selenium Components
Selenium is composed of three major tools. Each one has a specific role in aiding the
development of web application test automation. Selenium-RC provides an API (Application
Programming Interface) and library for each of its supported languages: HTML, Java, C#,
Perl, PHP, Python, and Ruby. This ability to use Selenium-RC with a high-level
programming language to develop test cases also allows the automated testing to be
integrated with a project‘s automated build environment.
Selenium-Grid
Selenium-Grid allows the Selenium-RC solution to scale for large test suites or test
suites that must be run in multiple environments. With Selenium-Grid, multiple instances of
Selenium-RC are running on various operating system and browser configurations; Each of
these when launching register with a hub. When tests are sent to the hub they are then
redirected to an available Selenium-RC, which will launch the browser and run the test. This
allows for running tests in parallel, with the entire test suite theoretically taking only as long
to run as the longest individual test. * Tests developed on Firefox via Selenium-IDE can be
executed on any other supported browser via a simple Selenium-RC command line. **
Selenium-RC server can start any executable, but depending on browser security settings
there may be technical limitations that would limit certain features.
Test Suites
A test suite is a collection of tests. Often one will run all the tests in a test suite as one
continuous batch-job. When using Selenium-IDE, test suites also can be defined using a
simple HTML file. The syntax again is simple. An HTML table defines a list of tests where
each row defines the filesystem path to each test. An example tells it all.
A file similar to this would allow running the tests all at once, one after another, from
the Selenium-IDE. Test suites can also be maintained when using Selenium-RC. This is done
via programming and can be done a number of ways. Commonly Junit is used to maintain a
test suite if one is using Selenium-RC with Java. Additionally, if C# is the chosen language,
Nunit could be employed. If using an interpreted language like Python with Selenium-RC
than some simple programming would be involved in setting up a test suite. Since the whole
reason for using Sel-RC is to make use of programming logic for your testing this usually
isn‘t a problem. Few typical Selenium commands.
click/clickAndWait – performs a click operation, and optionally waits for a new page to
load.
verifyText – verifies expected text and it‘s corresponding HTML tag are present on the page.
verifyTable – verifies a table‘s expected contents.
Data Driven Testing is a strategic approach that involves executing a set of test script
actions in a repetitive manner, each time utilizing distinct input values sourced from an
associated data repository. This technique enhances efficiency by decoupling the ‘test_case‘
code from the underlying ‘data_set,’ streamlining testing processes.
It is one of the widely-used automation testing best practices for verifying the behavior and
efficiency of tests when handling various types of input values. You can learn more about the
different testing methods by reading the article on TDD vs BDD: Choosing The Suitable
Framework.
Here are the popular external data feed or data sources in data driven testing:
The data feed or data source not only contains the input values used for Selenium
automation testing but can also be used for storing the expected test result and the output
test result. This can be useful in comparing the test execution result and storing the same
for referring to later stages.
Selenium WebDriver lets you perform automated cross browser testing on web
applications; however, it does not have the support to perform create, read, update, and
delete (CRUD) operations on external data feeds like Excel sheets, CSV files, and more.
This is where third-party APIs like Apache POI has to be used since it lets you access and
performs relevant operations on external data sources.
Data-driven testing can be carried out through TestNG using its @DataProvider
annotation. A method with @DataProvider annotation over it returns a 2D array of the object
where the rows determine the number of iterations and columns determine the number of
input parameters passed to the Test method with each iteration.
This annotation takes only the name of the data provider as its parameter which is used to
bind the data provider to the Test method. If no name is provided, the method name of the
data provider is taken as the data provider’s name.
@DataProvider(name = "nameOfDataProvider")
After the creation of data provider method, we can associate a Test method with data
provider using ‘dataProvider’ attribute of @Test annotation. For successful binding of data
provider with Test method, the number and data type of parameters of the test method must
match the ones returned by the data provider method.
@Test(dataProvider = "nameOfDataProvider")
@DataProvider(name = "dataProvider1")
//The test case will run 3 times with different set of values
@Test(dataProvider = "dataProvider1")
The above test “sampleTest” will run 3 times with different set of test data –
{“k1″,”r1”},{“k2″,”r2”},{“k3″,”r3”} received from ‘dataProvider1’ dataProvider method.
Exp. No.: Date:
Page Object Model, also known as POM, is a design pattern in Selenium that creates an
object repository for storing all web elements. It helps reduce code duplication and improves
test case maintenance.
In Page Object Model, consider each web page of an application as a class file. Each class
file will contain only corresponding web page elements. Using these elements, testers can
perform operations on the website under test.
Readability and Reliability of Scripts: When all screens have independent java files, one
can quickly identify actions performed on a particular screen by navigating through the java
file. If a change must be made to a specific code section, it can be efficiently done without
affecting other files.
The Page Object Model is an often used method for improving maintainability of Selenium
tests, to this setup. To do so, we need to accomplish the following steps:
Create Page Objects representing pages of a web application that we want to test
Create methods for these Page Objects that represent actions we want to perform
within the pages that they represent
Create tests that perform these actions in the required order and performs checks that
make up the test scenario
For this purpose, again I use the ParaBank demo application that can be found here. I’ve
narrowed the scope of my tests down to just three of the pages in this application: the login
page, the home page (where you end up after a successful login) and an error page (where
you land after a failed login attempt). As an example, this is the code for the login page:
package com.ontestautomation.seleniumtestngpom.pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
this.driver = driver;
driver.findElement(By.name("username")).sendKeys(username);
driver.findElement(By.name("password")).sendKeys(password);
driver.findElement(By.xpath("//input[@value='Log In']")).click();
return new ErrorPage(driver);
}
driver.findElement(By.name("username")).sendKeys(username);
driver.findElement(By.name("password")).sendKeys(password);
driver.findElement(By.xpath("//input[@value='Log In']")).click();
return new HomePage(driver);
}
}
It contains a constructor that returns a new instance of the LoginPage object as well as two
methods that we can use in our tests: incorrectLogin, which sends us to the error page
and correctLogin, which sends us to the home page. Likewise, I’ve constructed Page Objects
for these two pages as well. A link to those implementations can be found at the end of this
post.
Note that this code snippet isn’t optimized for maintainability – I used direct references to
element properties rather than some sort of element-level abstraction, such as an Object
Repository.
You’ve seen these for the login page in the code sample above. I’ve included similar methods
for the other two pages. A good example can be seen in the implementation of the error page
Page Object:
package com.ontestautomation.seleniumtestngpom.pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
this.driver = driver;
}
return driver.findElement(By.className("error")).getText();
}
}
By implementing a getErrorText method to retrieve the error message that is displayed on the
error page, we can call this method in our actual test script. It is considered good practice to
separate the implementation of your Page Objects from the actual assertions that are
performed in your test script (separation of responsibilities). If you need to perform additional
checks, just add a method that returns the actual value displayed on the screen to the
associated page object and add assertions to the scripts where this check needs to be
performed.
Create tests that perform the required actions and execute the required checks
Now that we have created both the page objects and the methods that we want to use for the
checks in our test scripts, it’s time to create these test scripts. This is again pretty
straightforward, as this example shows (imports removed for brevity):
WebDriver driver;
@BeforeSuite
public void setUp() {
@Parameters({"username","incorrectpassword"})
@Test(description="Performs an unsuccessful login and checks the resulting error
message")
public void testLoginNOK(String username, String incorrectpassword) {
@AfterSuite
public void tearDown() {
driver.quit();
}
}
Note the use of the page objects and the check being performed using methods in these page
object implementations – in this case the getErrorText method in the error page page object.
As we have designed our tests as Selenium + TestNG tests, we also need to define
a testng.xml file that defines which tests we need to run and what parameter values the
parameterized testLoginOK test takes. Again, see my previous post for more details.
Finally, we can run our tests again by right-clicking on the testng.xml file in the Package
Explorer and selecting ‘Run As > TestNG Suite’. After test execution has finished, the test
results will appear in the ‘Results of running suite’ tab in Eclipse. Again, please note that
using meaningful names for tests and test suites in the testng.xml file make these results much
easier to read and interpret.