You are on page 1of 43

SHRI VAISHNAV VIDYAPEETH VISHWAVIDHALAYA

Shri Vaishnav Institute of Information Technology


Department of Computer Science and Engineering

SESSION : 2022-23
PRACTICAL FILE
SOFTWARE TESTING AND QUALITY ASSURANCE
( BTDSE-512N )

III YEAR / V SEMESTER

SECTION : ‘K’ (CSE)

Submitted By: Submitted To:


Vipin Kushwah Mr. Kamal Borana
21100BTCSE10038 Assistant Professor
CSE
SOFTWARE TESTIN AND QUALITY ASSURANCE BTDSE512N

SHRI VAISHNAV VIDYAPEETH VISHWAVIDYALAYA


SHRI VAISHNAV INSTITUTE OF INFORMATION TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING

LAB CONTENTS
S. No. Experiment Page no. Date of Sign/
Experiment Remarks

1 Design test cases using Boundary value 3-6 07-08-2023


analysis by taking quadratic equation
problem.
2 Design test cases using Equivalence class 7-9 14-08-2023
partitioning taking triangle problem.

3 Design test cases using Decision table taking 10-12 21-08-2023


triangle problem.

4 Design independent paths by calculating 13-14 28-08-2023


cyclometer complexity using date problem.

5 Design independent paths by taking DD path 15-19 04-09-2023


using date problem.

6 Design the test cases for login page of 20-23 11-09-2023


AMIZONE

7 Manual Testing for PAN card verification. 24-26 18-09-2023

8 Generate test case for ATM machine. 27-28 25-09-2023

9 Overview of Testing process using Rational 29-33 09-10-2023


Robot.

10 Write a script to record verification point 34-40 30-10-2023


using Rational Robot (For GUI testing of
single click on window OS).
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 01 Design test cases using Boundary value analysis by taking quadratic
equation problem.

Boundary Value Analysis


Consider a program with two input variables x and y. These input variables have specified
boundaries as:

a≤x≤b
c≤y≤d

Fig: Input domain for program having two input variables

Consider a problem for the determination of the nature of the roots of a quadratic
equation where the inputs are 3 variables (a, b, c) and their values may be from the interval
[0, 100]. The output may be one of the following depending on the values of the variables:
 Not a quadratic equation,
 Real roots,
 Imaginary roots,
 Equal roots
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Solution
Quadratic equation will be of type:
ax2+bx+c=0
Roots are real if (b2-4ac)>0
Roots are imaginary if (b2-4ac)
Roots are equal if (b2-4ac)=0
Equation is not quadratic if a=0

Program
import java.util.*;

public class Quadratic {


public static void main(String[] args) {
// Create a list of coefficients
List<float[]> coefficients = new ArrayList<>();

// Create a list of roots


List<String> roots = new ArrayList<>();

// Get the coefficients from the user


Scanner sc = new Scanner(System.in);
System.out.println("Enter the value of all the coefficients 0 when you want to exit...");
System.out.println("Enter the coefficients: ");
while (true) {
float a, b, c;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();

// Check if the user wants to quit


if (a == 0 && b == 0 && c == 0) {
break;
}

// Add the coefficients to the list


coefficients.add(new float[]{a, b, c});
}

// Calculate the discriminants and roots for each equation


SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

for (float[] coefficient : coefficients) {


float d = coefficient[1] * coefficient[1] - 4 * coefficient[0] * coefficient[2];
roots.add(coefficient[0] > 0 ? d > 0 ? "Real" : d < 0 ? "Imaginary" : "Equal" :
"Invalid");
}

// Print the table


System.out.println(" ");
System.out.println("| a | b | c | Roots |");
System.out.println("| | | | |");
for (int i = 0; i < coefficients.size(); i++) {
float[] coefficient = coefficients.get(i);
System.out.printf("| %4.1f | %4.1f | %4.1f | %-8s |\n", coefficient[0],
coefficient[1], coefficient[2], roots.get(i));
}
System.out.println(" ");
}
}

OUTPUT:
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 02 Design test cases using Equivalence class partitioning taking triangle
problem.

