0% found this document useful (0 votes)
147 views68 pages

Software Testing Lab Manual 2017-18

This document is the software testing lab manual for RJS Polytechnic for the year 2017-18. It provides an introduction and overview of automation testing and the benefits of automation. It describes various test artifacts used in automation like test plans, test cases, test scripts, test sets, test logs and reusable components. It also provides an introduction to the Selenium tool including its history, components like Selenium IDE, commands for actions, assertions and accessing application states. It describes how to record and run test cases using Selenium IDE.

Uploaded by

Vinayaka VM
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)
147 views68 pages

Software Testing Lab Manual 2017-18

This document is the software testing lab manual for RJS Polytechnic for the year 2017-18. It provides an introduction and overview of automation testing and the benefits of automation. It describes various test artifacts used in automation like test plans, test cases, test scripts, test sets, test logs and reusable components. It also provides an introduction to the Selenium tool including its history, components like Selenium IDE, commands for actions, assertions and accessing application states. It describes how to record and run test cases using Selenium IDE.

Uploaded by

Vinayaka VM
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/ 68

Software Testing Lab manual 2017-18

SOFTWARE TESTING
LAB MANUAL
RJS Polytechnic, Koramangala

According to DTE Syllabus 2015-16


Software Testing Lab

Vinayaka V.M.
[email protected]
SOFTWARE TESTING LAB MANUAL

SOFTWARE TESTING LAB MANNUAL


6th SEM COMPUTER SCIECNCE
(2017-18)

By
Mr. Vinayaka V.M. M.Tech.

Computer Science and Engineering Department


RJS Polytechnic, Koramangala, Bengaluru

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 1


SOFTWARE TESTING LAB MANUAL

EXERCISE 01

1. Understand the Automation Testing Approach (Theory Concept) Introduction:

Introduction:

What is Automation?
- Automation is making a process automatic, eliminating the need for human intervention.
- Is a self-controlling or self-moving process.
- Automation software offers automation wizard and commands of its own in addition to
providing task recording and re-play capabilities.
- Using these tools we can record the task
- Then if needed use the editor to edit the task, add new commands or using GUI
automation wizards

Benefits of Automation

Fast: Test automation runs faster than human users

Reliable: It performs precisely the same operations at each time elimination human errors

Repeatable: It performs the same operation with different combination of data in a less time

Programmable: We can use sophisticated tests that brings out hidden information

Reusable: We can develop reusable components which can run on different versions of
application under test

Regression testing: Easy to conduct regression test

Enabling 24*7 testing: test can be schedule and supports unattended recovery

Robust Verification: Support robust verification mechanism than any other testing tools

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 2


SOFTWARE TESTING LAB MANUAL

What Tests should be Automated?

• Tests executed for each software build

• tests which can be easily automated

• Business critical tests

• tests that are difficult to perform manually

Test artefacts (tools):


Requirements: the requirements that are being tested are stored into the repository. This
feature enables us to map the requirements to test cases and test scripts.

Test Plan: Design the tests and build the test plan on it using the test management tool. The
test plan will be maintained in a central repository. This will help to produce reusable tests
cases in future. The information is sharable and preserved.

Test case: Contains description of test case and test steps.

Test script: Automated test script associated with each test case will be stored in the quality
centre repository.

Test sets: this will be a set of selected test cases and associated test scripts. The tests sets are
executed from the quality centre onto remote machines. The status of each execution is stored
in the respective test case execution status. The status can be either pass/fail, it doesn.t
maintain exact details of execution.

Test logs: The test script execution logs are stored in global repository. It contains the status
of each test case.

Reusable components: The repetitive functions that are invoked in most of the functions are
stored, which reduces the coding redundancies.

Object repository: contains the declaration of the application objects. Data sheets: contains
the test data used for execution. it can be populated by the database or manually.

Automation Activity:
Record the application GUI Write Script Execute script Review the script Modify script if
any changes. Execute scripts on at least two machines Store the script in central repository
Execute the script from central repository Verify the execution status in central repository
Verify the test logs on common server Prepare the test reports

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 3


SOFTWARE TESTING LAB MANUAL

INTRODUCTION TO SELENIUM
1. History of Selenium
• In 2004 invented by Jason R. Huggins and team.
• Original name is JavaScript Functional Tester [JSFT]
• Open source browser based integration test framework built originally by Thoughtworks.
• 100% JavaScript and HTML
• Web testing tool
• That supports testing Web 2.0 applications
• Supports for Cross-Browser Testing(ON Multiple Browsers)
• And multiple Operating Systems
• Cross browser – IE 6/7, Firefox .8+, Opera, Safari 2.0+
2. What is Selenium?
• Acceptance Testing tool for web-apps
• Tests run directly in browser
• Selenium can be deployed on Windows, Linux, and Macintosh.
• Implemented entirely using browser technologies -
- JavaScript
-DHTML
-Frames
3. Selenium Components
– Selenium IDE
– Selenium Core
– Selenium RC
– Selenium Grid
Selenium IDE
• The Selenium-IDE (Integrated Development Environment) is the tool you use to develop
your Selenium test cases.
• It is Firefox plug-in
• Firefox extension which allows record/play testing paradigm
• Automates commands, but asserts must be entered by hand
• Creates the simplest possible Locator
• Based on Selenese
Overview of Selenium IDE:
A.Test Case Pane
B.Toolbar
C.Menu Bar
D.Log/Reference/UI-Element/Rollup Pane

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 4


SOFTWARE TESTING LAB MANUAL

A. Test Case Pane:


• Your script is displayed in the test case pane.
• It has two tabs.
• one for displaying the command (source)
• and their parameters in a readable “table” format.

B. Toolbar:
The toolbar contains buttons for controlling the execution of your test cases.
C. Menu Bar:
• File Menu: The File menu allows you to create, open and save test case and test suite files.
• Edit Menu: The Edit menu allows copy, paste, delete, undo and select all operations for
editing the commands in your test case.
• Options Menu: The Options menu allows the changing of settings. You can set the timeout
value for certain commands, add user-defined user extensions to the base set of Selenium
commands, and specify the format (language) used when saving your test cases.
D. Help Menu:
It has help information.

Introducing Selenium Commands


