Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Stqa File

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 38

SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

ShriVaishnavVidhyapeethVishwavidyalaya
Shri Vaishnav Institute of Information Technology

DepartmentofComputer ScienceEngineering

LABFILE

SUBJECT:SOFTWARE TESTING AND QUALITY ASSURANCE

CODE:BTDSE512N

III-year/V-Semester–Section(C)

Submitted by: Submitted to:

Name: Nandani Jiwnani Prof. Shuchi Mandhanya

Enrollmentno: 21100BTCSE09899

Ishita siddhwani PAGE NO. 1


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

CONTENTS
S. No. Experiment Page no. Remarks

1 Design test cases using Boundary value analysis 3


by taking quadratic equation problem.

2 Design test cases using Equivalence class 7


partitioning taking triangle problem.

3 Design test cases using Decision table taking 10


triangle problem.

4 Design independent paths by calculating 13


cyclometer complexity using date problem.

5 Design independent paths by taking DD path using 15


date problem.

6 Design the test cases for login page of AMIZONE 20

7 Manual Testing for PAN card verification. 24

8 Generate test case for ATM machine. 27

9 Overview of Testing process using Rational Robot. 29

10 Write a script to record verification point using 34


Rational Robot (For GUI testing of single click on
window OS).

Ishita siddhwani PAGE NO. 2


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-1
AIM: Design test cases using boundary value analysis by taking quadratic equation problem

SOFTWARE REQUIRED: IntelliJ idea Environment

PROCEDURE: Write a program for the determination of the nature of roots of a quadratic equation. Its
input is a triple of positive integers and value may be from interval [0,200]. The program output will be:

 Not a quadratic Equation


 Real Roots
 Imaginary roots
 Equal roots

CODE:

import java.lang.*;
import java.util.*;
public class Experiment_1
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the value of a, b, c: \t");
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();

if (a < 0 || b < 0 || c < 0 || a > 200 || b > 200 || c > 200) {


System.out.println("Invalid inputs");
} else {
if (a == 0) {
System.out.println("Not a quadratic equation");
} else {
double d = (b * b) - (4 * a * c);
double root1 = (-b + Math.sqrt(d)) / (2 * a);
double root2 = (-b - Math.sqrt(d)) / (2 * a);

if (d > 0) {
System.out.println("Roots are real and distinct");
System.out.println("First root is: " + root1);
System.out.println("Second root is: " + root2);
} else if (d < 0) {
System.out.println("Roots are imaginary");
} else {
System.out.println("Roots are same");
System.out.println("First root is: " + root1);
System.out.println("Second root is: " + root2);}
}
}
}
}

Ishita siddhwani PAGE NO. 3


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

TEST CASES:

s.n a b c Expected output Actual output Error


o
1 0 100 100 Not a quadratic equation Nota a quadratic equation

2 1 100 100 Real roots Real roots [-1.01, -98.9]

3 100 100 100 Imaginary roots Imaginary roots

4 100 200 100 Equal roots Equal roots [-1.0, -1.0]

5 100 100 0 Real roots Real roots [0, -1.0]

6 100 100 200 Imaginary roots Imaginary roots

OUTPUT:

Ishita siddhwani PAGE NO. 4


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-2

AIM: Design test cases using equivalence class partitioning taking triangle problem

SOFTWARE REQUIRED: IntelliJ idea

PROCEDURE: A triangle can be classified based on the lengths of its sides into three main types:

 Scalene triangle: All sides have different lengths


 Isosceles triangle: two sides have equal length, and third side has different length
 Equilateral triangle: All the three sides have same length

CODE:

import java.util.Scanner;
public class Experiment_2
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the three sides of the triangle: \t");
double x = sc.nextDouble();
double y = sc.nextDouble();
double z = sc.nextDouble();

if (x <= 0 || y <= 0 || z <= 0)


{
System.out.println("Invalid inputs");
} else
{
if (x == y && y == z)
System.out.println("Equilateral triangle");
else if (x == y && y != z || y == z && z != x || x == z && x != y)
System.out.println("Isosceles triangle");
else if (x != y && y != z && x != z)
System.out.println("Scalene triangle");
}
}
}