Program
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Triangle


{
public static void main(String[] args) {

// Create a list of coefficients


List<float[]> side = new ArrayList<>();

// Create a list of roots


List<String> triangle = new ArrayList<>();

// Create a list of expected output


List<String> exp = new ArrayList<>();

// Get the coefficients from the user


Scanner sc = new Scanner(System.in);
System.out.println("Enter sides if you want to continue otherwise please enter 0 if you
want to exit...");
while (true) {
System.out.println("Enter the sides: ");
float a, b, c;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();

//Check if the user wants to quit


if (a == 0 && b == 0 && c == 0) {
break;
}

// Add the coefficients to the list


side.add(new float[]{a, b, c});

System.out.println("Enter expected triangle type:");


String expout;
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

expout = sc.next();

// Add the expected output to the list


exp.add(expout);
}

// Determine the triangle for each array of sides


for(float[] sides : side) {
if(((sides[0] + sides[1]) > sides[2]) && ((sides[1] + sides[2]) > sides[0]) &&
((sides[0] + sides[2]) > sides[1])) {
if (sides[0] == 0 || sides[1] == 0 || sides[2] == 0) {
triangle.add("Invalid");
} else if (sides[0] == sides[1] && sides[1] == sides[2]) {
triangle.add("Equilateral");
} else if (sides[0] == sides[1] || sides[1] == sides[2] || sides[0] == sides[2]) {
triangle.add("Isoceles ");
} else {
triangle.add("Scalene");
}
}
else {
triangle.add("Invalid");
}
}

// Print the table


System.out.println("
");
System.out.println("| a | b | c | Expected output | Actual output |
Result |");
System.out.println("| | | | | |
|");
for (int i = 0; i < side.size(); i++) {
float[] sides = side.get(i);
System.out.printf("| %4.1f | %4.1f | %4.1f | %-11s | %-11s | %-
4s |\n", sides[0], sides[1], sides[2], exp.get(i), triangle.get(i),(
exp.get(i).equals(triangle.get(i))) ? "PASS" : "FAIL");
}
System.out.println("
");
}
}
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Output
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 03 Design test cases using Decision table taking triangle problem.

Decision tables are used in various engineering fields to represent complex logical
relationships. This testing is a very effective tool in testing the software and its requirements
management. The output may be dependent on many input conditions and decision tables
give a tabular view of various combinations of input conditions and these conditions are in
the form of True(T) and False(F). Also, it provides a set of conditions and its corresponding
actions required in the testing.

Program
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Triangle


{
public static void main(String[] args) {

// Create a list of coefficients


List<float[]> side = new ArrayList<>();

// Create a list of roots


List<String> triangle = new ArrayList<>();

// Create a list of expected output


List<String> exp = new ArrayList<>();

// Get the coefficients from the user


Scanner sc = new Scanner(System.in);
System.out.println("Enter sides if you want to continue otherwise please enter 0 if you
want to exit...");
while (true) {
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

System.out.println("Enter the sides: ");


float a, b, c;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();

//Check if the user wants to quit


if (a == 0 && b == 0 && c == 0) {
break;
}

// Add the coefficients to the list


side.add(new float[]{a, b, c});

System.out.println("Enter expected triangle type:");


String expout;
expout = sc.next();

// Add the expected output to the list


exp.add(expout);
}

// Determine the triangle for each array of sides


for(float[] sides : side) {
if(((sides[0] + sides[1]) > sides[2]) && ((sides[1] + sides[2]) > sides[0]) &&
((sides[0] + sides[2]) > sides[1])) {
if (sides[0] == 0 || sides[1] == 0 || sides[2] == 0) {
triangle.add("Invalid");
} else if (sides[0] == sides[1] && sides[1] == sides[2]) {
triangle.add("Equilateral");
} else if (sides[0] == sides[1] || sides[1] == sides[2] || sides[0] == sides[2]) {
triangle.add("Isoceles ");
} else {
triangle.add("Scalene");
}
}
else {
triangle.add("Invalid");
}
}

// Print the table


System.out.println("
");
System.out.println("| a | b | c | Expected output | Actual output |
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Result |");
System.out.println("| | | | | |
|");
for (int i = 0; i < side.size(); i++) {
float[] sides = side.get(i);
System.out.printf("| %4.1f | %4.1f | %4.1f | %-11s | %-11s | %-
4s |\n", sides[0], sides[1], sides[2], exp.get(i), triangle.get(i),(
exp.get(i).equals(triangle.get(i))) ? "PASS" : "FAIL");
}
System.out.println("
");
}
}

Output
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 04 Design independent paths by calculating cyclometer complexity using date
problem..

Program
import java.util.Scanner;

public class DateProblem {


public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter date:");
String date = sc.next();
System.out.println("Is this date valid?");
System.out.println(isValidDate(date));
}
public static boolean isValidDate(String date) {
String[] parts = date.split("-");
int year = Integer.parseInt(parts[0]);
int month = Integer.parseInt(parts[1]);
int day = Integer.parseInt(parts[2]);

if (year < 1900 || year > 2100) {


return false;
}

if (month < 1 || month > 12) {


return false;
}

if (day < 1 || day > 31) {


return false;
}

if ((month == 2 || month == 4 || month == 6 || month == 9 || month == 11) && day > 30)
{
return false;
}

return true;
}
}
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Output
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 05 Design independent paths by taking DD path using date problem.

Software Required: Borland C/ Turbo C


Theory:
Every node on a flow graph of a program belongs to one DD-path. If the first node on aDD-
path is traversed, then all other nodes on that path will also be traversed. The DD path graphis
used to find independent path for testing. Every statement in the program has been executed
atleast once.

Problem Statement:
Give the present date in the form of a triplet of day, month and year. Tocheck whether the
date given is valid or invalid. If valid then the output is previous date

Program:
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int day,month,year,flag=0;
int prev_day, prev_month, prev_year;
Printf(“enter the date=dd-mm-yy”);
Printf(“\nenter the day:”);
Scanf(“%d”,&day);
Printf(“\nenter the month:”);
Scanf(“%d”,&month);
Printf(“\nenter the year:”);
Scanf(“%d”,&year);
if((day>=1 && day<=31) && (month==1 || month==3|| month==5||month==7|| month==8||
month==10 month==12||) && (year>=1))
{
Printf(“The date entered is valid”);
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

flag=1;
}
else if((day>=1 && day<=30) && (month==4|| month==6|| month==9||month==11) &&
(year>=1))
{
Printf(“The date entered is valid”);
flag=1;
}
else if((day>=1 && day<=29) && (month=2) && (year>=1) && ((year%100==0
&&year%400==0) || (year>=1) && (year%100!==0 && year%4==0)))
{
Printf(“The date entered is valid”);
flag=1;
}
else if((day>=1 && day<=28) && (month==2) && (year>=1))
{
Printf(“The date entered is valid”);
flag=1;
}
Else
{
Printf(“\n The date is invalid”);
}
if(flag==1)
{
if(day>=2)
{
prev_day = -prev_day;
printf(“\nThe previous date is:%d%d%d”,&prev_day,&month,&year);
}
else if(day==1)
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

{
if(month==1)
{
prev_day = 31;
prev_month = 12;
prev_year= -year;
printf(“\nTheprevious date is:%d%d%d”,&prev_day,&month,&year);
}
if(month==5||month==7|| month==10||month==12)
{
prev_day = 31;
prev_month = -month;
printf(“\nThe previous date is:%d%d%d”,&prev_day,&month,&year);
}
Else if(month==2|| month==4|| month==6||month==8|| month==9|| month==11)
{
prev_day = 31;
prev_month = -month;
printf(“\nTheprevious date is:%d%d%d”,&prev_day,&month,&year);
elseif(month==3)
{
if((year%100==0 && year%400==0) || (year>=1) && (year%100!==0&& year%4==0))
{
prev_day = 29;
prev_month = -month;
printf(“\nThe previous date is:%d%d%d”,&prev_day,&month,&year);
}
Else
{
prev_day = 28;
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

prev_month = -month;

printf(“\nThe previous dateis:%d%d%d”,&prev_day,&month,&year);


}
}
}
}
getch();

Flow Table:
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 06 Design the test cases for login page of AMIZONE.

Software used:
 Manual testing

Procedure:
 HOME PAGE:

 test URL :https://www.amizone.net


 Preconditions: Open Web browser and enter the given url in the address bar. Home
page must be displayed. All test cases must be executed from this page.

Observations/ discussions/ output:


Test Test case test case test steps test test test defect
case id name desc case status priority severity
status (P/F)
Step Expected Actual
Login01 Validate To verify enter login name less than 3 an error design high
Login that Login chars (say a) and password message
name on and click Submit button “Login not
login page less than 3-
must be character s”
greater must
than 3 be
characters displayed
enter login name less than 3 an error design high
chars (say ab) and password message
and click Submit button “Login not
less than 3-
character s”
must be
displayed
enter login name 3 chars Login design high
(say abc) and password and success full
click Submit button or an error
message
“Invalid
Login or
Password”
must
be
displayed
Login02 Validate To verify enter login name greater an error design high
Login that Login than 10 chars (say message
name on abcdefghijk) andpassword “Login not
login page and click Submit button greater
should not than 10
be greater characters”
than 10 must be
characters displayed
enter login name less than Login design high
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

10 chars (say abcdef) and success full


password and click Submit or an error
button message
“Invalid
Login or
Password”
must be
displayed
Login03 Validate To verify enter login name starting an error design high
Login that Login with special chars (! hello) message
name on password and click Submit “Special
login page button chars not
does not allowed in
take login” must
special be
characters displayed
enter login name ending an error design high
with special chars (hello$) message
password and click Submit “Special
button chars not
allowed in
login” must
be
displayed
enter login name with an error design high
special chars in message
middle (he&^ llo) password “Special
and click Submit button chars not
allowed in
login” must
be
displayed
Pwd01 Validate To verify enter Password less than 6 an error design high
Password that chars (say a) and Login message
Password Name and click Submit “Passwor d
on login button not less
page must than 6
be greater character s”
than 6 must
characters be
displayed
enter Password 6 chars (say Login design high
abcdef) and Login Name success full
and click Submit button or an error
message
“Invalid
Login or
Password”
must be
displayed
Pwd02 Validate To verify enter Password greater than an error design high
Password that 10 chars (say a) and Login message
Password Name and click Submit “Password
on login button not greater
page must than 10-
be less characters”
than 10 must be
characters displayed
enter Password less than 10 Login design high
chars (say abcdefghi) and success full
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Login Name and click or an error


Submit button message
“Invalid
Login or
Password”
must
be
displayed
Pwd03 Validate To verify enter Password with special Login design high
Password that characters (s ay !@hi&*P) success full
Password Login Name and click or an error
on login Submit button message
page must “Invalid
be allow Login or
special Password”
characters must be
displayed
Llnk01 Verify To Verify Click Home Link Home Page design low
Hyperlinks the Hyper must be
Links displayed
available Click Sign Up Link Sign design low
at left side Uppage
on login must
page bedisplayed
working Click New Users Link New Users design low
or not Registration
Formmust
be
displayed
Click Advertise Link Page with design low
Informati
on and
Tariff Plan
for
Advertise rs
must be
displayed
Click Contact Us Link Contact design low
Informati
on page
must be
displayed
Click Terms Link Terms Of design low
the service
page
must be
displayed
Flnk01 Verify To Verify Click Home Link Home Page design low
Hyper the Hyper must be
links Links displayed
displayed Click Sign Up Link Contact design low
at Footer Informati
on login on page
page must be
working displayed
or not ClickContact UsLink Page with design low
Informati
on and
Tariff Plan
for
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Advertise rs
must
be
displayed
Click Advertise Link Terms Of design low
the service
page
must be
displayed
Click Terms Of Privacy design low
Membership Link Policy page
must be
displayed
Click Privacy Policy Link Privacy design low
Policy page
must be
displayed
Lblnk01 Verify To Verify Click NEW USERS Link New Users design low
Hyper the Hyper located in login box Registrati
links Links on Form
displayed must be
at Login displayed
Box on
login page
working
or not
Click New Users(Blue New Users design low
Color) Link located in login Registrati
box on Form
must be
displayed
ClickForgetPasswordLink Passwor d design medium
locatedinloginbox Retrieval
Page
must be
displayed

Conclusions:
Test cases have been formulated.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 07 Manual Testing for PAN card verification.

Given string str of alphanumeric characters, the task is to check whether the string is a
valid PAN (Permanent Account Number) Card number or not by using Regular
Expression.
The valid PAN Card number must satisfy the following conditions:
1. It should be ten characters long.
2. The first five characters should be any upper case alphabets.
3. The next four-characters should be any number from 0 to 9.
4. The last(tenth) character should be any upper case alphabet.
5. It should not contain any white spaces.
Examples:
Input: str = “BNZAA2318J”
Output: true
Explanation:
The given string satisfies all the above mentioned conditions.
Input: str = “23ZAABN18J”
Output: false
Explanation:
The given string not starts with upper case alphabets, therefore it is not a valid PAN Card
number.
Input: str = “BNZAA2318JM”
Output: false
Explanation:
The given string contains eleven characters, therefore it is not a valid PAN Card number.
Input: str = “BNZAA23184”
Output: true
Explanation:
The last(tenth) character of this string is a numeric(0-9) character, therefore it is not a valid
PAN Card number.
Input: str = “BNZAA 23184”
Output: true
Explanation:
The given string contains white spaces, therefore it is not a valid PAN Card number.
Approach: This problem can be solved by using Regular Expression.
 Get the string.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

 Create a regular expression to validate the PAN Card number as mentioned below:
regex = "[A-Z]{5}[0-9]{4}[A-Z]{1}";
 Where:
 [A-Z]{5} represents the first five upper case alphabets which can be A to Z.
 [0-9]{4} represents the four numbers which can be 0-9.
 [A-Z]{1} represents the one upper case alphabet which can be A to Z.
 Match the given string with the regex, in Java, this can be done
using Pattern.matcher().
 Return true if the string matches with the given regex, else return false.

Program :
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PANcardVerification


{
public static void main(String[] args) {
List<String> PAN = new ArrayList<>();
List<String> exp = new ArrayList<>();
List<String> actual = new ArrayList<>();

Scanner sc = new Scanner(System.in);


while(true)
{
System.out.println("Enter PAN card number : ");
String str = sc.next();
if(str.equals("000"))
{
break;
}
PAN.add(str);

System.out.println("Enter expected validity:");


String expout;
expout = sc.next();

// Add the expected output to the list


exp.add(expout);

String ans = String.valueOf(isValidPanCardNumber(str));


actual.add(ans);
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

}
// Print the table
System.out.println(" ");
System.out.println("| PAN | Expected output | Actual output | Result |");
System.out.println("| | | | |");
for (int i = 0; i < PAN.size(); i++) {
System.out.printf("| %13s | %-5s | %-5s | %-4s |\n",PAN.get(i),
exp.get(i), actual.get(i), (exp.get(i).equals(actual.get(i))) ? "PASS" : "FAIL");
}
System.out.println(" ");
}
static boolean isValidPanCardNumber(String str){
String regex = "[A-Z]{5}[0-9]{4}[A-Z]{1}";
Pattern p = Pattern.compile(regex);
if(str == null)
{
return false;
}
Matcher m = p.matcher(str);
return m.matches();
}
}

Output:
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 08 Generate test case for ATM machine.

Software used:
 Manual testing

Procedure:
 An ATM card is swapped and checked for errors.

Observations/ discussions/ output:


TestCa Name Description ExpectedResult Priority
se
1) Cardswappin a) Cardrejecte 1) Withdrawcard/invalidcard 1) Low
g d 2) Enteryour PIN 2) High
b) Cardaccept
ed
2) EnterPIN a) InvalidPIN 1) a)Tryagain 1) Low
b)After3attempts,card
getsblocked
b) ValidPIN 2) Bankingoptions 2) High
3) Balanceenqu a)Savingacco 1)MinRs.10,000/- 1) High
iry unt 2)MinRs.1000/- 2) High
b) Currentacc
ount
4) Cashwithdra a) Enteramoun 1) a)Cashnotavail 1) Low
wl t ableb)Cashava
ilable
2) a)High
2) a)Enteramountinmulti
b) Incorrectam pleof100's. b)Low
ount b)Tryagain
5) Statementrec a) Ministatem Listing 1) High
eipt ent Yes 2) a)High
b) Wantarecei No b) Low
pt