The command set is often called selenese. Selenium commands come in three “flavors”:
Actions, Accessory and Assertions.
a. Actions: user actions on application / Command the browser to do something.
Actions are commands that generally manipulate the state of the application.
1. Click link- click / Clickandwait
2. Selecting items
b. Accessors: Accessors examine the state of the application and store the results in variables,
e.g. "storeTitle".
c. Assertions: For validating the application we are using Assertions
1. For verifying the web pages
2. For verifying the text
3. For verifying alerts
Assertions can be used in 3 modes:
• assert
• verify
• waitFor
Example: "assertText","verifyText" and "waitForText".

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 5


SOFTWARE TESTING LAB MANUAL

NOTE:
1. When an "assert" fails, the test is aborted.
2. When a "verify" fails, the test will continue execution
3. "waitFor" commands wait for some condition to become true
Commonly Used Selenium Commands
These are probably the most commonly used commands for building test.
open - opens a page using a URL.
click/clickAndWait - performs a click operation, and optionally waits for a new page to load.
verifyTitle/assertTitle - verifies an expected page title.
verifyTextPresent- verifies expected text is somewhere on the page.
verifyElementPresent -verifies an expected UI element, as defined by its HTML tag, is
present on the page.
verifyText - verifies expected text and it’s corresponding HTML tag are present on the page.
verifyTable - verifies a table’s expected contents.
waitForPageToLoad - pauses execution until an expected new page loads. Called
automatically when clickAndWait is used.
waitForElementPresent -pauses execution until an expected UI element, as defined by its
HTML tag, is present on the page.

Recording and Run settings


When Selenium-IDE is first opened, the record button is ON by default. During recording,
Selenium-IDE will automatically insert commands into your test case based on your actions.
a. Remember Base URL MODE - Using Base URL to Run Test Cases in Different Domains
b. Record Absolute recording mode – Run Test Cases in Particular Domain.

Running Test Cases


Run a Test Case
Click the Run button to run the currently displayed test case. Run a Test Suite Click the Run
All button to run all the test cases in the currently loaded test suite.
Stop and Start
The Pause button can be used to stop the test case while it is running. The icon of this button
then changes to indicate the Resume button. To continue click Resume.
Stop in the Middle
You can set a breakpoint in the test case to cause it to stop on a particular command. This is
useful for debugging your test case. To set a breakpoint, select a command, right-click, and
from the context menu select Toggle Breakpoint.
Start from the Middle
You can tell the IDE to begin running from a specific command in the middle of the test case.
This also is used for debugging. To set a start point, select a command, right-click, and from
the context menu select Set/Clear Start Point.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 6


SOFTWARE TESTING LAB MANUAL

Run Any Single Command


Double-click any single command to run it by itself. This is useful when writing a single
command. It lets you immediately test a command you are constructing, when you are not
sure if it is correct. You can double-click it to see if it runs correctly. This is also available
from the context menu.
Test Suite: 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.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 7


SOFTWARE TESTING LAB MANUAL

EXCERCISE 02

2. Using Selenium IDE, Write a test suite containing minimum 4 test cases.

Requirements

• Download Selenium IDE 1.5 or above addon for firefox from http://seleniumhq.org/download/
Or http://addons.mozilla.org/ from firefox browser.
• The webpage used in this example is a java Script program ‘Menu Driven Arithmetic Operations’
• A java Script for Arithmetic operation.

• Firefox version 10.0

Procedure:-

• Type the html code in notepad and save as arithmetic.html


• Open Firefox browser select toolsweb developerselenium IDE
• Click on Start recording minimize the selenium window
• Run the Arithmetic program by giving values
• Execution will be recorded in the Selinium IDE
• In Selenium IDE, test cases and test suites will be generated.

Java script to develop a web page for Arithmetic Operations. Save this file on desktop and
save as arithmetic.html

<html>
<head>
<title> Arithmatic Operation </title>
<script type="text/javascript">
var n1,n2,r;
function add()
{
n1=document.myform.n1.value;
n2=document.myform.n2.value;
n1=parseFloat(n1);
n2=parseFloat(n2);
r=n1+n2;
document.myform.result.value=r;
}

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 8


SOFTWARE TESTING LAB MANUAL

function sub()
{
n1=document.myform.n1.value;
n2=document.myform.n2.value;
n1=parseFloat(n1);
n2=parseFloat(n2);
r=n1-n2;
document.myform.result.value=r;
}
function mul()
{
n1=document.myform.n1.value;
n2=document.myform.n2.value;
n1=parseFloat(n1);
n2=parseFloat(n2);
r=n1*n2;
document.myform.result.value=r;
}
function divide()
{
n1=document.myform.n1.value;
n2=document.myform.n2.value;
n1=parseFloat(n1);
n2=parseFloat(n2);
r=n1/n2;
document.myform.result.value=r;
}
</script>
</head>
<body>
<form name="myform">
<h1 align="center"> Arithmatic Operations</h1> <hr color="red"> <center>
<u>Enter a number in each text box </u>
<br><br>
Number 1:<input type="text" name="n1" value="">
<br><br>
Number 2:<input type="text" name="n2" value="">
<br><br>
<input type="button" value="Add" onClick="add()">

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 9


SOFTWARE TESTING LAB MANUAL

<input type="button" value="Subtract" onClick="sub()">


<input type="button" value="Multiply" onClick="mul()" >
<input type="button" value="Divide" onClick="divide()">
<br><br>
<font color="red">Result is: <input type="text" name="result" value="">
</center>
</font>
</form>
</body>
</html>

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 10


SOFTWARE TESTING LAB MANUAL

OUTPUT:

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 11


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 12


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 13


SOFTWARE TESTING LAB MANUAL

EXERCISE 03

3.Understanding Test Automation. Using Selenium write a simple test script to validate
each field of the registration page ( Eg: Face book Registration Page)

Requirements:
• Download Selenium IDE 1.5 or above from http://seleniumhq.org/download/ from
Firefox browser.
• A html Script for Registration form.
• Firefox version 10.0.
Procedure:-
Type this code in notepad and save on desktop

