1. WIN RUNNER
Features of Winrunner:
Product: Mercury Interactive or Hewlett Packard(HP)
Purpose: Functionality and Regression Testing Tool
Kinds of application: All kinds of application (web Based and Window Based).
Language:Test Script Language
Technology: Object oriented Technology
Object Oriented Technology:
It will recognise each and every control/field present in the application as an object.
Each and every object present in the application has its own properties. The object
and their properties are get stored in the GUI Map File. Map File is the heart of the
winrunner.
Generating Map File:
Rapid Script Wizard:
The RapidTest Script Wizard will "walk through" your application by automatically
opening windows and dialog boxes. It will examine every GUI object (for example,
buttons, lists, and edit fields) and will learn a unique description of each one.
Recording
Context Sensitive:
WinRunner records the operations you perform on the GUI objects in your
application, and inserts the appropriate TSL statements into your test script.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.insert an order
5.file->exit
6.stop the recording
Analog:
WinRunner records the operations you perform on your application, including
keyboard input, mouse clicks, and the exact coordinates of the mouse pointer as it
travels across your screen.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
2. 4.file->open order, specify order no, click ok
5.file->fax order ,specify the fax number
6.click the record icon(context->analog)
7.put agent signature.
8. click the record icon(analog->context)
9.click send
10.file->exit
11.stop the recording
GUI Map Editor:
Enables you to view the contents of the GUI Map and to load and maintain GUI Map
files.
Tools-Gui Map editor
Open the application
Use the learn tool to capture the application.
GUISPY:
Opens the GUI Spy, enabling you to view the properties of GUI objects in your
application
Tools->gui spy
Open the application
Use the spy icon to capture the object
press ctrl(L)+f3 to stop capturing.
Merging Map Files:
The GUI Map File Merge Tool enables you to merge multiple GUI map files into a
single GUI map file.
GUI Map File Manual Merge Tool
This tool opens after you chose to merge multiple GUI map files into a single
GUI map file using the Manual Merge merge type.
Tools->merge Gui map files
Click ok
Select merge type as Manual
Browse the Target and Source File
Click ok
Select the object and click copy
Click close
GUI Map File Auto Merge Tool
This tool opens after you tried to merge multiple GUI map files into a single
GUI map file using the Auto Merge merge type, only if The merge tool found
conflicts among the source GUI map files being merged.
3. Tools->merge Gui map files
Click ok
Select merge type as Auto
Browse the Target and Source File
Click ok
Synchronization Point:
Synchronization points enable you to solve anticipated timing problems between the
test and your application.
Tools->general options->settings->timeout for check point ->5000
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.insert an order
5.file->exit
6.stop the recording
7.Insert->synchronization point->for object/window place the cursor in the object
8.change the value-1 Time-10 and click paste
9.Run the test
CheckPoint:
It is used to compare the expected Result versus Actual Result.
GUI Checkpoint
For Single Property:
The property check verifies the value of a single property of a GUI object.
Insert->gui checkpoint->single property
Use the hand icon to select the object,
Change the expected value
For Object/Window:
The checkpoint checks a single object or window in your application.
Insert->gui checkpoint->from object/window
Use the hand icon to select the object,
Change the expected values
For Multiple Objects (Create GUI Checkpoint dialog box):
The checkpoint checks multiple objects in your application.
Insert->gui checkpoint->for Multiple objects, click add object
Use the hand icon to select the object
Change the expected values
Get Text
4. From Object/Window:
The text retrieval statement reads the text displayed in a window or in a
GUI object in your application.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.Insert->get text->from object/window
3.select the static text
4.close the application
5.stop the recording
if (text=="UserName:")
printf("Valid user");
else
printf("InValid user");
From Screen Area:
The text retrieval statement reads the text displayed in a specified area on
your screen.
Bitmap Checkpoint
For Object/Window
Inserts a bitmap checkpoint into your test script. The checkpoint checks a
single object or window in your application.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.Help->about
5.Insert->bitmap check point->for object/window
6. Use the hand icon to select the object.
7. Close the application
8.stop recording
9.change the application from flight 4a/4b
For Screen Area:
Inserts a Bitmap checkpoint into your test script. You specify an area on
your screen that the checkpoint will check.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.Help->about
5.Insert->bitmap check point->for object/window
6. Draw the region u want to capture
7. Close the application
5. 8.stop recording
9.change the application from flight 4a/4b
Database Checkpoint :
Default Check:
Inserts a database checkpoint into your test script.
Use a default database check to check the entire contents of a database
associated with your application.
Insert->databasecheckpoint->default check
Click ok
Select the dsn (Flight32)->ok
Select the orders table->select the field
Click next
Select order number-> less than equals to->some value (20)
Click next
Sort by order no->next
Finish
Run the test
Double click the end database
Database checkpoint window right click Edit Expected Data change
the value
Run the test
Change it to update mode
Run the test
Change it to Verify mode
Run the test
Custom Check:
Inserts a database checkpoint into your test script. The checkpoint checks
specified properties of the database.
Use a custom check to:
· check the number of rows in a database
· check the number of columns in a database
· check specific information in the database
6. Insert->databasecheckpoint->Custom check
Select specify sql statement
Click next
Click create
Move to machine data source
Select flight32 dsn
Click ok
Specify the query as
“Select * FROM ORDERS”
Click finish
In the check database
Change the expected value
Run the test
Run Time Record Check:
The Runtime Record Checkpoint wizard, which enables you to insert a
Runtime Database Record checkpoint into your test script. The
checkpoint captures information from your application during the test run
and checks it against the corresponding record(s) in the database.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.insert an order
5.Insert->databasecheckpoint->Run time record check
6.Click next
7.Select the dsn (Flight32)->ok
8.Select the orders table->select the field
9.Click next
10.Select order number-> equals to->order number (inserted during
recording)
11.Click next
12.click next
13.Finish
14.Use the hand icon to select the field-.click next
15.perform the above for all the value
16.close the application
17.stop recording
18.run the test.
Data Driver:
7. Enables you to parameterize lines in your test script so you may run your
test in a loop with different sets of data.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.insert an order
5.file->exit
6.stop the recording
7.table->datadriver wizard
8.click next until you reach Agent name->select new column
9.click next. -> Perform the above specified for other field also
10.select show datatable now
11.specify the values.
12.run the test.
Regular Expression:
Regular expressions enable WinRunner to identify objects with varying
names or titles. A regular expression is a string that specifies a complex
search phrase
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.insert an order
5.file->fax order->specify fax number->lick send
6. Close the application.
7.stop the recording
8.change the modification !Fax Order No. [0-9]*
9.Tools->Gui map editor->select the object->click modify->change in
both physical and logic description.
Break Point:
Adds or removes a breakpoint to or from the line where the cursor is
currently located.
1.Place the cursor in the regular Expression script
2.Right click->select Toggle Break point.
3.Run from Top
4.To execute from Break point->Run from Arrow
Compiled Modules:
8. Verify: Checks your application . This mode is relevant only for tests and
is not supported when working with components.
Debug: Debugs your test or component script.
Update: Updates the expected results.
Dialog Boxes:
a=create_input_dialog("Enter the name");
report_msg(a);
b=create_password_dialog("userName","Password",l,
p,1);
report_msg(l);
report_msg(p);
c=create_browse_file_dialog("*.*");
report_msg(c);
d=create_list_dialog("Welcome to STC","course
Description","CATE+,CATE,ADST,CSTP");
report_msg(d);
File Handling:
file_open("C:readme.txt",FO_MODE_READ);
file_open("C:readme2.txt",FO_MODE_WRITE);
i=0;
while(file_getline("C:readme.txt",line)==0)
{
i++;
file_printf("C:readme2.txt","%d "&toupper(line),i);
}
file_close("C:readme.txt");
file_close("C:readme2.txt");
User Defined Functions
9. public function multiple(a,b)
{
auto c;
c=a*b;
return c;
}
file->Test properties->testtype->Compiled Module.
Save the test
load("func1");
x=create_input_dialog("Enter a number");
y=create_input_dialog("Enter a number");
z=multiple(x,y);
report_msg(z);
save the test
Debug options:
Step:
The Step command assists with test script debugging by enabling you to
observe the response of your application as WinRunner executes each test
script line.
Step Into:
Step Into command assists with test script debugging by enabling you to
observe the response of your application as WinRunner executes each test
script line.
Step out:
Step Out command to eliminate the need to execute a called test or
function line-by-line using the Step and Step Into commands.
Step to cursor:
Step to Cursor command assists with test script debugging by letting you
run a pre-defined section of a test script.
Recovery Scenario:
An exception is an interruption occurs while executing the test.
10. An Interruption may be a window exception and application exception.
To overcome the exception we need to perform some recovery steps
Popup event:
A specific window that pop ups during test run and interrupts the
test.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name( less than 4 characters) and password
3.click ok(Error window)
4. specify agent name
5. click ok
6.close the application
7.stop recording
8.comment the line where you click ok in the error window
9.Run the test
10.click pause
11.Tools->recovery Manager.
12.click new
13.select popup->next->specify scenario name->next
14.select the window->next->select the ok button->next-> finish
15.un the test.
TSL event:
A TSL return value that can cause an interruption in the test run.
1.Rec->start->programs->winrunner->sample applications->flight 4a
2.specify agent name and password
3.click ok
4.insert an order
5.In the script Copy the Fly from Location Line, change the Fly From
Location.(List_Select_item)
6.Run the test.
7.Click ok in the error window
8.Tools->recovery Manager.
9.click new
10.selectTSL event->next->specify scenario name->next
11.select the Tsl function(List_select_item)->error->E_Item_not_found-
>next.
12.click define Recovery function.
13.paste the script.
11. 14.click ok-> click ok-> click finish.
15.save the script
16 open a new script->rightclick paste ->file->test properties->Test type
as Compiled module.
17.save the test
18.load(scriptname)
19.run the test
Watch List:
It enables you to monitor the values of variables, expressions, and arrays
while you debug a test script.
a=create_input_dialog(“Enter a Number”);
b= create_input_dialog(“Enter a Number”);
c=a*b;
d=c*b;
e=d*c;
f=e*d;
report_msg(g);
Watch list Expression: g=a+b+c+d+e+f
Virtual Object:
Tool Might recognise a standard application as a bitmap object.Hence by
using virtual object we can instruct the tool. To Handle the application
has a standard application.
Batch Test:
It is used to execute Multiple Test in a single Batch Test.
Call “script1”();
Call “script2”();
Call “script3”();