6) PINchange a) Entercurren a) Invalid 1)a)Low


tPIN b)Valid b)High
1) EnternewPIN 2) High
b) If valid
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Con
7) tinu a) Yes 1) Entertheoptions 1) High
e b) No 2) Exit 2) High
tran
sact
ion

Conclusions:
Test cases have been formulated and ATM card has been tested.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 09 Overview of Testing process using Rational Robot.

THEORY:
Rational Robot is a complete set of components for automating the testing of Microsoft
Windowsclient/server and Internet applications running under Windows NT 4.0, Windows
XP, Windows 2000, Windows 98, and Windows Me. The main component of Robot lets you
start recording tests in as few as two mouse clicks. After recording, Robot plays back the tests
in a fraction of the time it wouldtake to repeat the actions manually. Other components of
Robot are:
 Rational Administrator – Use to create and manage Rational projects, which store your
testing information.
 Rational TestManager Log – Use to review and analyze test results.
 Object Properties, Text, Grid, and Image Comparators – Use to view and analyze
the results of verification point playback.
 Rational SiteCheck – Use to manage Internet and intranet Web sites.

We use the Rational Administrator to create and manage projects.


Rational projects store application testing information, such as scripts, verification
points, queries, and defects. Each project consists of a database and several directories of
files. All Rational Test components on your computer update and retrieve data from the same
active project.
Projects help you organize your testing information and resources for easy tracking.
Projects are created in the Rational Administrator, usually by someone with administrator
privileges.