<html>
<body>
<form tag="Create Logon">
<div align="center">
Username *: <input type="username" name="username" /><br />
Password *: <input type="password" name="pwd" /><br />
Surname *: <input type="surname" name="surname" /><br />
Other Names *: <input type="other names" name="names" /><br />
Date of Birth *: <input type="date of birth" name="dob" /><br />
Email *: <input type="email" name="email" /><br />
Telephone: <input type="telephone" name="tel" /><br />
Address *: <input type="address" name="add" /><br />
Post Code *: <input type="postcode" name="ptc" /><br />
<input type="submit" value="Submit" />
</div>
</form>
<p>Note: Please make sure your details are correct before submitting form and that all fields marked with *
are completed!.</p>
</body>
</html>

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 14


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 15


SOFTWARE TESTING LAB MANUAL

Test program to be typed in selenium IDE: Select source tab in selenium and type

Test program to be typed in selenium IDE:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://change-this-to-the-site-you-are-testing/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 16


SOFTWARE TESTING LAB MANUAL

</thead>
<tbody>
<tr>
<td>open</td>
<td>file:///C:/Users/RJSPL112/Desktop/reg.html</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=username</td>
<td>Vinayaka</td>
</tr>
<tr>
<td>type</td>
<td>name=pwd</td>
<td>vinaaa</td>
</tr>
<tr>
<td>type</td>
<td>name=surname</td>
<td>vm</td>
</tr>
<tr>
<td>type</td>
<td>name=names</td>
<td>vinay</td>
</tr>
<tr>
<td>type</td>
<td>name=dob</td>
<td>24-08-1985</td>
</tr>
<tr>
<td>type</td>
<td>name=email</td>
<td>[email protected]</td>
</tr>
<tr>
<td>type</td>
<td>name=tel</td>
<td>9191919191</td>
</tr>
<tr>
<td>type</td>
<td>name=add</td>
<td>villa 4th cross venkatapura</td>
</tr>
<tr>
<td>type</td>
<td>name=ptc</td>
<td>560034</td>
</tr>
<tr>
<td>clickAndWait</td>

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 17


SOFTWARE TESTING LAB MANUAL

<td>css=input[type=&quot;submit&quot;]</td>
<td></td>
</tr>

</tbody>
</table>
</body>
</html>

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 18


SOFTWARE TESTING LAB MANUAL

EXERCISE 04
4. Install Selenium server and demonstrate it using a script in Java/PHP.
Requirements:
• Download the following :
selenium-server-standalone-2.32.0 selenium-java-client-driver from
http://seleniumhq.org/download/ save these 2 jar files under
C:\Program Files (x86)\java\jdk1.6.0\bin
(You can use jdk6 and above versions of java)
• Download ‘Eclipse IDE for java developers’ from http://www.eclipse.org/downloads/.
This is not an installable file. So just copy the file under C: drive. whenever you need to
write test code in eclipse just double click on the eclipse application inside the eclipse
folder.
• Firefox version 10 is required.

Procedure:-
• Type the html code in the notepad and save that as GCD.html
• Open eclipse application  give the folder name where you want to store your files. the
default will be ‘ workspace ‘
• Then go to filenewjava project.
• You will get Create java project window , Name the project to st  click finish. Double
click on the new project st on the package explorer  you will get src folder and JRE
System Library
• Right click on the src foldergo to newclick on the class  you will get new java class
window name the class as Gcd  click finish. After writing this code if u get red lines
under the selenium then include the selenium-server-standalone-2.32.0.jar and selenium-
java-clientdriver.jar files
• The steps are :
• Right click on the st folder  click on properties  click on Java Build path  then
select the libraries tab  click on Add External JARs  browse for selenium-
serverstandalone-2.32.0.jar  click open  again click on Add External JARs 
browse for selenium-java-clientdriver.jar  click open  click ok.
• To run the above program
First open the command prompt, go to the C:\Program Files (x86)\java\jdk1.6.0_25\bin
folder ->run/write the command java –jar selenium-server-standalone-2.32.0.jar 4444
• Click on run button in eclipse the output will be displayed the console.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 19


SOFTWARE TESTING LAB MANUAL

Java script to develop a web page which calculates the GCD of 2 numbers. Save this file on desktop and
save as GCD.html

<html>
<head>
<script type="text/javascript">
function gcd()
{
var x,y;
x=parseInt(document.myform.n1.value);
y=parseInt(document.myform.n2.value);
while(x!=y)
{
if(x>y)
x=x-y;
else
y=y-x;
}
document.myform.result.value=x;
}
</script>
</head>
<body>
<h1 align="center"> Program to calculate gcd of two numbers </h1> <hr color="red">
<center> Enter two numbers : <form name="myform">
Number 1 : <input type="text" name="n1" value=""> <br> <br>
Number 2 : <input type="text" name="n2" value=""> <br> <br>
<input type="button" value="Get GCD" onClick="gcd()"> <br> <br>
GCD is : <input type="text" name="result" value="">
</form>
</body>
</html>

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 20


SOFTWARE TESTING LAB MANUAL

Java test script for testing the GCD webpage. (write this code in eclipse environment).

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@SuppressWarnings("deprecation")
public class GcdTest extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium ("localhost", 4444, "*firefox",
"file:///C:/Users/RJSP/Desktop/GCD.html");
selenium.start();
}

@Test
public void testGcd() throws Exception {
selenium.setSpeed("2000");
selenium.open("file:///C:/Users/RJSP/Desktop/GCD.html");
selenium.windowMaximize();
selenium.type("name=n1", "5");
selenium.type("name=n2", "6");
selenium.click("css=input[type=\"button\"]");
String result = selenium.getValue("name=result");
System.out.println("the gcd is : " +result);
}

@After
public void tearDown() throws Exception {
selenium.stop();
}
}

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 21


SOFTWARE TESTING LAB MANUAL

Write the Above code in eclipse by following the below steps

• Open eclipse application-> give the folder name where you want to store your files. the default will be
‘ workspace ‘

• Then go to filenewjava project.

• You will get Create java project window , Name the project to st  click finish.

• Double click on the new project st on the package explorer

• you will get src folder and JRE System Library

• right click on the src foldergo to newclick on the class

• you will get new java class window, name the class as GcdTest

• click finish.