TEST CASES:

s.no Side-1 Side-2 Side-3 Expected o/p Actual o/p Error

1 10 10 10 Equilateral triangle Equilateral triangle -


2 10 10 20 Isosceles triangle Isosceles triangle
3 20 10 20 Isosceles triangle Isosceles triangle
4 10 20 20 Isosceles triangle Isosceles triangle
5 10 20 30 Scalene triangle Scalene triangle
6 0 10 -5 Invalid input Invalid input

Ishita siddhwani PAGE NO. 5


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

OUTPUT:

Ishita siddhwani PAGE NO. 6


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-3

AIM: Design test cases using Decision table taking triangle problem

SOFTWARE REQUIRED: IntelliJ idea

PROCEDURE:A decision table is a good way to deal with different combination inputs with their associated
outputs and also called cause-effect table. The reason to call cause-effect table is an associated logical diagramming
technique called cause-effect graphing that is basically use to derive the decision table. Decision table testing is a
black box test design technique to determine the test scenarios for complex business logic.

CODE:

import java.util.Scanner;
public class Experiment_3
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the three sides of the triangle: \t");
double x = sc.nextDouble();
double y = sc.nextDouble();
double z = sc.nextDouble();
if ((x + y) < z)
{
System.out.println("Not a triangle");
}
else if (x <= 0 || y <= 0 || z <= 0 || x > 199 || y > 199 || z > 199)
{
System.out.println("Impossible");
}
else
{
if (x == y && y == z)
System.out.println("Equilateral triangle");
else if (x == y && y != z || y == z && z != x || x == z && x != y)
System.out.println("Isosceles triangle");
else if (x != y && y != z && x != z)
System.out.println("Scalene triangle");
}
}
}

Ishita siddhwani PAGE NO. 7


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

Decision Table:

Condition c1: a, b, c are sides of a triangle?


Condition c2: a = b?
Condition c3: a = c?
Condition c4: b = c?
Action a1: impossible
Action a2: equilateral triangle
Action a3: isosceles triangle
Action a4: scalene triangle
Action a5: not a triangle

TEST CASES:

s.no Side-1 Side-2 Side-3 Expected output Actual output Error

1 0 20 30 Not a triangle Not a triangle -


2 50 50 50 Equilateral triangle Equilateral triangle -
3 200 1 200 Impossible Impossible -
4 201 1 45 Impossible Impossible -
5 50 45 50 Isosceles Isosceles -
6 20 220 50 Impossible Impossible -
7 20 25 20 Isosceles Isosceles -
8 20 25 25 Isosceles Isosceles -
9 20 18 19 scalene Scalene -

Ishita siddhwani PAGE NO. 8


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

OUTPUT:

Ishita siddhwani PAGE NO. 9


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-4

AIM: Design independent paths by calculating cyclometer complexity using date problem

SOFTWARE REQUIRED: IntelliJ Idea

PROCEDURE: Cyclomatic complexity is a software metric used to indicate the complexity of a program. It
is a quantitative measure of the number of linearly independent paths through a program's source code. It
gives the maximum number of independent paths in a program. Two alternate methods are available for the
complexity calculations:

1. McCabe's cyclomatic metric V(G) = e - n + 2P


where,
e: number of edges
n: number of nodes
P: number of connected components

2. Cyclomatic Complexity V(G) of a flow graph is equal to the number of predicate (decision) nodes plus
one.
V(G) = pi + 1
where,
pi is the number of predicate nodes contained in the flow graph.

CODE:

import java.util.Scanner;
public class Experiment_4 {

public static boolean isLeap(int year) {


if ((year % 100 == 0) && (year % 400 == 0) || (year % 4 == 0))
return true;
else
return false;
}

public static int countDigit(int n) {


int count = 0;
while (n != 0) {
count++;
n = n / 10;
}
return count;
}
public static void main(String[] args) {

int date;
int month;
int year;
int dayCount = 0;

Ishita siddhwani PAGE NO. 10


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

int dayNumber = 0;
int dayMonth = 0;

Scanner sc = new Scanner(System.in);

System.out.print("Enter the date: \t");


date = sc.nextInt();
if (date < 1 || date > 31)
System.out.println("Invalid date"); return;

System.out.print("Enter the month: \t");


month = sc.nextInt();
if (month < 1 || month > 12)
System.out.println("Invalid month"); return;

System.out.print("Enter the year: \t");


year = sc.nextInt();

if (countDigit(year) != 4)
System.out.println("Invalid year"); return;

System.out.println("Entered Date is: " + date + "/" + month + "/" + year);

if (isLeap(year)) {
switch (month) {
case 1: dayMonth = 0; break;
case 2: dayMonth = 31; break;
case 3: dayMonth = 60; break;
case 4: dayMonth = 91; break;
case 5: dayMonth = 121; break;
case 6: dayMonth = 152; break;
case 7: dayMonth = 182; break;
case 8: dayMonth = 213; break;
case 9: dayMonth = 244; break;
case 10: dayMonth = 274; break;
case 11: dayMonth = 305; break;
case 12: dayMonth = 335; break;
}
} else {
switch (month) {
case 1: dayMonth = 0; break;
case 2: dayMonth = 31; break;
case 3: dayMonth = 59; break;
case 4: dayMonth = 90; break;
case 5: dayMonth = 120; break;
case 6: dayMonth = 151; break;
case 7: dayMonth = 181; break;
case 8: dayMonth = 212; break;
case 9: dayMonth = 243; break;
case 10: dayMonth = 273; break;
case 11: dayMonth = 304; break;
case 12: dayMonth = 334; break;

Ishita siddhwani PAGE NO. 11


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

}
}

dayCount = dayMonth + date;


dayNumber = dayCount % 7;

System.out.println("Date falls on: " + dayCount);


switch (dayNumber) {
case 0: System.out.println("Day: Saturday"); break;
case 1: System.out.println("Day: Sunday"); break;
case 2: System.out.println("Day: Monday"); break;
case 3: System.out.println("Day: Tuesday"); break;
case 4: System.out.println("Day: Wednesday"); break;
case 5: System.out.println("Day: Thursday"); break;
case 6: System.out.println("Day: Friday"); break;
}
}
}

TEST CASES:

S.NO Date Month year Expected output Actual output

1 1 1 2023 1, Sunday 1, Sunday


2 2 3 1999 61, Thursday 61, Thursday
3 3 6 2000 155, Sunday 155, Sunday
4 9 11 19999 Invalid year Invalid year
5 5 13 2020 Invalid month Invalid month
6 32 1 2023 Invalid date Invalid date

Ishita siddhwani PAGE NO. 12


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

OUTPUT:

Ishita siddhwani PAGE NO. 13


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-5

AIM: Design Independent path by taking DD path using date problem

SOFTWARE REQUIRED: IntelliJ idea

PROCEDURE: Give the present date in the form of a triplet of day, month and year. To check whether the date
given is valid or invalid. If valid then the output Is previous date.

CODE:

import java.util.Scanner;
public class Experiment_5 {

public static boolean isLeap(int year) {


if ((year % 100 == 0) && (year % 400 == 0) || (year % 4 == 0)) {
return true;
} else {
return false;
}
}

public static void main(String[] args) {


int date;
int month;
int year;
int pDate = 0;
int pMonth = 0;
int pYear = 0;
boolean check = false;

Scanner sc = new Scanner(System.in);


System.out.print("Enter the date: \t");
date = sc.nextInt();
System.out.print("Enter the month: \t");
month = sc.nextInt();
System.out.print("Enter the year: \t");
year = sc.nextInt();

if ((date >= 1 && date <= 31) &&


(month == 1 || month == 3 || month == 5 ||
month == 7 || month == 8 || month == 10 ||
month == 12) &&
(year >= 1 && year <= 9999)) {
check = true;
} else if ((date >= 1 && date <= 30) &&
(month == 4 || month == 6 || month == 9 || month == 11) &&

Ishita siddhwani PAGE NO. 14


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

(year >= 1 && year <= 9999)) {


check = true;
} else if ((date >= 1 && date <= 29) &&
isLeap(year) &&
(month == 2) &&
(year >= 1 && year <= 9999)) {
check = true;
} else if ((date >= 1 && date <= 28) &&
!isLeap(year) &&
(month == 2) &&
(year >= 1 && year <= 9999)) {
check = true;
} else {
check = false;
}

System.out.println("Entered Date is: " + date + "/" + month + "/" + year);


if (check) {
if (date == 1 && (month == 1 || month == 2 || month == 4 || month == 6 || month == 8 || month == 9
|| month == 11)) {
pDate = 31;
if (month == 1) {
pYear = year - 1;
pMonth = 12;
} else {
pYear = year;
pMonth = month - 1;
}
} else if ((date > 1 && date <= 31) && (month >= 1 && month <= 12)) {
pDate = date - 1;
pMonth = month;
pYear = year;
} else if (date == 1 && (month == 12 || month != 3 || month == 5 || month == 7 || month == 10)) {
pDate = 30;
pMonth = month - 1;
} else if (date == 1 && month == 3 && isLeap(year)) {
pDate = 29;
pMonth = 2;
pYear = year;
} else if (date == 1 && month == 3 && !isLeap(year)) {
pDate = 28;
pMonth = 2;
pYear = year;
}
System.out.println("Previous date: " + pDate + "/" + pMonth + "/" + pYear);
} else {
System.out.println("Invalid date");
}
}
}

Ishita siddhwani PAGE NO. 15


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

TEST CASES:

s.no date month year Expected o/p Actual o/p

1 1 1 2023 31/12/2022 31/12/2022


2 29 2 2023 Invalid date Invalid date
3 0 1 1999 Invalid date Invalid date
4 5 18 2020 Invalid date Invalid date
5 98 16 19999 Invalid date Invalid date
6 1 3 2020 29/2/2020 29/2/2020
7 1 3 2019 28/2/2019 28/2/2019

OUTPUT:

Ishita siddhwani PAGE NO. 16


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

Ishita siddhwani PAGE NO. 17


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-6

AIM: Design the test cases for the login page for AMIZONE

SOFTWARE REQUIRED: IntelliJ Idea

TEST URL: www.amizone.net

PROCEDURE: Open the web browser and paste the given url in the address bar. Home page must be
displayed.

All test cases must be executed from this page.

Test Test test test steps test test test defect


case case case case statu priorit severit
id name desc statu s y y
s (P/F)
Step Expected Actua
l
Login0 Validate To verify enter login name less an error desig high
1 Login that than 3 chars (say a) and message n
Login password and click “Login not
name on Submit button less than
login 3-
page character
must be s” must
greater be
than 3 displayed
character enter login name less an error desig high
s than 3 chars (say ab) and message n
password and click “Login not
Submit button less than
3-
character
s” must be
displayed
enter login name 3 chars Login desig high
(say abc) and password success n
and click Submit button full or an
error
message
“Invalid
Login or
Password”
must
be
displayed
Login0 Validate To verify enter login name greater an error desig high
2 Login that than 10 chars (say message n
Login abcdefghijk) “Login not

Ishita siddhwani PAGE NO. 18


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

name on andpassword and click greater


login Submit button than 10
page characters
should ” must be
not displayed
be enter login name less Login desig high
greater than 10 chars (say success n
than 10 abcdef) and password full or an
characte and click Submit button error
rs message
“Invalid
Login or
Password”
must be
displayed
Login0 Validate To verify enter login name starting an error desig high
3 Login that with special chars (! message n
Login hello) password and click “Special
name on Submit button chars not
login allowed in
page login”
does not must be
take displayed
special enter login name ending an error desig high
character with special chars message n
s (hello$) password and “Special
click Submit button chars not
allowed in
login”
must be
displayed
enter login name with an error desig high
special chars in message n
middle (he&^ llo) “Special
password and click chars not
Submit button allowed in
login”
must be
displayed
Pwd01 Validate To verify enter Password less than an error desig high
Password that 6 chars (say a) and Login message n
Password Name and click Submit “Passwor
on login button d not less
page than 6
must be character
greater s” must
than 6 be
character displayed
s
enter Password 6 chars Login desig high
(say abcdef) and Login success n
Name and click Submit full or an
button error
message
“Invalid
Login or
Password”
must be
displayed
Pwd02 Validate To verify enter Password greater an error desig high
Password that than 10 chars (say a) and message n
Password Login Name and click “Password