Steps required to work on Rational Robot:


 Step 1: Click on Start •> Rational Software •> Rational Administrator
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Step 2: On Admin Window right click on Project and enter Project name and Location.

Step 3: Keep Password Blank and click on next•>finish

Step 4: On a new Configuration Project Window under Test Assets click on Create
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Step 5: Select the Microsoft Access as the Database and click on next •> finish
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Step 6: In the Rational Administrator window click on Rational Robot Icon that is 10th from
right.

Step 7: After giving the name a GUI Record Window is displayed as follows

Step 8: You may now perform any function on the operating system and this GUI will record
each and every event that occurs.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Step 9: Stop the recording and click on third icon named Specify Log Information and make
build file giving your testing name and a new window will open containing log information
specifying whether it is pass or fail.

Conclusion:
We understood all the steps needed to work on Rational Robot.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 10 Write a script to record verification point using Rational Robot (For GUI
testing of single click on window OS).

THEORY:
When you record a GUI script, Robot records:
 Your actions as you use the application-under-test. These user actions include
keystrokes and mouse clicks that help you navigate through the application.
 Verification points that you insert to capture and save information about specific
objects. A verification point is a point in a script that you create to confirm the state of
an object across builds. During recording, the verification point captures object
information and stores it as the baseline. During playback, the verification point
recaptures the object information and compares it to the baseline.
The recorded GUI script establishes the baseline of expected behavior for the application-
under-test. When new builds of the application become available, you can play back the
script to test the builds against the established baseline in a fraction of the time that it would
take to perform the testing manually.
You should plan to use Robot at the earliest stages of the application development and
testing process. If any Windows GUI objects such as menus and dialog boxes exist within the
initial builds of your application, you can use Robot to record the corresponding verification
points.
Set up test environment Set recording options Perform user actions
Start recording End recording GUI Script Recording Workflow Create verification
points Before You Begin Recording
Consider the following guidelines before you begin recording:
 Establish predictable start and end states for your scripts.
 Set up your test environment.
 Create modular scripts.
 Create Shared Projects with UNC.