Note: Make sure that the path of your GCD.html file must be correct , in this example it is
file:///C:/Users/RJSP/Desktop/GCD.html
After writing this code if you get red lines under the selenium then include the selenium-server-standalone-2.32.0.jar
and selenium-java-clientdriver.jar files.
The steps are : Right click on the st folder click on propertiesclick on Java Build path then select the libraries
tab  click on Add External JARs  browse for
selenium-server-standalone-2.32.0 click open again click on Add External JARs  browse for
selenium-java-clientdriver  click open  click ok.
To run the above program

• First open the command prompt

• go to the jdk1.6.0_26\bin folder

• run/write the command


java –jar selenium-server-standalone-2.32.0.jar 4444

Then click on run button in eclipse

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 22


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 23


SOFTWARE TESTING LAB MANUAL

EXERCISE 05
5. Conduct a test suite for any two web sites.

Requirements:

• Download Selenium IDE 1.5 or above from http://seleniumhq.org/download/ from


Firefox browser.
• Firefox version 10.0
• Internet connection is required.

Procedure:-
• Open firefox browser-> select tools->web developer->selenium IDE.
• Click on Start recording ->minimize the selenium window.
• Visit any website save testcase
• Create new testcase visit another website save testcase.
• Click on play entire test suite button in the selenium IDE.

TC’S #1: Manual Steps:


• Open (Example : Type www.google.com)
• Type “energy efficient” in the Google Search Input Box
• Click outside on an empty spot
• Click Search Button
• Verify the Text Present as “energy efficient”
• Assert the Title as “energy efficient - Google Search”
• Save the test case with .HTML Extension.

TC#2:
1: Open Firefox Web Browser
2: In the address bar, Type http://www.sretravels.com
3: Close advertisementselect source and destination cities
4: Click on the date  select today’s date  click on search button
5: Wait for Search Results to come
6: Stop recording.
7. Save the test case as sretravels.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 24


SOFTWARE TESTING LAB MANUAL

Steps for creating test suite:


1. Create more Test Cases save each Test Case.
2. Open Firefox
3. Open Tools Selenium IDE
4. File Open new Test Suite
5. File Open Add Test cases
6. Add test cases you just created (at least two)
7. click FileSave Suite.
8. Run the test suite

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 25


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 26


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 27


SOFTWARE TESTING LAB MANUAL

EXERCISE 06

6. Write and test a program to login a specific web page.


Requirements:
• Write this java test code in eclipse.
• Before running this code makes sure your selenium RC server is running
• First open the command prompt, go to the C:\Program Files (x86)\java\jdk1.6.0_25\bin folder ->run/write
the command java –jar selenium-server-standalone-2.32.0.jar 4444

Procedure:-
• Open eclipse application  give the folder name where you want to store your files. the
default will be ‘ workspace ‘
• Then go to filenewjava project.
• You will get Create java project window , Name the project to st  click finish.
• Double click on the new project st on the package explorer  you will get src folder
and JRE System Library
• Right click on the src foldergo to newclick on the class you will get new java
class window name the class as Login click finish.

• Type in the java code in that Login.java file


• After writing this code if you get red lines under the selenium then include the selenium
server and selenium java driver jar file. The steps are :
• Right click on the st folder click on properties click on Java Build path then select
the tab librariesclick on Add External JARs browse for
selenium-serverstandalone-2.32.0click openagain click on Add External JARs
browse for selenium-java-clientdriverclick open click ok.
• To run the above program
First open the command prompt
Go to the C:\Program Files (x86)\java\jdk1.6.0_26\bin folder  run/write the command
java –jar selenium-server-standalone-2.32.0.jar 4444
• Click on run the output will be displayed the console

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 28


SOFTWARE TESTING LAB MANUAL

import com.thoughtworks.selenium.*;
@SuppressWarnings("deprecation")
public class login extends SeleneseTestCase
{
public void setUp() throws Exception
{
setUp("http://php.thedemosite.co.uk/","*firefox");
}
public void testloginlogout()
{
selenium.setSpeed("2000");
selenium.open("/login.php");
selenium.windowMaximize();
selenium.type("//input[@name='username']", "mytest");
selenium.type("//input[@name='password']", "mytest");
selenium.click("//input[@type='button']");
selenium.waitForPageToLoad("50000"); }
}

OUTPUT:

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 29


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 30


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 31


SOFTWARE TESTING LAB MANUAL

EXERCISE 06
06.Write test cases to validate a mobile number using one-time pin identification
(OTP)

Requirements :

• Download Selenium IDE 1.5 or above from http://seleniumhq.org/download/ from


Firefox browser.
• Firefox version 10.0
• Internet connection required.

Test Cases for OTP:

1) OTP should be generated within time period.

2) Limitations of number of OTP generation for single authentication.

3) It is received only on registered Mobile Number / E-mail Address.

4) Network delay for expiry of One-Time Password.

5) Verify that once expired, it should not be used for any authentication.

6) Verify that once used, it should not be allowed to use again.

7) Verify that resend OTP functionality is working properly.

8) Verify that once user resent the OTP, the old one should be of no use.

9) How many times user can provide invalid OTP?

10) Provide an invalid Phone Number or E-Mail address and submit the OTP. Check the validation.

To verify mobile number using OTP in google account:


