Ccs366 Sta Lab Final
Ccs366 Sta Lab Final
Ccs366 Sta Lab Final
J COLLEGE OF ENGINEERING
(ACADEMICYEAR: 2022-2023)
Name :
Register Number :
Year/Semester : III/V
(ANNA UNIVERSITY:CHENNAI-600025)
MOHAMED SATHAK A.J COLLEGE OFENGINEERING
(Approved by AICTE,New Delhi and Affiliated to Anna University)34,Old
Mahabalipuram Road,Egattur,Chennai–603103.
Chennai–600034.
BONAFIDE CERTIFICATE
Submitted for the Anna University B.E Practical Examination held on.
.................................
10
3
Exp.No.1 To create checklist for developing and testing e-commerce web and mobile
application
Date:
Aim
1. To create checklist for testing e-commerce web and mobile application
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?
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.
4
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:
5
4. 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
6
5. Payments
7
6. 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.
7. After-Order Tests
Check:
Change the Order
Cancel the Order
Track the Order
Returns
Result:
Checklist for developing test plan for testing e-commerce web and mobile application are created and
checked.
8
Exp.No.2 To develop test plan document for testing e-commerce or banking web and
mobile application
Date:
Aim
1. To develop test plan document for testing e-commerce or banking web and mobile application
1)Introduction
The Test Plan is designed to prescribe the scope, approach, resources, and schedule of all testing activities
of the project Guru99 Bank.
The plan identify the items to be tested, the features to be tested, the types of testing to be performed, the
personnel responsible for testing, the resources and schedule required to complete testing, and the risks
associated with the plan
1.1) Scope
1.1.1) In Scope
All the feature of websiteGuru99 Bank which were defined in software requirement specs are need to be
tested
9
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 operation 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.
10
2 Test Methodology
2.1 Overview
2.2 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
/api-testing.html: Test all the APIs create for the software under tested
2.3 Bug Triage
2.4 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.5 Test Completeness
11
– Test Tool Simulators.
– Test Data
– Test Trace-ability Matrix – Error logs and execution logs.
After the testing cycles is over
Test Results/reports
Defect Report
Installation/ Test procedures guidelines
Release notes
4 Resource & Environment Needs
4.1 Testing Tools
Result:
Test plan document for testing e-commerce or banking web and mobile application was created.
12
Exp.No.3 To create test cases for testing e-commerce or any web and mobile application
Date:
Aim
1. To develop test cases for testing e-commerce or any web and mobile application
Test Scenario - Login
13
Test Scenario – Purchase
14
Test Scenario – Search
Result:
Test cases for testing e-commerce or any web and mobile application was developed
15
Exp.No.4 Design Front-end for any web application and derive the test cases as
Aim
To Design Front-end for any web application and derive the test cases as applicable. Validate the UI
elements using JavaScript.
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>
</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>
16
2. login.js:
3.Success.html
<html>
<head>
<title>Javascript Login Form Validation</title>
</head>
<body>
<h2>Successful Login!</h2>
</body>
</html>
17
Output
Logged in successfully.
18
Result
Front-end for web application is developed and testcases is derived. Validated the UI elements using
JavaScript.
19
Exp.No.5 Install and implement test script in Selenium IDE using recording,
playing back / executing and solving resources / processes.
Date:
Aim
To install and implement test script in Selenium IDE using recording, playing back / executing and
solving resources / processes.
Installing IDE
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.
20
Output
21
Result
Selenium IDE was installed successfully and implemented test script using recording, playing
back / executing and solving resources / processes.
22
Exp.No.6 Creating Selenium IDE Tests - Recording and Adding Commands in a
Test
Date:
Aim
To create selenium IDE tests and to record or add commands in a test
The following steps are involved in creating Selenium tests using IDE:
23
Executing the Recorded Test
The recorded scripts can then be executed either by clicking "Play entire suite" or "Play current test"
button in the toolbar
The Run status can be seen in the status pane that displays the number of tests passed and failed.
Once a step is executed, the user can see the result in the "Log" Pane.
After executing each step, the background of the test step turns "Green" if passed and "Red" if failed as
shown below
24
Output
25
26
Result
Selenium IDE tests was created and to recorded or added commands in a test.
27
Exp.No.7 Debug scripts with Selenium IDE
Date:
Aim
To debug scripts by using selenium IDE
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.
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.
28
Output
29
Result
Scripts was debugged with selenium IDE successfully.
30
Exp.No.8 Installing TestNG for Eclipse
Date:
Aim
To install TestNG by using eclipse
Steps
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.
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'.
31
Output
32
Result
TestNG installed using eclipse successfully.
33
Exp.No.9 Setting up TestNG and Eclipse and load Java program.
Date:
Aim
To set up TestNG and Eclipse and load java program in it.
Steps
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'.
Select the 'Package name', the 'class name', and click 'Finish'.
The Package explorer and the created class would be displayed.
34
Output
35
Result
TestNG and Eclipse set up was created and loaded with Java jdk program.
36
Exp.No.10 Testing in TestNG for Usecase Percent Calculator
Date:
Aim
To use TestNG and run testing for percent calculator
Note: We will use the demo application, www.calculator.net, and perform percent calculator.In the
following test, you will notice that there is NO main method, as testNG will drive the program execution
flow. After initializing the driver, it will execute the '@BeforeTest' method followed by '@Test' and then
'@AfterTest'. Please note that there can be any number of '@Test' annotation in a class but '@BeforeTest'
and '@AfterTest' can appear only once.
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
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
37
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");
}
}
38
@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
40
Result
TestNG suit was used and executed testing for percent calculator usecase successfully.
41