Rather than defining a long sequence of actions in one GUI script, you should define
scripts that are short and modular. Keep your scripts focused on a specific area of testing —
for example, on one dialog box or on a related set of recurring actions. When you need more
comprehensive testing, modular scripts can easily be called from or copied into other scripts.
They can also be grouped into shell scripts, which are top-level, ordered groups of scripts.
The benefits of modular scripts are:

 They can be called, copied, or combined into shell scripts.


 They can be easily modified or rerecorded if the developers make intentional
 Changes to the application-under-test.
 They are easier to debug.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Steps:
1) File>New>Script.
2) Name : Login1, Description=Log in to the Classics Online Application
3) Press Ok
4) In Rational robot main Window. Place cursor at the beginning of blank line after start
application command
5) Record>Insert at cursor
6) On GUI Record toolbar click Display GUI Insert Toolbar
7) click write to Log
Message=Verify the initial state of classics online application Description=The next
VP will verify initial state of classics Online. Result option=None
Ok
8) On GUI Record Toolbar click display GUI Insert Toolbar Click windows Existence
Name=Login1 Ok
Click Select
Drag Object Finder pointer to Classics Login Dialog Box and release the mouse Ok
9) In classics Login dialog box,click ok
10) On GUI Record toolbar, click Stop Recording button.
11) Exit Classics Online.
12) Playback the script file>Playback(Select Login1>ok,Accept default log info.)
13) Look at the results.
We can do testing with our manual script file script1. Click on insert-verification point- 13
options are available like Alphanumeric, Object, Menu, Object properties etc.