1. Visit Google's 2-Step Verification page and click on Get Started.
2. Enter your Google email and password (or just your password, if you're already logged in to Google).
3. Click the Start setup button.
4. Add a phone number that Google can send the six-digit verification code to. (For semi-obvious
reasons, this shouldn't be your Google Voice number: If you use that phone number, you might end up
locked out of your account.)

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 32


SOFTWARE TESTING LAB MANUAL

9191919191

5. Verify your phone number by entering in the six-digit code Google sent you.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 33


SOFTWARE TESTING LAB MANUAL

6. Choose not to add your current computer as a trusted device.

7. Confirm that you wish to turn on two-step verification.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 34


SOFTWARE TESTING LAB MANUAL

8. Now open firefox 10.0  start selenium ide … by default recording will be on.
9. Open gmail.com  input phone number in the text box present for entering email id / phone number.
10. Click next
11. Enter password
12. Click next
13. Now system will ask to enter an OTP which is sent to your mobile number.
14. See the message you got to your mobile and enter the OTP in the text box.
15. Uncheck the check box button for remember this computer.
16. Click next
17. Now click on signout
18. Stop recording.
19. Now play the test case.
20. You should get a failure because OTP can be used only one time.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 35


SOFTWARE TESTING LAB MANUAL

EXERCISE 08

8. Write and Test a program to find out list of employees having salary greater than
₹ 50,000 and age between 30 to 40 years.

Requirements:

• Write this java test code in eclipse. Since we are not using any Selenium object here no
need of selenium RC Server to run at the command prompt for this program.
• Since we are dealing with the excel, we need to add the external jar file jxl-2.6 in to the
java project.
• Download jxl-2.6.jar and past it in C:\Program Files (x86)\java\jdk1.6.0_25\bin and
Follow the same steps as we used to add selenium server and selenium java driver to our
java project.

Procedure:-
• Create the Microsoft excel document containing the name of employees and their salary
details in the Microsoft excel and save that file as Emp.xls
• Open eclipse application give the folder name where you want to store your files. The
default workspace will be ‘ workspace ‘
• Then go to filenewjava project.
• You will get Create java project window, Name the project to st  click finish. Double
click on the new project st on the package explorer  you will get src folder and JRE
System Library
• Right click on the src foldergo to newclick on the class you will get new java
class window name the class as Emp  click finish.

• Type in the java code in that Emp.java file


• After writing this code if u get red lines under the selenium then include the selenium
server and selenium java driver jar file. The steps are:
• Right click on the st folder click on properties click on Java Build path then select
the tab librariesclick on Add External JARs browse for jxl-2.6.jar
• Click open  Click ok.
• Click on run in eclipse, the output will be displayed the console.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 36


SOFTWARE TESTING LAB MANUAL

import java.io.File;
import java.io.IOException;
import jxl.Cell;
import jxl.CellType;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class Emp
{
private String inputFile;
public void setInputFile(String inputFile)
{
this.inputFile = inputFile;
}
public void read() throws IOException
{
File inputWorkbook = new File(inputFile);
Workbook w;
boolean flag=false;
boolean flag2=false;
int count=0;
try
{
w = Workbook.getWorkbook(inputWorkbook);
Sheet sheet = w.getSheet(0);
for (int j = 0; j < sheet.getRows(); j++)
{
for (int i = 0; i < sheet.getColumns(); i++)
{
Cell cell = sheet.getCell(i, j);
if (cell.getType() == CellType.NUMBER)
{
if(Integer.parseInt(cell.getContents())>50000)
{
flag = true;

}
}

if (cell.getType() == CellType.NUMBER)
{
if(Integer.parseInt(cell.getContents())>30 && Integer.parseInt(cell.getContents())< 40)
{
flag2 = true;
if(flag == true && flag2==true)

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 37


SOFTWARE TESTING LAB MANUAL

{
count++;

}
break;
}
}
}
}
System.out.println("Total number of employees having salary greater than ₹ 50,000 and age between 30 to
40 years: " +count);
}
catch (BiffException e)
{
e.printStackTrace();
}
}
public static void main(String[ ] args) throws IOException
{
Emp test = new Emp();
test.setInputFile("C:/Users/RJSP/Desktop/Emp.xls");
test.read();
}
}

INPUT FILE : Located in “C:/Users/RJSP/Desktop/Emp.xls”

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 38


SOFTWARE TESTING LAB MANUAL

OUTPUT:

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 39


SOFTWARE TESTING LAB MANUAL

EXERCISE 09
9. Write and test a program to update 10 student records into table into Excel file.

• Write this java test code in eclipse. Since we are not using any Selenium object here no
need of selenium RC Server to run at the command prompt for this program.
• This program will create an Excel file Student.xls under the desktop.
• Since we are dealing with the excel, we need to add the external jar file jxl-2.6 in to the
java project.
• Download jxl-2.6 and Follow the same steps as we used to add selenium server and
selenium java driver to our java project.

Procedure:-
• Create the blank excel document in the Microsoft excel and save that file as Student.xls
• Open eclipse application give the folder name where you want to store your files. The
default will be ‘ workspace ‘
• Then go to filenewjava project.
• You will get Create java project window , Name the project to st  click finish. Double
click on the new project st on the package explorer  you will get src folder and JRE
System Library
• Right click on the src foldergo to newclick on the class you will get new java
class window name the class as Student click finish.

• Type in the java code in that Student.java file


• After writing this code if u get red lines under the selenium then include the selenium
server and selenium java driver jar file. The steps are:
• Right click on the st folder click on properties click on Java Build path then select
the tab librariesclick on Add External JARs browse for jxl-2.6.jar file Click
open Click ok.
• Click on run button in eclipse, the output will be displayed the console.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 40


SOFTWARE TESTING LAB MANUAL

import java.io.File;
import java.io.IOException;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
public class Stdrec
{
private String inputFile;
public void setOutputFile(String inputFile)
{
this.inputFile = inputFile;
}
public void write() throws IOException, WriteException
{
File file = new File(inputFile);
WritableWorkbook workbook = Workbook.createWorkbook(file);
workbook.createSheet("Report", 0);
WritableSheet excelSheet = workbook.getSheet(0);
createLabel(excelSheet);
createContent(excelSheet);
workbook.write();
workbook.close();
}

private void createLabel(WritableSheet sheet) throws WriteException


{
addCaption(sheet, 0, 0, "Name");
addCaption(sheet, 1, 0, "Subject 1");
addCaption(sheet, 2, 0, "Subject 2");
addCaption(sheet, 3, 0, "Subject 3");
}
private void createContent (WritableSheet sheet) throws WriteException, RowsExceededException
{
// Write a few number
for (int i = 1; i <10; i++)
{
// First column
addLabel(sheet, 0, i, "Student " + i);
// Second column
addNumber(sheet, 1, i, ((i*i)+10));
addNumber(sheet, 2, i, ((i*i)+6));

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 41


SOFTWARE TESTING LAB MANUAL

addNumber(sheet, 3, i, ((i*i)+8));
}
}
private void addCaption(WritableSheet sheet, int column, int row, String s) throws
RowsExceededException, WriteException
{
Label label;
label = new Label(column, row, s);
sheet.addCell(label);
}
private void addNumber(WritableSheet sheet, int column, int row,Integer integer) throws
WriteException, RowsExceededException
{
Number number;
number = new Number(column, row, integer);
sheet.addCell(number);
}
private void addLabel(WritableSheet sheet, int column, int row, String s) throws WriteException,
RowsExceededException
{
Label label;
label = new Label(column, row, s);
sheet.addCell(label);
}
public static void main(String[ ] args) throws WriteException, IOException {
Stdrec test = new Stdrec();
test.setOutputFile("C:/Users/RJSP/Desktop/Student.xls");
test.write();
System.out.println("Please check the result file under C:/Users/RJSP/Desktop/Student.xls");
}
}

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 42


SOFTWARE TESTING LAB MANUAL

OUTPUT:

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 43


SOFTWARE TESTING LAB MANUAL

EXERCISE 10
10.Write and test a program to select the number of students who have scored more
than 60 in any one subject (or all subjects).

Requirements :

• Write this java test code in eclipse. Since we are not using any Selenium object here no
need of selenium RC Server to run at the command prompt for this program.
• Since we are dealing with the excel, we need to add the external jar file jxl-2.6 in to the
java project.
• Download jxl-2.6 and Follow the same steps as we used to add selenium server and
selenium java driver to our java project.

Procedure:

• Create the excel document containing the details about the students and their marks in
the Microsoft excel and save that file as Student.xls
• Open eclipse application give the folder name where you want to store your files. the
default will be ‘ workspace ‘
• Then go to filenewjava project.
• You will get Create java project window , Name the project to st  click finish. Double
click on the new project st on the package explorer  you will get src folder and JRE
System Library
• Right click on the src foldergo to newclick on the class you will get new java
class window name the class as Student click finish.

• Type in the java code in that Student.java file


• After writing this code if u get red lines under the selenium then include the selenium
server and selenium java driver jar file. The steps are:
• Right click on the st folder  click on properties  click on Java Build path then
select the tab librariesclick on Add External JARs browse for
jxl-2.6.jar file Click open  Click ok.
• Click on run the run button in eclipse, output will be displayed the console.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 44


SOFTWARE TESTING LAB MANUAL

import java.io.File;
import java.io.IOException;
import jxl.Cell;
import jxl.CellType;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class student_excel_read
{
private String inputFile;
public void setInputFile(String inputFile)
{
this.inputFile = inputFile;
}
public void read() throws IOException
{
File inputWorkbook = new File(inputFile);
Workbook w;
boolean flag=false;
int count=0;
try
{
w = Workbook.getWorkbook(inputWorkbook);
Sheet sheet = w.getSheet(0);
for (int j = 0; j < sheet.getRows(); j++)
{
for (int i = 0; i < sheet.getColumns(); i++)
{
Cell cell = sheet.getCell(i, j);
if (cell.getType() == CellType.NUMBER)
{
if(Integer.parseInt(cell.getContents())>60)
{
flag = true;
if(flag == true)
{
count++;
flag=false;
} break;
}
}
}
}
System.out.println("Total number of students who scored more than 60 in one or
more subjects is: " +count);
}

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 45


SOFTWARE TESTING LAB MANUAL

catch (BiffException e)
{
e.printStackTrace();
}
}
public static void main(String[ ] args) throws IOException
{ student_excel_read test = new student_excel_read();
test.setInputFile("C:/Users/vmvin/Desktop/Student.xls");
test.read();
}
}

INPUT:

OUTPUT :

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 46


SOFTWARE TESTING LAB MANUAL

EXERCISE 11

11. Write and test a program to provide total number of objects present / available on
the page.

Requirements:

• Write this java test code in eclipse. before running this code makes sure your selenium
RC server is running
• Firefox version 10.0 required.
• Internet access required.

Procedure:-
• Write the Above code in eclipse by following the below steps
• Open eclipse application give the folder name where you want to store your files
the default will be ‘workspace ‘Then go to filenewjava project.
• You will get Create java project window Name the project to st click finish.
• Double click on the new project st on the package explorer you will get src folder and
JRE System Library
• Right click on the src foldergo to newclick on the class  you will get new java
class window name the class as Obj  click finish.
• After writing this code if u get red lines under the selenium then include the selenium
server and selenium java driver jar file. The steps are:
• Right click on the st folderclick on properties click on Java Build paththen select
the tab libraries click on Add External JARsbrowse for
selenium-serverstandalone-2.32.0Click open again click on Add External JARs
browse for selenium-java-clientdriver
• click open-> click ok->To run the above program
• First open the command prompt-> go to the C:\Program Files (x86)\java\jdk1.6.0_26\bin
folder run/write the command java –jar selenium-server-standalone-2.32.0.jar 4444
• The number of objects available on the web page will be displayed as output in the
console when you click run button in eclipse.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 47


SOFTWARE TESTING LAB MANUAL

import com.thoughtworks.selenium.*;
@SuppressWarnings("deprecation")
public class objectcount extends SeleneseTestCase
{
public void setUp() throws Exception {
setUp("http://www.wikipedia.org/","*firefox");
}
public void testloginlogout()
{
selenium.setSpeed("1000");
selenium.open("www.wikipedia.org/Gmail");
selenium.waitForPageToLoad("30000");
selenium.windowMaximize();
int num = selenium.getXpathCount("//p").intValue();
System.out.println("The number of option elements present are " +num);
}
}

OUTPUT:

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 48


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 49


SOFTWARE TESTING LAB MANUAL

EXERCISE 12
12. Write and test a program to get the number of list items in a list / combo box.

Requirements:

• Write this java test code in eclipse. before running this code makes sure your selenium
RC server is running)
• Write Combocount.html as shown below and save under desktop.

Procedure:-
• Type the html code in notepad and save that as combo.html
• Open eclipse application give the folder name where you want to store your files. The
default will be ‘ workspace ‘
• Then go to filenewjava project.
• You will get Create java project window , Name the project to st  click finish. Double
click on the new project st on the package explorer  you will get src folder and JRE
System Library
• right click on the src foldergo to newclick on the class you will get new java class
window name the class as Comboitemcount click finish.

• Type in the java code in that Comboitemcount.java file


• After writing this code if u get red lines under the selenium then include the selenium
server and selenium java driver jar file. The steps are:
• Right click on the st folder click on properties click on Java Build path then select
the tab librariesclick on Add External JARs browse for
selenium-serverstandalone-2.32.0click openagain click on Add External JARs
browse for selenium-java-clientdriverclick open click ok.
• To run the above program
• First open the command prompt go to the jdk1.6.0_26\bin folder run/write the
command java –jar selenium-server-standalone-2.32.0.jar 4444
• Click on run in eclipse, the output will be displayed the console.

<html>
<body>
<select>
<option>Volvo</option>
<option>Express</option>
<option>Mercedes</option>
<option>Lamborghini</option>
Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 50
SOFTWARE TESTING LAB MANUAL

</select>
</body>
</html>

• Write the below code in eclipse

import com.thoughtworks.selenium.*;
public class Comboitemcount extends SeleneseTestCase
{
public void setUp() throws Exception
{
selenium = new DefaultSelenium("localhost", 4444,
"*chrome","file:///C:/combocount.html");
selenium.start();
}
public void testloginlogout()
{
selenium.setSpeed("1000");
selenium.open("file:///C:/combo.html");
selenium.waitForPageToLoad("30000");
selenium.windowMaximize();
String[] selectelements = new String[1000];
selectelements= selenium.getSelectOptions("//select");
System.out.println("The number of options present in the given select box is "
+selectelements.length); }
}

OUTPUT:

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 51


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 52


SOFTWARE TESTING LAB MANUAL

EXERCISE 13
13. Write and test a program to count number of items present on a desktop.

Requirements:

• Write this java test code in eclipse. Since we are not using any Selenium object here no
need of selenium RC Server to run at the command prompt for this program.
• Write a visual basic script with the following code and save as count.vbs under the
desktop.
Procedure:-
• Type the visual basics code in the notepad and save that as count.vbs
• Write the Above code in eclipse by following the below steps
• Open eclipse application give the folder name where you want to store your files-the
default will be ‘workspace ‘Then go to filenewjava project.
• You will get Create java project window Name the project to st click finish.
• Double click on the new project st on the package explorer you will get src folder and
JRE System Library
• Right click on the src foldergo to newclick on the class  you will get new java
class window name the class as desktop_item_count click finish.
• Click on run button in eclipse, the output will be displayed in an alert box.

• Type the below code in notepad and save as count.vbs

Set fso = createobject("Scripting.FileSystemObject")


DesktopPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
'Files count
msgbox "The number of files on the desktop is : "&fso.GetFolder(DesktopPath).Files.Count
'Folders count msgbox "The number of folders on the desktop is : "&fso.GetFolder(DesktopPath)
.SubFolders.Count

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 53


SOFTWARE TESTING LAB MANUAL

• Write the below code in eclipse

import java.io.*;
public class desktop_item_count
{
public static void main(String[ ] args)
{
try
{
Runtime.getRuntime().exec("wscript C:/Users/vmvin/count.vbs");
}
catch (IOException e)
{
System.exit(0);
}
}
}

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 54


SOFTWARE TESTING LAB MANUAL

EXERCISE 14

14 Understanding the use of bug tracking and testing tool Bugzilla and Jira

How to log-in to Bugzilla

Step 1) Use the following link https://landfill.bugzilla.org/bugzilla-5.0-branch/ for your handons. To create
an account in Bugzilla or to login into the existing account go to New Account or Log in option in the
main menu.

Step 2) Now, enter your personal details to log into Bugzilla