Ishita siddhwani PAGE NO. 19


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

on login Submit button not greater


page than 10-
must be characters
less than ” must be
10 displayed
character
s
enter Password less than Login desig high
10 chars (say abcdefghi) success n
and Login Name and full or an
click Submit button error
message
“Invalid
Login or
Password”
must
be
displayed
Pwd03 Validate To verify enter Password with Login desig high
Password that special characters (s ay ! success n
Password @hi&*P) Login Name full or an
on login and click Submit button error
page message
must be “Invalid
allow Login or
special Password”
character must be
s displayed
Llnk01 Verify To Click Home Link Home desig low
Hyperlin Verify Page n
ks the must be
Hyper displayed
Links Click Sign Up Link Sign desig low
available Uppage n
at left must
side on bedisplaye
login d
page Click New Users Link New Users desig low
working Registratio n
or not n
Formmust
be
displayed
Click Advertise Link Page with desig low
Informati n
on and
Tariff Plan
for
Advertise
rs must be
displayed
Click Contact Us Link Contact desig low
Informati n
on page
must be
displayed
Click Terms Link Terms Of desig low
the service n
page
must be
displayed
Flnk01 Verify To Click Home Link Home desig low

Ishita siddhwani PAGE NO. 20


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

Hyper Verify Page must n


links the be
Hyper displayed
Links Click Sign Up Link Contact desig low
displayed Informati n
at Footer on page
on login must be
page displayed
working ClickContact UsLink Page with desig low
or not Informati n
on and
Tariff Plan
for
Advertise
rs must
be
displayed
Click Advertise Link Terms Of desig low
the service n
page
must be
displayed
Click Terms Of Privacy desig low
Membership Link Policy n
page must
be
displayed
Click Privacy Policy Privacy desig low
Link Policy n
page must
be
displayed
Lblnk0 Verify To Click NEW USERS Link New Users desig low
1 Hyper Verify located in login box Registrati n
links the on Form
Hyper must be
Links displayed
displayed
at Login
Box on
login
page
working
or not
Click New Users(Blue New Users desig low
Color) Link located in Registrati n
login box on Form
must be
displayed
ClickForgetPasswordLi Passwor d desig medium
nk locatedinloginbox Retrieval n
Page
must be
displayed

CONCLUSION: Test case has been formulated.

Ishita siddhwani PAGE NO. 21


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT-7

AIM: Manual testing for PAN card verification

SOFTWARE REQUIRED: IntelliJ idea.

PROCEDURE; A PAN card number is taken as input and is checked for errors.

CODE:

import java.lang.*;
import java.util.*;

public class Experiment_7 {

static boolean isUpperCase(String s)


{
return s.equals(s.toUpperCase());
}

public static void main(String[] args)


{
Scanner sc = new Scanner(System.in);
String panCard = null;
System.out.print("Enter the PAN card number: \t");
panCard = sc.next();

if (panCard.length() == 10)
{
if (isUpperCase(panCard))
{
if (panCard.matches("[A-Z]{5}[0-9]{4}[A-Z]{1}"))
{
System.out.println("Valid PAN number");
} else
{

Ishita siddhwani PAGE NO. 22


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

System.out.println("Invalid PAN number");


}
} else
{
System.out.println("Invalid PAN number");
}
}
else
{
System.out.println("Invalid PAN number");
}
}
}

TEST CASES:

s.no Pan card number Expected Output Actual output

1 ABCDE1245A VALID VALID


2 HBPWK0010P VALID VALID
3 1234BKl INVALID INVALID
4 87908111ABCDDD INVALID INVALID
5 Abcde12345a INVALID INVALID

