Sta Lab Manual
Sta Lab Manual
Sta Lab Manual
1
EX.NO.1 TO CREATE CHECKLIST FOR DEVELOPING AND TESTING E-
COMMERCE WEB AND MOBILE APPLICATION
AIM:
To create checklist for testing e-commerce web and mobile application
OBJECTIVE:
To create a checklist for web application testing.
SOFTWARE REQUIRED:
Google Chrome, Java.
DESCRIPTION: (E-COMMERCE TESTING)
E-Commerce website testing involves reviewing the website or web application for any issues
before it goes live and is open to the public. A web application requires testing on various features like
security, functionality, database, etc. The following types of testing will be carried out here:
● Functional Testing
● User Interference testing
● Security Testing
● Browser compatibility Testing
● Load and stress Testing
● Database Testing
PROGRAM:
E-Commerce Testing Checklist:
Important segments and test cases for e-Commerce website testing need to be listed as below
1. Home Page – Hero Image
Homepages of retail sites are very important. Almost all of them have a Hero Image. This is the
kind of the clickable image (a slideshow of sorts) that occupies the majority of the page.
The following are a few things to test:
● Is it going to auto scroll?
● If yes, at what interval will the image be refreshed?
● When the user hovers over it, is it still going to scroll to the next one?
● Can it be hovered on?
2
● Can it be clicked on?
● If yes, is it taking you to the right page and right deal?
● Is it loading along with the rest of the page or loads last in comparison to the other
elements on the page?
● Can the rest of the content be viewed?
● 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.
Common tests are:
● Search based on the Product name, brand name, or something more broadly, the
category. For example Camera, Canon EOS 700D, electronics, etc.
● Search Results have to be relevant
● Different sort options have to be available- based on Brand, Price, and Reviews/ratings etc.
● How many results to display per page?
● For multi-page results, are there options to navigate to them
● Also, search happens in many places.
● The search drilling down into multiple levels into consideration when validating this
functionality. For example: When I search on the home page, I might see something like
this:
Shopping Cart
This is the penultimate stage before the user commits to the purchase.
Test the following:
● Add items to the cart and continue shopping
● If the user adds the same item to the cart while continuing to shop, the item count in the
shopping cart should get incremented
● All items and their totals should be displayed in the cart
● Taxes as per location should be applied
● A user can add more items to the cart- total should reflect the same
● Update the contents added to the cart- total should reflect that too
● Remove items from the cart
● Proceed to checkout
● Calculate Shipping costs with different shipping options
● Apply coupons
● Don’t check out, close the site, and come back later. The site should retain the items in the cart
Payments
● Check different payment options
4
● If allowing check out as Guest, simply finish the purchase and provide an option to
register at the end
● Returning customers – Login to check out
● User sign up
● If storing customer Credit card or any other financial information, perform security
testing around this to make sure it is secure.(PCI compliance is a must)
● 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.
● Emails/Text confirmation with the order number generated
5
3.Categories/Featured Products/Related or Recommended Products
● Since these are dynamic elements, the best way to test these parts of the application is to
test the algorithm based on which these sections are populated.
● Check your Data mining/BI systems and check from the backend the queries that
populate these sections.
After-Order Tests
Check:
● Change the Order
● Cancel the Order
● Track the Order
● Returns
● Create test cases and testing websites were used in Banking applications.
● 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. So testing a web service is important during payment gateways.
RESULT:
Checklist for developing test plan for testing e-commerce web and mobile application are created and
checked.
6
EX.NO.2 TO DEVELOP TEST PLAN DOCUMENT FOR TESTING E-
COMMERCE OR BANKING WEB AND MOBILE APPLICATION
AIM:
To develop test plan document for testing e-commerce or banking web and mobile application.
OBJECTIVE:
SOFTWARE REQUIRED:
All the feature of websiteGuru99 Bank which were defined in software requirement specs are
need to be tested
7
1.1.2) Out of Scope
These feature are not be tested because they are not included in the software requirement specs
● User Interfaces
● Hardware Interfaces
● Software Interfaces
● Database logical
● Communications Interfaces
● Website Security and Performance
1.2) Quality Objective
The test objectives are to verify the Functionality of website Guru99 Bank, the project should
focus on testing the banking operation such as Account Management, Withdrawal, and
Balance…etc. to guarantee all these operations can work normally in real business environment.
1.3) Roles and Responsibilities
The project should use outsource members as the tester to save the project cost.
2 Test Methodology
Test Levels
In the project Guru99 Bank, there’re 3 types of testing should be conducted.
● Integration Testing (Individual software modules are combined and tested as a group)
● System Testing: Conducted on a complete, integrated system to evaluate the
system’s compliance with its specified requirements
8
● api-testing.html: Test all the APIs create for the software under tested
2.2 Bug Triage
2.3 Suspension Criteria and Resumption Requirements
If the team members report that there are 40% of test cases failed, suspend testing until the
development team fixes all the failed cases.
2.4 Test Completeness
● Specifies the criteria that denote a successful completion of a test phase
● Run rate is mandatory to be 100% unless a clear reason is given.
● Pass rate is 80%, achieving the pass rate is mandatory
2.5 Project task and estimation and schedule
9
4 Resource & Environment Needs
4.1 Testing Tools
RESULT:
Test plan document for testing e-commerce or banking web and mobile application was created.
10
EX.NO.3 TO CREATE TEST CASES FOR TESTING E-COMMERCE OR ANY WEB AND
MOBILE APPLICATION
AIM:
To develop test cases for testing e-commerce or any web and mobile application
OBJECTIVE:
SOFTWARE REQUIRED:
DESCRIPTION:
Positive Test Case: Ensure successful completion of the entire purchase process, including product
selection, adding to cart, payment, and order confirmation.
Negative Test Case: Validate error handling by intentionally entering incorrect payment details
during checkout to ensure the system responds appropriately.
Compatibility Test Case: Test the application on various devices and browsers to ensure a seamless
user experience across different platforms.
11
12
TEST SCENARIO – PURCHASE
REAL-TIME APPLICATION:
1.Amazon (E-commerce): Positive test - Add a product to the cart, proceed to checkout, and
successfully complete the purchase. Negative test - Try to checkout with invalid payment information.
2.Facebook (Web and Mobile): Positive test - Post a status update using both the web and mobile
versions. Compatibility test - Access Facebook from different browsers and devices to ensure
consistent functionality.
13
RESULT:
Test cases for testing e-commerce or any web and mobile application was developed
14
EX.NO.4 DESIGN FRONT-END FOR ANY WEB APPLICATION AND DERIVE
THE TEST CASES AS APPLICABLE. VALIDATE THE UI ELEMENTS
USING JAVASCRIPT
AIM:
To design front end for web application and derive ad validate testcase using JavaScript.
OBJECTIVE:
To design front end for web application and derive ad validate testcase using JavaScript.
SOFTWARE REQUIRED:
DESCRIPTION:
Designing the front-end for a web application involves creating an engaging and responsive
user interface using HTML, CSS, and JavaScript. To ensure the robustness of the interface,
comprehensive test cases must be derived, covering aspects such as user input validation, error
handling, and cross-browser compatibility. Implementing JavaScript is crucial for enhancing the
interactivity of UI elements, such as validating forms and managing dynamic content updates. Two
real-time applications exemplifying this process include an e-commerce website, where the front-end
facilitates seamless product browsing and checkout experiences with JavaScript-powered input
validation, and a social media analytics dashboard, where real-time data visualization is achieved
through a well-designed front-end that interacts dynamically with user queries, demonstrating the
versatility and functionality of the implemented UI elements.
PROGRAM:
1. HTML
<html>
<head>
<title>Javascript Login Form Validation</title>
<!-- Include CSS File Here -->
<link rel="stylesheet" href="form-style.css"/>
<!-- Include JS File Here -->
<script src="login.js"></script>
15
</head>
<body>
<div class="container">
<div class="main">
<h2>Javascript Login Form Validation</h2>
<form id="form_id" method="post" name="myform">
<label>User Name :</label>
<input type="text" name="username" id="username"/>
<label>Password :</label>
<input type="password" name="password" id="password"/>
<input type="button" value="Login" id="submit" onclick="validate()"/>
</form>
<span><b class="note">Note : </b>For this demo use following username and password.
<br/><b class="valid">User Name : Form<br/>Password : 123</b></span>
</div>
</div>
</body>
</html>
2. login.js:
3.Success.html
<html>
<head>
<title>Javascript Login Form Validation</title>
</head>
<body>
<h2>Successful Login!</h2>
</body>
</html>
OUTPUT
Logged in successfully.
17
REAL TIME APPLICATION:
E-commerce Website: Design the front-end for an e-commerce platform with responsive product
listings, interactive shopping cart features, and seamless checkout processes. Validate user input and
update cart dynamically using JavaScript.
Social Media Dashboard: Create a front-end for a social media analytics dashboard with real-time
data visualization, allowing users to interact with charts and graphs. Implement JavaScript to validate
input for customized data queries and ensure dynamic updates of analytics.
RESULT:
Front-end for web application is developed and testcases is derived. Validated the UI
elements using JavaScript.
18
EX.NO.5 INSTALL AND IMPLEMENT TEST SCRIPT IN SELENIUM IDE
USING RECORDING, PLAYING BACK / EXECUTING AND SOLVING
RESOURCES / PROCESSES
AIM:
To install and implement test script in Selenium IDE using recording, playing back /
executing and solving resources / processes.
OBJECTIVE:
To install and implement test script in Selenium IDE using recording, playing back /
executing and solving resources / processes.
SOFTWARE REQUIRED:
DESCRIPTION:
Install and implement a test script in Selenium IDE by recording user interactions, playing back or
executing the recorded script, and resolving any issues related to resources or processes during the
execution.
PROGRAM:
Installing IDE
Step 1: Open the Firefox browser.
Step 2: Click on the menu in the top right corner. Step 3: Click on add-ons in the drop down
box.
Step 4: Click on “Find more add-ons” and type “Selenium-IDE”. Step 5: Click on
“Add to Firefox”.
Once installed, the selenium IDE icon appears on the top right corner of the browser.
Once you click on it , a welcome message appears.
Recording a test
Step 1: Provide a name for your project
Step 2: Before recording, specify a valid URL. The recording begins once the browser
navigates to this URL.
Step 3: Clicking on „Start recording‟ will redirect to the specified URL and start
recording the user interactions.
The user is at liberty to stop the recording. All user actions are recorded and
converted into a script.
Save the work
21
Step 1: Click the save icon in the top right corner of the IDE.
Step 2: It will prompt for name and a location of where to save the project. The result is
a single file with a side extension.
Playback
In browser, the tests can be played back in the Selenium automation testing IDE by selecting the
test to play and by clicking on the play button.
OUTPUT
REAL-TIME APPLICATION:
1.Use Selenium IDE to automate testing for a live e-commerce platform, ensuring smooth transaction
flows, form submissions, and inventory management.
2. Employ Selenium IDE to automate testing of a financial web application, validating functionalities
like login, fund transfers, and data security measures.
RESULT:
Selenium IDE was installed successfully and implemented test script using recording, playing
back / executing and solving resources / processes.
22
EX.NO.6 CREATING SELENIUM IDE TESTS - RECORDING AND ADDING
COMMANDS IN A TEST
AIM:
To create selenium IDE tests and to record or add commands in a test
OBJECTIVE:
To create selenium IDE tests and to record or add commands in a test
SOFTWARE REQUIRED:
DESCRIPTION:
Selenium IDE is a browser automation tool that allows users to create tests by recording
interactions with a web application. Test creation involves recording user actions, such as clicks and
inputs, and adding commands to simulate and validate various scenarios.
PROGRAM:
The following steps are involved in creating Selenium tests
using IDE:
Recording and adding commands in a test
Saving the recorded test
Saving the test suite
Executing the recorded test
Recording and Adding Commands in a Test
We use www.ncalculators.com to demonstrate the features of Selenium.
Launch the Firefox browser and navigate to the website –
http://www.ncalculators.com/
Open Selenium IDE from the Tools menu and press the record button that is on the top-right corner.
Navigate to "Math Calculator" >> "Percent Calculator >> enter "10" as number1 and 50 as
number2 and click "calculate".
User can then insert a checkpoint by right clicking on the web element and select "Show all available
commands" >> select "assert text css=b 5"
The recorded script is generated and the script is displayed as shown below.
23
Saving the Recorded Test
Save the Test Case by navigating to "File" >> "Save Test" and save the file in the location of
your choice. The file is saved as .HTML as default.
The test can also be saved with an extension htm, shtml, and xhtml.
OUTPUT
24
REAL-TIME APPLICATION:
25
1.Checkout Testing:
Create Selenium IDE tests to record and validate the end-to-end process of adding items to a
shopping cart, navigating through the checkout flow, and confirming successful transactions.
2.User Authentication Testing:
Use Selenium IDE to record tests for verifying the functionality of user authentication systems,
including recording login attempts, password recovery processes, and account creation workflows on
a website.
RESULT:
Selenium IDE tests was created and to recorded or added commands in a test.
26
EX.NO.7 DEBUG SCRIPTS WITH SELENIUM IDE
AIM:
To debug scripts by using selenium IDE
OBJECTIVE:
To debug scripts by using selenium IDE
SOFTWARE REQUIRED:
DESCRIPTION:
Debugging is the process of finding and fixing errors in the test script. It is a common step
in any script development. To make the process more robust, we can use a plugin "Power
Debugger" for Selenium IDE.
PROGRAM:
STEPS:
To install Power Debugger for Selenium IDE, navigate to https://addons.mozilla.org/en-
US/firefox/addon/power-debugger-selenium-ide/ and click "Add to Firefox" as shown below.
Now launch 'Selenium IDE' and you will notice a new icon, "Pause on Fail" on the recording
toolbar as shown below. Click it to turn it ON. Upon clicking again, it would be turned "OFF".
Users can turn "pause on fail" on or off any time even when the test is running.
Once the test case pauses due to a failed step, you can use the resume/step buttons to continue
the test execution. The execution will NOT be paused if the failure is on the last command of any
test case.
We can also use breakpoints to understand what exactly happens during the step. To insert a
breakpoint on a particular step, "Right Click" and select "Toggle Breakpoint" from the context-
sensitive menu.
Upon inserting the breakpoint, the particular step is displayed with a pause icon as shown below.
When we execute the script, the script execution is paused where the breakpoint is inserted. This
will help the user to evaluate the value/presence of an element when the execution is in progress.
27
OUTPUT:
1.Automated Testing: Selenium IDE is commonly used for automated testing of web applications.
Testers can record and replay interactions to ensure that web pages function correctly, helping to
28
identify and fix issues during development.
2.Web Scraping: Developers and data analysts use Selenium IDE to create scripts for web scraping,
extracting data from websites for analysis or integration into other applications. The tool simplifies
the process of navigating through web pages and capturing relevant information.
RESULT
Scripts was debugged with selenium IDE successfully.
29
EX.NO.8 INSTALLING TESTNG FOR ECLIPSE
AIM:
To install TestNG by using eclipse
OBJECTIVE:
To install TestNG by using eclipse
SOFTWARE REQUIRED:
DESCRIPTION:
Eclipse is an integrated development environment (IDE) widely used for Java development, but
it also supports various other programming languages through plugins. It provides a robust platform for
software development, offering features such as code editing, debugging, and project management in a
unified and user-friendly interface. Eclipse is an open-source IDE and has a large community of
developers contributing to its ecosystem, making it a popular choice for building and maintaining
software applications across different domains.
PROGRAM:
Launch Eclipse and select 'Install New Software'.
Enter the URL as 'http://beust.com/eclipse' and click 'Add'.
The dialog box 'Add Repository' opens. Enter the name as 'TestNG' and
click 'OK'. Click 'Select All' and 'TestNG' would be selected as shown in
the figure.
Click 'Next' to continue.
Review the items that are selected and
click 'Next'. "Accept the License
Agreement" and click 'Finish'.
TestNG starts installing and the progress would be shown follows.
31
Security Warning pops up as the validity of the software cannot be
established. Click 'Ok'. The Installer prompts to restart Eclipse for the
changes to take effect. Click 'Yes'.
OUTPUT:
Cross-Browser Testing: TestNG is employed for cross-browser testing, ensuring web applications
function correctly across different browsers and versions, helping maintain a consistent user
experience.
32
Test Suites Management: In large-scale projects, TestNG is utilized to manage and execute
comprehensive test suites, providing a structured approach to testing that aids in identifying and
addressing software defects early in the development process.
RESULT:
TestNG installed using eclipse successfully.
33
EX.NO.9 SETTING UP TESTNG AND ECLIPSE AND LOAD JAVA
PROGRAM
AIM:
To set up TestNG and Eclipse and load java program in it.
OBJECTIVE:
To set up TestNG and Eclipse and load java program in it.
SOFTWARE REQUIRED:
DESCRIPTION:
Setting up TestNG and Eclipse involves installing the TestNG plugin in Eclipse, creating a
new Java project, and configuring TestNG annotations for test classes.
PROGRAM:
Launch Eclipse and create a 'New Java Project' as
shown below. Enter the project name and click
'Next'.
Navigate to "Libraries" Tab and Add the Selenium Remote Control Server JAR file by
clicking on "Add External JAR's" as shown below.
The added JAR file is shown here. Click 'Add Library'.
The 'Add Library' dialog opens. Select 'TestNG' and click 'Next' in the 'Add
Library' dialog box. The added 'TestNG' Library is added and it is displayed as
shown below.
Upon creating the project, the structure of the project would be as
shown below. Right-click on 'src' folder and select New >>
Other.
Select 'TestNG' and click 'Next'.
Select the 'Source Folder' name and click 'Ok'.
34
Select the 'Package name', the 'class name', and click 'Finish'. The Package explorer
and the created class would be displayed.
OUTPUT:
Automated Testing in Continuous Integration: Integrate TestNG with Jenkins to automate test
35
execution in a CI/CD pipeline, ensuring the reliability of software releases.
Regression Testing for Web Applications: Utilize TestNG with Selenium WebDriver to perform
regression testing on web applications, verifying that new code changes do not adversely impact
existing functionalities.
RESULT:
TestNG and Eclipse set up was created and loaded with Java jdk program.
36
EX.NO.10 TESTING IN TESTNG FOR USECASE PERCENT CALCULATOR
AIM:
To use TestNG and run testing for percent calculator
OBJECTIVE:
To use TestNG and run testing for percent calculator
SOFTWARE REQUIRED:
DESCRIPTION:
In the use case of a percentage calculator, TestNG can be employed to verify the accuracy
of percentage calculations through various test scenarios.It provides annotations, grouping, and
parallel execution, enhancing the efficiency and reliability of testing in applications like
percentage calculators.
PROGRAM:
package TestNG;
import
java.util.concurrent.TimeUnit;
import org.openqa.selenium.*;
import
org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import
org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class TestNGClass {
WebDriver driver = new
FirefoxDriver(); @BeforeTest
37
public void launchapp() {
// Puts an Implicit wait, Will wait for 10 seconds before throwing
exception driver.manage().timeouts().implicitlyWait(10,
TimeUnit.SECONDS);
// Launch website
driver.navigate().to("http://www.calculator.net");
driver.manage().window().maximize();
}
@Test
public void calculatepercent() {
// Click on Math Calculators
driver.findElement(By.xpath(".//*[@id='menu']/div[3]/a")).click();
if(result.equals("5")) {
System.out.println(" The Result is Pass");
} else {
System.out.println(" The Result is Fail");
}
}
@AfterTest
public void
terminatetest() {
driver.close();
}
}
Execution
1. To execute, right click on the created XML and select "Run As" >> "TestNG Suite"
2. The output is thrown to the console and it would appear as shown below. The console output
also has an execution summary.
39
OUTPUT:
Financial Calculators: TestNG can be used to test percentage calculation modules in financial
applications, ensuring accurate interest rates, loan repayments, and investment returns.
Educational Platforms: In e-learning platforms with percentage calculators for grading or
assessments, TestNG can be employed to validate the correctness of percentage calculations in
31
0
scenarios like quiz scores or student performance tracking.
RESULT:
TestNG suit was used and executed testing for percent calculator usecase successfully.
31
1