1. User ID
2. Password
3. And then click on "Log in"

Step 3) You are successfully logged into Bugzilla system

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 55


SOFTWARE TESTING LAB MANUAL

Creating a Bug-report in Bugzilla

Step 1) To create a new bug in Bugzilla, visit the home-page of Bugzilla and click on NEW tab from the
main menu

Step 2) In the next window

1. Enter Product
2. Enter Component
3. Give Component description
4. Select version,
5. Select severity
6. Select Hardware
7. Select OS
8. Enter Summary
9. Enter Description
10. Attach Attachment
11. Submit

NOTE: The above fields will vary as per your customization of Bugzilla

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 56


SOFTWARE TESTING LAB MANUAL

NOTE: The mandatory fields are marked with *.

Step 4) Bug is created ID# 26320 is assigned to our Bug. You can also add additional information to the
assigned bug like URL, keywords, whiteboard, tags, etc. This extra-information is helpful to give more
detail about the Bug you have created.

1. Large text box


2. URL
3. Whiteboard
4. Keywords
5. Tags

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 57


SOFTWARE TESTING LAB MANUAL

6. Depends on
7. Blocks
8. Attachments

Step 5) In the same window if you scroll down further. You can select deadline date and also status of the
bug. Deadline in Bugzilla usually gives the time-limit to resolve the bug in given time frame.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 58