14. if we want to test object properties, select it


SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Click ok.

Object finder tool will available. Click on tool (hand icon) and drag on the object or button
where you want to test the properties of classic online script file.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Suppose I leave it on order it button. Click ok. Then its properties will detect.

All properties are identified and display.


SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

We can do modifications in the properties. After that click ok. It will come to normal windoe.

Now we have to run both of the script file. Click on playback script icon, that is displayed on
standard toolbar.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

A playback window will open. Where we have to choose our script1 file.

Click ok
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Click ok
12 result will display

Result as test pass or fail will be displayed.


SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Ex. No. – 11 Write a script to record verification point for Clip Board and alphanumeric
values using Rational Robot

THEORY:
A verification point is a point in a script that you create to confirm the state of an object
across builds of the application-under-test.
During recording, a verification point captures object information and stores it in a
baseline data file. The information in this file becomes the baseline of the expected state of
the object during subsequentbuilds.

Creating Verification Points in GUI Scripts


When you play back the script against a new build, Rational Robot retrieves the information
in the baseline file for each verification point and compares it to the state of the object in the
new build. If the captured object does not match the baseline, Robot creates an actual data
file. The information in this file shows theactual state of the object in the build. After
playback, the results of each verification point appear in the TestManager log. If a
verification point fails (the baseline and actual data do not match), you can select the
verification point in the log and click View > Verification Point to open the appropriate
Comparator. The Comparator displays the baseline and actual files so that you can compare
them.

Alphanumeric
Captures and tests alphanumeric data in Windows objects that contain text, such as edit
boxes, check boxes, group boxes, labels, push buttons, radio buttons, toolbars, and windows
(captions). You can use the verification point to verify that text has not changed, to catch
spelling errors, and to ensure that numeric values are accurate.

Clipboard
Captures and compares alphanumeric data that has been copied to the Clipboard. To use this
verification point, the application must supply a Copy or Cut capability so that you can place
the data on the Clipboard. This verification point is useful for capturing data from
spreadsheet and word processing applications as well as terminal emulators.
SOFTWARE TESTING AND QUALITY ASSURANCE BTDSE512N

Testing the CLIPBOARD option:

Testing the ALPHANUMERIC option

Conclusion:
We checked the script and got the results in terms of pass/fail.

You might also like