OUTPUT:

Ishita siddhwani PAGE NO. 23


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

OBSERVATION

Test Expected
Case Name Description Steps Result Priority

1 1st 5 characters Verify if all are i) Characters are numerical Invalid! Medium
alphabets in capital
ii) Characters are
alphanumeric Invalid!
iii) Special characters
entered (including space) Invalid!
iv) All alphabets (small) Invalid!
v) All alphabets (capital) Valid! High

Verify if next 4
2 Next 4 characters characters are numerals i) Characters are alphabets Invalid! Medium
ii) Invalid!
alphanumeric Invalid!
iii) Valid!
entered (including space)
iv)
High

Verify there is only


3 Last character one more capital i) Numeral Invalid! High
alphabet
ii) Alphabet (small) Invalid!
iii) Alphabet (more than 1) Invalid!
iv) No character Invalid!

Ishita siddhwani PAGE NO. 24


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

v) Alphabet (capital) Valid!

EXPERIMENT-8

AIM: Generate test case for ATM machine.

SOFTWARE REQUIRED: Manual Testing

PROCEDURE: An ATM card is swapped and is checked for errors.

OBSERVATION:

TestCas Name Description ExpectedResult Priority


e
1) Cardswapping a) Cardrejected 1) Withdrawcard/invalidcard 1) Low
b) Cardaccepted 2) EnteryourPIN 2) High
2) EnterPIN a) InvalidPIN 1) a)Tryagain 1) Low

b)After3attempts,cardg
etsblocked
b) ValidPIN 2) Bankingoptions 2) High
3) Balanceenquir a) Savingaccount 1)MinRs.10,000/- 1) High
y b) Currentaccount 2)MinRs.1000/- 2) High
4) Cashwithdrawl a) Enteramount 1) a)Cashnotavaila 1) Low
bleb)Cashavaila
ble
b) Incorrectamount 2) a)Enteramountinmultipl 2) a)High
eof100's. b)Low
b)Tryagain
5) Statementrecei a) Ministatement Listing 1) High
pt b) Wantareceipt Yes 2) a)High
No b) Low

Ishita siddhwani PAGE NO. 25


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

6) PINchange a) EntercurrentPIN a)Invalid 1) a)Low


b)Valid b)High
b) If valid 1) EnternewPIN 2) High

Conti
7) nue a) Yes 1) Entertheoptions 1) High
transa b) No 2) Exit 2) High
ction

CONCLUSION:Test cases have been formulated and the ATM is tested.

EXPERIMENT- 9

AIM: overview of testing process using rational robot

THEORY:Rational Robot is a complete set of components for automating the testing of Microsoft
Windows client/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 would take 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 Test Manager 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

Ishita siddhwani PAGE NO. 26


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

 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

Ishita siddhwani PAGE NO. 27


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

 Step 4: On a new Configuration Project Window under Test Assets click on Create

 Step 5: Select the Microsoft Access as the Database and click on next •> finish

Ishita siddhwani PAGE NO. 28


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

 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

Ishita siddhwani PAGE NO. 29


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

 Step 8: You may now perform any function on the operating system and this GUI will record each
and every event that occurs.

Ishita siddhwani PAGE NO. 30


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

 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 understand all the steps needed to work with the rational robot.

Ishita siddhwani PAGE NO. 31


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

EXPERIMENT- 10

AIM: Write a script to record verification points 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.
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

Ishita siddhwani PAGE NO. 32


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

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, then click OK.

Ishita siddhwani PAGE NO. 33


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

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.

Ishita siddhwani PAGE NO. 34


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

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

All properties are identified and displayed.

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.

Ishita siddhwani PAGE NO. 35


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

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

Click ok

Click ok
12.resultst will display

Ishita siddhwani PAGE NO. 36


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

Result as test pass or fail will be displayed.

Ishita siddhwani PAGE NO. 37


SOFTWARE TESTING AND QUALITY ASSURANCE 21100BTCSE09899

Ishita siddhwani PAGE NO. 38

You might also like