SOFTWARE TESTING LAB MANUAL

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 59


SOFTWARE TESTING LAB MANUAL

What is JIRA Issue?


JIRA issue would track bug or issue that underlies the project. Once you have imported project then you
can create issues.
Under Issues, you will find other useful features like

• Issue Types
• Workflow's
• Screens
• Fields
• Issue Attributes

VISIT THE LINK https://www.atlassian.com/software/jira AND CLICK ON FREE


TRIAL

Issue Types
Issue Type displays all types of items that can be created and tracked via JIRA. JIRA Issues are
classified under various forms like new feature, sub-task, bug, etc. as shown in the screen shot.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 60


SOFTWARE TESTING LAB MANUAL

There are two types of Issue types schemes in JIRA, one is

• Default Issue Type Scheme: In default issue type scheme all newly created issues will
be added automatically to this scheme
• Agile Scrum Issue Type Scheme: Issues and project associated with Agile Scrum will
use this scheme

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 61


SOFTWARE TESTING LAB MANUAL

Apart from these two issue type schemes, you can also add schemes manually as per
requirement, for example we have created IT & Support scheme, for these we will drag and
drop the issue types from the Available Issue type to Issue type for current scheme as
shown in the screen shot below

Statuses: Different statuses are used to indicate the progress of a project like To do,
InProgress, Open, Closed, ReOpened, and Resolved. Likewise, you have resolutions and
priorities, in resolution it again tells about the progress of issue like Fixed, Won't fix, Duplicate,
Incomplete, Cannot reproduce, Done also you can set the priorities of the issue whether an
issue is critical, major, minor, blocker and Trivial.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 62


