User Id Passwor d ***** ***** Ok Recording
Add-in Manager: This window provides a list of WinRunner supported technologies with respect to our purchased license.
Note: If all options in Add in Manager are off by default it supports VB, VC++ interface (Win32 API).
Recording Modes: To record our business operations (Navigations) in winrunner we can use 2 types of recording modes.
1. Context Sensitive mode (Default Mode) 2. Analog mode
Analog Mode: To record mouse pointer movements on the desktop, we can use this mode. In Analog Mode tester maintains constant monitor resolution and application position during recording and learning
Application areas: Digital Signatures, Graphs drawing, image movements. Note:
1. In analog mode, WinRunner records mouse pointer movements with respect to desktop co-ordinates. Due to this reason, test engineer maintains corresponding context sensitive mode window in default position in recording and running. 2. If u want to use Analog mode for recording, we can maintain monitor resolution
as constant during recording and running.
move_locator_track() : WinRunner use this function to record mouse pointer movements on the desktop in one unit of time.
Syntax: move_locator_track(track number);
By default it starts with 1. It is not based on time. But based on operation.
mtype(): WinRunner uses this operations this function to record mouse pointer operations on the desktop.
Syntax: mtype(<T Track Number> < K key on the mouse used > + / - ); Ex: mtype ("<T20><kLeft>+");
Track no – Deck top coordinates in which you operate the mouse. It stores the mouse coordinates. Actually it is a memory location.
Type(): We can use this function to record keyboard operations in analog mode. Syntax: type(“Typed characters”/”ASCII notation”);
Context Sensitive mode: To record mouse and key board operations on our application build, we can use this mode. It is a default mode.
Context Sensitive Mode: In general functionality test engineer creates automation test scripts in Context Sensitive mode with required check points. In this mode WinRunner
records our application operation with respect to objects and windows. To record mouse and key board operations on our application build, we can use this mode. It is a default mode. Ex:
Focus to Window Set_window(“Window Name”, time); TextBox Edit_set(“Edit Name”,”Typed Characters”);
Password text box Password_edit_set(“Pwd Object”,”Encrypted Pwd”);
Push Button Button_press(“Button Name”);
Radio Button Button_set(“Button Name”,ON); Button_set(“Button Name”,OFF);
Check Box Button_set(“Button Name”,ON);
Button_set(“Button Name”,OFF);
List/Combo Box List_select_item(“List1”, “Selected Item”);
Menu Menu_select_item(“Menu Name; Option Name”);
Base State: An application state to start test is called as Base State. End State: An application state to stop test is called as Base State.
Call State: An intermediate state of an application between base state and end state is call state.
Functionality Testing Techniques:
Behavioral Coverage ( Object Properties Checking ).
Input Domain Coverage ( Correctness of Size and Type of every i/p Object ). Error Handling Coverage ( Preventing negative navigation ).
Calculations Coverage ( correctness of o/p values ).
Backend Coverage ( Data Validation & Data Integrity of database tables ). Service Levels ( Order of functionality or services ).
Successful Functionality ( Combination of above all )
Check points: WinRunner is a functionality testing tool, it provides a set of facilities to cover below sub tests.
To automate above sub tests, we can use 4 check points in WinRunner: 1. GUI check points
2. Bitmap check points 3. Data Base check points 4. Text check points
GUI Check point: To automate behavior of objects we can use this check point. It consists of sub options.
1. For Single Property 2. For Object/Window 3. For Multiple Properties
For Single Property: To test a single property of an object we can use this option.
Navigation: select a position in Script, Create Menu, GUI check point, for single property, select testable object(Double Click), select required property with expected, click paste.
Update Order Focus to Window Disable Open a Record Disable Perform Change Enable
Syntax: object_check_info("Object Name", "Property", Expected value); Ex: button_check_info("Update Order","enabled",0);
If the checkpoints are for numeric value, then no need for double quotes.
If the checkpoints are for string value, then place the data in between double quotes. But winrunner takes any value by default in string with double quotes.
Problem:
Focus to Window – Item No should be Focused Ok enabled after filling itemno & qty.
Expected: No. of Items in Fly to equal to, no of items in Fly From -1, when you select an item in fly from.
Ex: if u select an item in a list box then the no of items in next list boxes decreased by 1. Problem:
Focus to Window – Ok should be Disabled Fly From Fly To NagaRaju Journey Ok Item No Quantity NagaRaju Shopping Ok
Enter Roll No - Ok should be disabled Enter Name – Ok should be disabled Enter Class – Ok should be disabled
Problem: If type is A, Age is Focused, If type is B, Gender is Focused, If type is C, Qualification is Focused. Else others is focused. (use switch stmt)
switch(x) {
case “A”: edit_check_info(“Age”,”focused”, 1); break; } List1 List2 NagaRaju Journey Ok List3 Type
Age Gender Qualification Others
Item No Quantity
NagaRaju Shopping
Exp: Selected Item in List box appears in text box after Clicking Ok button.
Exp: Selected Item in List box appears in Sample 2 text object after clicking display button.
Sample1 Sample2
Problem:
If basic salary >= 10000 then commission = 10% of basic salary.
Else If basic salary in between 5000 & 10000 then commission = 5% of basic salary. Else If basic salary < 5000 then commission = 200 Rs.
Problem:
If Total >= 800 then Grade = A.
Else If Total in between 800 & 700 then Grade = B. Else Grade = C. List1 Ok Display Text Emp No Dept No NagaRaju Employee Ok B Sal Comm Ok
Roll No
Ok
For Object/Window: To test more than one properties of a single object, we can use this option.
Ex: Update Object
Update Order Focus to Window Disable Open a Record Disable
Perform Change Enable & Focused
Syntax: obj_check_gui(“obj name”, “Check List File.ckl”, “expected values file.txt”, time to create );
In the above syntax check list file specifies list of properties to test of a single object. And its extension is .ckl
Expected values file specifies list of expected values for that selected or testable properties. And its extension is .txt
Ex: obj_check_gui("Update Order", "list1.ckl", "gui1", 1);
For Multiple Objects: To test more than one property of more than one object in a single checkpoint we can use this option. To create this checkpoint tester selects multiple objects in a single window.
Ex:
Insert Order Update Order Delete Order
Focus to Window Disable Disable Disable
Open a Record Disable Disable Enable
Perform Change Disable Enable & Focused Enable
Navigation: select position in script, create menu, GUI checkpoint, For Multiple Objects, click add, select testable objects, right click to relieve, specify expected for required properties for every selected object, click ok.
Syntax: win_check_gui("Object Name", "Check List File.ckl", "Expected Values File", Time to Create);
Ex: win_check_gui("Flight Reservation", "list3.ckl", "gui3", 1); Case Study: What type of properties you check for what objects? Object Type Properties
List Box Count ( No of items in List Box ), Value ( Current Selected Value ) Table Grid Rows, Columns, Table Content
Text / Edit Box Enabled, Focused, Value, Range, Regular Expression, Date Format, Time Format
Changing Check Points:
WinRunner allows us to perform changes in the existing check points. There are 2 types of changes in existing checkpoints due to project sudden changes or tester mistake.
1. Change expected values 2. Add new properties to test Change expected values
Wr allows u to perform changes in expected values in existing checkpoints
Navigarion: execute test script, click results, perform changes in expected values in results window of required, click ok, reexecute the test script to get right result
Add new properties to test
Sometimes test engineer add extra properties to existing checkpoint due to incompleteness of test through below navigation.
Navigation: Create menu, edit gui check list, select check list file name, click ok, select new properties to test, click ok, to overwrite, change run mode to update, click run executed (default values selected as exp values), click run in verify mode to get results, perform changes in result if required
Running Modes in WinRunner:
Verify mode: in this mode wr compare our expected values with actual. Update mode: in this runmode, default values select as expected value Debug mode: to run our test scripts line by line.
During GUI check point creation Winrunner creates checklist files and expected values files in HardDisk. Winrunner maintains the test scripts by default in tmp folder
Script: c:\program files\mi\wr\tmp\testname\script
Checklists: c:\program files\mi\wr\tmp\testname\chklist\list1.ckl Exp values: c:\program files\mi\wr\tmp\testname\exp\gui1 Input Domain Coverage: Range and Size
Enable
d
Focuse
d
Value
ON
OFF
Default ValueNavigation: Create Menu, GUI Check point, for object/window, select object, select range property, enter from & to values, click ok.
Syntax: obj_check_gui(“obj name”, “What Property you are checking”, “Range of Values from & To”, time to create )
In the above syntax check list file specifies list of properties to test of a single object. And its extension is .ckl
Expected values file specifies list of expected values for that selected or testable properties. And its extension is .txt
Ex: obj_check_gui("Update Order", "list1.ckl", "gui1", 1);
Input Domain Coverage: Valid and Invalid Classes
Navigation: Create Menu, GUI Check point, for object/window, select object, select Regular Expression property, enter Expected Expression as []*, click ok.
Syntax: obj_check_gui(“obj name”, “What Property you are checking”, “Range of Values from & To”, time to create )
In the above syntax check list file specifies list of properties to test of a single object. And its extension is .ckl
Expected values file specifies list of expected values for that selected or testable properties. And its extension is .txt
Ex: obj_check_gui("Update Order", "list1.ckl", "gui1", 1);
Problem: The Name text box should allow only lower level characters
1. Alphabets in lower case and initial cap only
2. Alpha numeric and starting and ending with alphabets only 3. Alphabets in lower case but starts with R ending with o only 4. Alphabets in lower case with Under Score in middle