SOFTWARE TESTING LAB MANUAL

How to create an issue in JIRA


JIRA Dashboard will open when you enter your user ID and password. Under JIRA dashboard
you will find option Project, when you click on it, it will open a window that list out options like
Simple Issue Tracking, Project Management, Agile Kanban, Jira Classic and so on as
shown in screen shot below.

When you click on option Simple Issue Tracking, another window will open, where you can
mention all the details about the issue and also assign the issue to the responsible person.

When you click on "Submit" button, a window will open where you can perform a list of work like
creating issues, assigning issues, check the status of issues like- resolved, In-Progress or closed
and so on.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 63


SOFTWARE TESTING LAB MANUAL

Once the issue is created a pop-up will appear on your screen saying your issue is created
successfully as shown in the screen shot below

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 64


SOFTWARE TESTING LAB MANUAL

EXERCISE 15
15 Open ended Experiment: Mini Project – Not for exam but to compulsory to be
included in Record. (Test cases for Hotel Booking)

The User Interface Screens are described in table 1.


Table 1: Hotel Management User Interface Screens

Screen Name Description


Login Log into the system as a CSR or Manager
Reservation Retrieve button, update/save reservation, cancel
reservation, modify reservation, change reservation,
adjust room rate, accept payment type/credit card
Check-in Modify room stay (e.g., new credit card), check-in
customer (with or without a reservation), adjust room
rate, special requests, accept payment type/credit card
Checkout Checkout customer, generate bill
Hotel Payment Accept payment for room and food
Room Create order, modify order, view order, cancel order,
Service/Restaurant generate meal bill
Customer Record Add or update customer records
Administer Rooms Availability and rates
Administer User Create, modify, and delete users; change password
Administer Meals Create, modify, and delete meal items and prices
Reports Select, view, save, and delete reports

Functional Requirements
Functional requirements define the fundamental actions that system must perform.
The functional requirements for the system are divided into three main categories,
Reservation/Booking, Food, and Management.

1. Reservation/Booking
1.1. The system shall record reservations.
1.2. The system shall record the customer’s first name.
1.3. The system shall record the customer’s last name.
1.4. The system shall record the number of occupants.
1.5. The system shall record the room number.
1.6. The system shall display the default room rate.
1.6.1. The system shall allow the default room rate to be changed.
1.6.2. The system shall require a comment to be entered, describing the reason
for changing the default room rate.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 65


SOFTWARE TESTING LAB MANUAL

1.7. The system shall record the customer’s phone number.


1.8. The system shall display whether or not the room is guaranteed.
1.9. The system shall generate a unique confirmation number for each reservation.
1.10. The system shall automatically cancel non-guaranteed reservations if the
customer has not provided their credit card number by 6:00 pm on the check-
in date.
1.11. The system shall record the expected check-in date and time.
1.12. The system shall record the expected checkout date and time.
1.13. The system shall check-in customers.
1.14. The system shall allow reservations to be modified without having to
reenter all the customer inforamtion.
1.15. The system shall checkout customers.
1.15.1. The system shall display the amount owed by the customer.
1.15.2. To retrieve customer information the last name or room number shall be
used
1.15.3. The system shall record that the room is empty.
1.15.4. The system shall record the payment.
1.15.5. The system shall record the payment type.
1.16. The system shall charge the customer for an extra night if they checkout
after 11:00 a.m.
1.17. The system shall mark guaranteed rooms as “must pay” after 6:00 pm
on the check-in date.
1.18. The system shall record customer feedback.
2. Food
2.1. The system shall track all meals purchased in the hotel (restaurant and room
service).
2.2. The system shall record payment and payment type for meals.
2.3. The system shall bill the current room if payment is not made at time of
service.
2.4. The system shall accept reservations for the restaurant and room service.
3. Management
3.1. The system shall display the hotel occupancy for a specified period of time
(days; including past, present, and future dates).
3.2. The system shall display projected occupancy for a period of time (days).
3.3. The system shall display room revenue for a specified period of time (days).
3.4. The system shall display food revenue for a specified period of time (days).
3.5. The system shall display an exception report, showing where default room
and food prices have been overridden.
3.6. The system shall allow for the addition of information, regarding rooms, rates,
menu items, prices, and user profiles.
3.7. The system shall allow for the deletion of information, regarding rooms, rates,
menu items, prices, and user profiles.

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 66


SOFTWARE TESTING LAB MANUAL

Nonfunctional Requirements
Functional requirements define the needs in terms of performance, logical database
requirements, design constraints, standards compliance, reliability, availability, security,
maintainability, and portability.

Performance Requirements
Performance requirements define acceptable response times for system functionality.
• The load time for user interface screens shall take no longer than two seconds.
• The log in information shall be verified within five seconds.
• Queries shall return results within five seconds.

Booking/Reservation System Testcase1(valid input) Testcase2(invalid input)


• Customer first name Abcd 1234
• Customer last name Xyz $&*^
• Customer address 7th cross, Kormangla -----bbjdsay--;
• Customer phone number 9191919090 asdf, 123654
• Number of occupants 2 , two safdsa
• Assigned room 501 ***
• Default room rate 500 rupees -45 rupees
• Rate description luxury room price [blank]
• Guaranteed room (yes/no) yes , no [blank]
• Credit card number 4545435235254325 fdsjafsa
• Confirmation number 51515 afsda
• Automatic cancellation date 3-4-2018 1-1-1947
• Expected check-in date 2-4-2018 32-2-2018
• Expected check-in time 1:30 PM 25:30 AM
• Actual check-in date 2-4-2018 0-0-2010
• Actual check-in time 1:30 PM 0:75 AM
• Expected check-out date 5-4-2018 33-4-2011
• Expected check-out time 3:00PM 4:89PM
• Actual check-out date 5-4-2018 33-4-2018
• Actual check-out time 2:00PM 4:99AM
• Payment received (yes/no) yes , no [blank]
• Payment type credit card , cash [blank]
• Total Bill 5600 rupees -566 rupees

Department of Computer Science and Engineering, RJS Polytechnic, Koramangala, Bengaluru 67

You might also like