SlideShare a Scribd company logo
1 of 275
Winrunner Training Objective of the Course ,[object Object],[object Object],[object Object],[object Object]
Benefits of Automated Testing WinRunner Testing Process WinRunner Recording Mode Working with other Test Suite Tools
Manual Vs. Automated Testing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Benefits of Automated Testing Fast:   Run tests significantly faster than human users Reliable:   Tests perform precisely the same operations each time they  are run, thereby  eliminating human error Repeatable:   You can test how the software reacts under repeated execution of the same  operations Programmable:   You can program sophisticated tests that bring out hidden information from  the application Comprehensive: You can build a suite of tests that covers every feature in your application Reusable:   You can reuse tests on different versions of an application, even if the user  interface changes
WinRunner Testing Process ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WinRunner Testing Process ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recording Mode ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],button_press (“ OK ”); move_locator_track (1);  mtype (&quot;<T110><kLeft>-&quot;);  mtype (&quot;<kLeft>+&quot;);
Choosing a Recording Mode ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],Recording User Actions
[object Object],[object Object],Recording User Actions
WinRunner Main Window
WinRunner Standard Toolbar
Recording a Test ,[object Object]
Recording a Test ,[object Object],Automatic Script Generation Enter Application Data
Benefits of Automated Testing WinRunner Testing Process WinRunner Recording Mode Working with other Test Suite Tools
Working with Other Test Suite Tools WinRunner works with other Test Suite tools to provide an integrated solution for all phases of the testing process I.e.  Test Planning, Test Development, GUI and Load Testing, Defect Tracking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LAB EXERCISE
[object Object],[object Object],[object Object]
Day 2 ,[object Object],[object Object],[object Object],[object Object]
How Does WinRunner  Create the Script?
How Does WinRunner Create the Script? John set_window(&quot;Login&quot;, 10); edit_set (&quot;Name&quot;, ”John&quot;); Recording WinRunner AUT ,[object Object],[object Object],GUI Map
How Does WinRunner Run the Script? set_window(&quot;Login&quot;, 10); edit_set (&quot;Name&quot;, ”John&quot;); John Playback WinRunner AUT ,[object Object],[object Object],GUI Map
Main Issues in Script Creation ,[object Object],[object Object],[object Object],[object Object]
How Does WinRunner Identify an Object? John ******* WinRunner uses an object’s physical attributes to identify the object Displayed label class MSW_class x y abs_x abs_y maximizable focused width height active MSW_id handle minimizable nchildren enabled TOOLKIT_class ATTRIBUTES
How Does WinRunner  Uniquely   Identify an Object? John ******* WR uses the minimum number of  static  attributes to achieve unique identification label class Class: push_button Label: “OK”
How Does WinRunner Assign  Object Names? John ******* WinRunner assigns a short name to each object called the  logical name Class: push_button Label: “OK” button_press (“ OK ”); edit_set (“ Name ”, “John”); edit_set (“ Password ”, “mercury”);
Into Which Field Will WinRunner  Play Back? set_window(&quot;Login&quot;, 10); edit_set (&quot;Name:&quot;, &quot;John&quot;); John ? ?
Scope of Identification edit_set (&quot;Name:&quot;, &quot;John&quot;); John WinRunner identifies an object within the scope of its  parent window  (not   the entire application) set_window (&quot;Login&quot;, 10);
WinRunner Tracks AUT’s Windows and Objects With the GUI Map File ,[object Object],[object Object],[object Object],[object Object],GUI Map File Name: Physical Description: Name class: edit attached_text: &quot;Name&quot; WINDOW: Login  Password class: edit attached_text: &quot;Password&quot; OK class: push_button label: &quot;OK&quot;
GUI Map Editor ,[object Object],[object Object],[object Object],Parent Window (logical name) Physical Description of window or object highlighted above Child Objects (logical names)
The GUI Map ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Characteristics Strengths
GUI Map Translates Logical Names  Into Physical Descriptions  Options Class: Window Label: Window Dealer Name Class: Edit label: DealerName Address Class: Window Label: Address Login Class: Window Label: Login Automobile Purchase Form Class: Window Label: APF Customer Name Class: Edit label: CustomerName Make Class: Window Label: Make SCRIPT GUI MAP AUT set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Address&quot;,&quot;234 Willow Drive&quot;); edit_set (&quot;Customer Name&quot;, &quot;Thomas Paine&quot;); Logical Name Physical Description
Recording Example Application GUI Map Logical Physical { class: window, MSW_id: 3277 label:  &quot;Save As&quot; } { class: push_button, label:  &quot;OK&quot; } &quot;Save As&quot;   &quot;OK&quot; set_window (&quot;Save As&quot;, 1); button_press (&quot;OK&quot;); Test Script WinRunner
Playback Example ,[object Object],Application GUI Map Logical Physical { class: window, MSW_id: 3277 label:  &quot;Save As&quot; } { class: push_button, label:  &quot;OK&quot; } &quot;Save As&quot;   &quot;OK&quot; set_window (&quot;Save As&quot;, 1); button_press (&quot;OK&quot;); Test Script WinRunner
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object]
Techniques For Managing GUI Map Files Technique 1 One GUI Map file per test Technique 2 One GUI Map file for many tests
Object and Window Properties  During Recording Name: Description: Date class: edit attached_text: &quot;Date&quot; set_window(&quot;Automobile Purchase Form&quot;, 10); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); WINDOW: Automobile Purchase Form   Year class: edit attached_text: &quot;Year&quot; Make class: list   attached_text: &quot;Make&quot; Model class: edit attached_text: &quot;Model&quot; edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); WinRunner stores the names and descriptions for windows and objects in a temporary GUI Map file Temporary GUI Map file Technique 1
What Happens to These Properties? Use the GUI Map Editor to save the contents of the Temporary GUI Map file to a permanent GUI Map file Technique 1 Temporary GUI Map file Name: Description: Date class: edit attached_text: &quot;Date&quot; WINDOW: Automobile Purchase Form   Year class: edit attached_text: &quot;Year&quot; Make class: list   attached_text: &quot;Make&quot; Model class: edit attached_text: &quot;Model&quot;
Creating a Permanent GUI Map File  Car_App.gui L1 Car_App.gui Insert Test1 Test2 Testing  Project Tests GUI Technique 1
Adding New Windows and Objects to a GUI Map File Invoke the GUI Map Editor 1 Technique 1
Adding New Windows and Objects to a GUI Map File Technique 1 Invoke the GUI Map Editor 1 Press the  Expand  Button to display Temporary and Permanent GUI Map files 2
Adding New Windows and Objects to a GUI Map File Technique 1 Invoke the GUI Map Editor 1 Move contents of Temp to Permanent by pressing  Move  button 3 Press the  Expand  Button to display Temporary and Permanent GUI Map files 2
Adding New Windows and Objects to a GUI Map File Technique 1 Save changes to permanent GUI Map file 4 Invoke the GUI Map Editor 1 Press the  Expand  Button to display Temporary and permanent GUI Map files 2 Move contents of Temp to permanent by pressing  Move  button 3
Save Project GUI Map Files Together  Insert Test1 Test2 Testing  Project Tests Insert.gui L1 Insert.gui GUI Test1.gui Test2.gui Technique 1
Techniques for Managing GUI Map Files Technique 1 One GUI Map file per test Technique 2 One GUI Map file for many tests
Creating a Permanent GUI Map File Technique 2 Invoke the GUI Map Editor 1
Creating a Permanent GUI Map File The cursor changes to a pointing hand Technique 2 Invoke the GUI Map Editor 1 Click the Learn  Button 2
Creating a Permanent GUI Map File The cursor changes to a pointing hand Technique 2 Invoke the GUI Map Editor 1 Click the Learn  Button 2 Click on the Window to be learned 3
Creating a Permanent GUI Map File The cursor changes to a pointing hand WinRunner learns all objects in window Technique 2 Invoke the GUI Map Editor 1 Click the Learn  Button 2 Click on the Window to be learned 3
Creating a Permanent GUI Map File The cursor changes to a pointing hand WinRunner learns all objects in window Technique 2 Invoke the GUI Map Editor 1 Click the Learn  Button 2 Click on the Window to be learned 3 Repeat for all windows in  the application 4
Modify Names for Script Readability These names are unreadable. To what objects do they refer ? Technique 2
Modify Names for Script Readability Technique 2 Highlight the object whose name you  want to change 1
Modify Names for Script Readability Technique 2 Highlight the object whose name you  want to change 1 Click the Modify  Button 2
Modify Names for Script Readability Technique 2 Highlight the object whose name you want to change 1 Change the Logical Name of the object 3 Click the Modify  Button 2 Click  OK 4
Modify Names for Script Readability &quot;Name:”  appears in your test script during recording instead of  &quot;ThunderRTTextBox_0&quot; RESULT ! Technique 2 Click  OK 4 Highlight the object whose name you want to change 1 Change the Logical Name of the object 3 Click the Modify  Button 2
Creating a Permanent GUI Map File  Car_App.gui L1 Car_App.gui Insert Test1 Test2 Testing  Project Tests GUI Technique 2
Which Technique Should You Use? Technique 1 Advantages 1.  Each test has GUI Map file    independence 2.  There is no need for a GUI Map file   administrator 3.  The GUI Map file is very simple to   create–record and save Preferred method if the  application is not intended to change during renovation Technique 2 Advantages 1.  Object and window names can be   very readable in the test script 2.  If an object or window description   changes, you only have to modify one GUI Map file–all tests will play back properly Preferred method if the  application might change  during renovation
Importance of the GUI Map File ? set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); What happens when playback is attempted, and the proper GUI Map file is not loaded? Automobile Purchase Form Date
Load GUI Map File from Script GUI_load(&quot;N:Y2K_ProjGUIinsert.gui&quot;); set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); 12/12/03 BMW 1973 2002tii Insert.gui
Unload GUI Map File from Script GUI_load(&quot;N:Y2K_ProjGUIinsert.gui&quot;); Insert.gui set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); GUI_close_all( ); 12/12/03 BMW 1973 2002tii
Fixing the GUI Map File set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); GUI Map file Name:   Description: Date    class: edit   MSW_id: 14
Fixing the GUI Map File 2 set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); 1 GUI Map file Name:   Description: Date    class: edit   MSW_id: 14
Use the GUI Map Editor to Fix File *L1 Insert.gui L1 Insert.gui Active GUI file: N:Y2K_ProjectGUInsert.gui Invoke the GUI Map Editor 1 Edit the description 3 Save the file 4 Highlight field and press  Modify 2
Fixing the GUI Map File 12/12 /03 set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); BMW 1973 2002tii ! Success WinRunner can now successfully playback the script
Custom User Toolbar ,[object Object],[object Object],[object Object],[object Object]
Add GUI Map Editor to the Custom User Toolbar An icon for each command selected is added to the User Toolbar Select Settings > Customize User Toolbar 1 In each category, select command(s) to appear in toolbar 2
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LAB EXERCISE
[object Object],[object Object],[object Object],[object Object],[object Object]
Day 3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text  Checkpoints
Verifying the AUT - Manual Testing PASS ? Step Step Description Expected Result 1 Select File > New SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2  Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
Verifying the AUT - Manual Testing Step Step Description Expected Result William Frawley PASS ? 2 Enter your name The  Terms  button is enabled 1 Select File > New SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2  Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
Verifying the AUT - Manual Testing Step Step Description Expected Result 2 Enter your name The  Terms  button is enabled 1 Select File > New William Frawley PASS ? SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2  Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
Verifying the AUT - Automated Testing     William Frawley ? set_window (&quot;Automobile Purchase Form&quot;, 8); menu_select_item (&quot;File;New Form&quot;); edit_set (&quot;Customer Name&quot;, &quot;William Frawley&quot;); SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2  Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
What Is WinRunner Verification? Definition: Verification is the process by which WinRunner reports whether expected results are actualized by the application.
How WinRunner Verifies WinRunner compares the actual result to the stored, expected result 3 WinRunner captures an actual result during playback 2 1 WinRunner or the tester stores an expected result with the recorded test script WinRunner reports the comparison outcome as PASS or FAIL 4
How Does a Checkpoint Work? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected AUT Actual Expected AUT Actual
Process to Create Verification Run the recorded test script to verify correct execution 3 Test the checkpoint to ensure that it works for PASS  and  FAIL conditions 2 1 Capture or create the expected result within the recorded test script The tester creates the expected result only for  text  verification NOTE
Playback  -  Run Modes ,[object Object],[object Object],[object Object]
GUI Object Verification ,[object Object],[object Object],[object Object],Check the state or attributes of GUI objects:
Database Verification ,[object Object],[object Object]
Bitmap Image Verification ,[object Object],[object Object]
Text Verification ,[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text  Checkpoints
How Does GUI Checkpoints Work ? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected Actual Expected Actual AUT AUT
Process for GUI checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create GUI checkpoint 2 1 Determine the visual cue(s) Run the recorded Test Script to verify correct execution 4
Process for GUI checkpoints 1 Determine the visual cue(s)
Which visual cues demonstrate that the AUT meets requirements ,[object Object],[object Object],[object Object],Application returns a message  Application returns a value  Object changes its state  GUI object example
Determine which visual cues to verify ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Checkpoint differs depending on the object to be verified Win_check_info Window Obj_check_info Generic Object button_check_info Button(check,radio,push) list_check_info List Checkpoint function Type of Object
Process for GUI checkpoints Create GUI checkpoint 2 1 Determine the visual cue(s)
Create GUI Checkpoints ,[object Object],State, Label Enabled, Focus Multiple properties of multiple objects Enabled, Label Multiple properties of one object Enabled  One property of one object Example Type of GUI Checkpoint
Check One property of one Object ,[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check One property of one Object ,[object Object],button_check_info (“OK”,”enabled”,0); ,[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of one Object ,[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of one Object ,[object Object],obj_check_gui ( &quot;OK&quot; ,  &quot;list1.ckl&quot; ,  &quot;gui1&quot; ,  1 ); ,[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of one Object ,[object Object],obj_check_gui ( &quot;OK&quot; ,  &quot;list1.ckl&quot; ,  &quot;gui1&quot; ,  1 ); ,[object Object],[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of multiple Objects ,[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of multiple Objects ,[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of multiple Objects ,[object Object],[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Check Multiple properties of multiple Objects ,[object Object],win_check_gui ( &quot;Login&quot; ,  &quot;list2.ckl&quot; ,  &quot;gui2&quot; ,  1 ); ,[object Object],[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Process for GUI checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create GUI checkpoint 2 1 Determine the visual cue(s)
Test the checkpoint ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Process for GUI checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create GUI checkpoint 2 1 Determine the visual cue(s) Run the recorded Test Script to verify correct execution 4
Verify correct Script Execution ,[object Object],[object Object],[object Object],[object Object]
Test directory after GUI Checkpoint Testing  Project Tests chklist List1.ckl exp Test2 gui1.chk Test1 Test2
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text  Checkpoints
Database Checkpoint Definition: A test script checkpoint which verifies the schema table contains the expected data
Flight Database Schema Flight_Number (FK) Order_Number (PK) Orders Flight_Number (PK) Flight A Foreign Key value in a table must exist as a Primary Key value in a referenced table or be null Referential Integrity
Queries Extract Data ,[object Object],11 Order_Number
Why use Database Checkpoints ? ,[object Object],[object Object],[object Object]
What can you check in a Database ? ,[object Object],[object Object],[object Object]
How does WinRunner Query the Data ? ,[object Object],[object Object],[object Object]
How Does Database Checkpoint Work ? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected Actual Expected Actual AUT AUT
Process for Database Checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Use Database Checkpoint wizard to implement the Database Checkpoint 2 1 Record User actions to create database transaction Run the recorded scripts 4
Process for Database Checkpoints 1 Record User actions to create database transaction
Record user actions to create a Database transaction edit_set  ( &quot;Name:&quot; ,  &quot;Preeti&quot; ); button_press  ( &quot;Insert Order&quot; ); Preeti set_window  ( &quot;Flight Reservation&quot; ,  7 ); edit_set  ( &quot;Date of Flight:&quot; ,  &quot;09/06/02&quot; );
Process for Database Checkpoints Use Database Checkpoint wizard to implement the database checkpoint 2 1 Record User actions to create database transaction
Use Database Checkpoint Wizard ,[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Use Database Checkpoint Wizard ,[object Object],[object Object]
Use Database Checkpoint Wizard ,[object Object],db_check ( &quot;list1.cdl&quot; ,  &quot;dbvf1&quot; ); ,[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Process for Database  checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Use Database Checkpoint wizard to implement the database checkpoint 2 1 Record User actions to create database transaction
Test the checkpoint ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Process for Database checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Use Database Checkpoint wizard to implement the database checkpoint 2 1 Record User actions to create database transaction Run the recorded scripts 4
Verify correct Script Execution ,[object Object],[object Object],[object Object],[object Object]
Test directory after Database Checkpoint Testing  Project Tests chklist list1.cdl msqr1.sql exp Test2 dbvf1 Test1 Test2
Summary ,[object Object],[object Object],[object Object],[object Object]
Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text  Checkpoints
Bitmap Checkpoint Definition: ,[object Object],[object Object],Use Bitmap checkpoint only when verification cannot be accomplished using object or window attributes Tip
Is Bitmap Checkpoint necessary? Bitmap Checkpoint GUI Checkpoint ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How Does Bitmap Checkpoint Work ? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected Actual Expected Actual AUT AUT
Process for Bitmap Checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window? Run the recorded scripts Differences are reported in Test Results and the difference Bitmap is found 4
Process for Bitmap Checkpoints Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window?
Create a Bitmap Checkpoint ,[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Create a Bitmap Checkpoint ,[object Object],[object Object]
Create a Bitmap Checkpoint ,[object Object],obj_check_bitmap ( &quot;Name:&quot; ,  &quot;Img1&quot; ,  1 ); ,[object Object],[object Object],set_window(“Login&quot;, 2); obj_type (“Agent Name:”,”<kTab>”); edit_set (“Password&quot;, “mercury&quot;); edit_set (“Agent Name:&quot;, “Test&quot;);
Process for Bitmap Checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window?
Test the checkpoint ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Verify correct Script Execution ,[object Object],[object Object],[object Object],[object Object]
Process for Bitmap  Checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window? Run the recorded scripts Differences are reported in Test Results and the difference Bitmap is found 4
Differences are reported and the difference Bitmap is found ,[object Object],Actual Result Difference Bitmap
Summary ,[object Object],[object Object],[object Object],[object Object]
Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text  Checkpoints
Why use a Text Checkpoint ? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Process for Text Checkpoints Insert code to compare the actual and expected value 3 Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value Insert code to report the comparison outcome to WinRunner Test Results window 4
Process for Text Checkpoints 1 Define a variable in the script and assign the expected value
Define a variable in the script and assign the expected value ,[object Object]
Process for Text Checkpoints Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value
Insert a function to read the actual text from the AUT during playback ,[object Object],[object Object],Attribute of Standard or a Custom Object Part of custom GUI object which cannot be read as an attribute Bitmap obj_get_info obj_get_text win_get_text
Process for Text Checkpoints Insert code to compare the actual and expected value 3 Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value
Insert code to compare the actual and expected value ,[object Object],[object Object]
Process for Text Checkpoints Insert code to compare the actual and expected value 3 Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value Insert code to report the comparison outcome to WinRunner Test Results window 4
LAB EXERCISE
[object Object],[object Object],[object Object],[object Object]
Data Driven Tests
Data-Driven Tests ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Data-Driven Test? ,[object Object],[object Object],[object Object],[object Object],What if you want to use different data? San Francisco Los Angeles London
What is a Data-Driven Test? ,[object Object],[object Object],[object Object],“ Denver” ); Objects ,[object Object],Recorded Value Actions Data Table ddt_val (table, fly_from) ); Data
What Is the Data Table? The Data Table is a spreadsheet file in WinRunner that stores the input values you will use to data-drive your test . Definition:
Advantages of a Data-Driven Test ,[object Object],[object Object],[object Object]
Data Driving Tests Create a test 1 Modify test to read from Data Table  2 3 Move data to  Data Table 1. Create test with data 2. Verify script is ready for data driving Create a test
1. Create a Test Create Test with Data invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, &quot;Josephine&quot;); password_edit_set (&quot;password&quot;,  “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); Test Script
1. Create a Test Verify that Script Is Ready to Data Drive  invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, &quot;Josephine&quot;); password_edit_set (&quot;password&quot;,  “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); Does the script verify the expected results? Are all actions that involve inputting data recorded into the script? Are all synchronization points entered into the  script? Are the initial and end conditions the same? ? Test Script
Data Driving Tests Create a test 1 Move data to Data Table 3 Modify test to  read from Data Table 2 Modify test to read from Data Table 1. Run DataDriver Wizard
The DataDriver Wizard will convert your baseline script table =  &quot;default.xls&quot; ;  rc =  ddt_open (table, DDT_MODE_READ); if  (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row =  1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window  ( &quot;Login&quot; ,  10 ); edit_set  ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press  ( &quot;OK&quot; ); set_window  ( &quot;Flight Reservation&quot; ,  22 ); menu_select_item  ( &quot;File;Exit&quot; ); } ddt_close (table); so that it will: 2. Modify Test to Read from Data Table What Does the DataDriver Do? Open the Data Table and check that it was successfully opened   1 invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window  ( &quot;Login&quot; ,  10 ); edit_set  ( &quot;Agent Name:&quot; ,  &quot;Catherine&quot; ); password_edit_set ( &quot;Password:&quot; ,  &quot;kzptnyoslzjsaz&quot; ); button_press  ( &quot;OK&quot; ); set_window  ( &quot;Flight Reservation&quot; ,  22 ); menu_select_item  ( &quot;File;Exit&quot; );
Open the Data Table and check that it was successfully opened   1 table =  &quot;default.xls&quot; ;  rc =  ddt_open (table, DDT_MODE_READ); if  (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row =  1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window  ( &quot;Login&quot; ,  10 ); edit_set  ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press  ( &quot;OK&quot; ); set_window  ( &quot;Flight Reservation&quot; ,  22 ); menu_select_item  ( &quot;File;Exit&quot; ); } ddt_close (table); The DataDriver Wizard will convert your baseline script so that it will: 2. Modify Test to Read from Data Table What Does the DataDriver Do? Add a loop to read  through all your data rows 2
table =  &quot;default.xls&quot; ;  rc =  ddt_open (table, DDT_MODE_READ); if  (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row =  1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window  ( &quot;Login&quot; ,  10 ); edit_set  ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press  ( &quot;OK&quot; ); set_window  ( &quot;Flight Reservation&quot; ,  22 ); menu_select_item  ( &quot;File;Exit&quot; ); } ddt_close (table); Open the Data Table and check that it was successfully opened   1 The DataDriver Wizard will convert your baseline script so that it will: 2. Modify Test to Read from Data Table What Does the DataDriver Do? Add a loop to read  through all your data rows 2 Parameterize data values so that it reads from the Data Table 3
2. Modify Test to Read from Data Table What Does the DataDriver Do? table =  &quot;default.xls&quot; ;  rc =  ddt_open (table, DDT_MODE_READ); if  (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row =  1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window  ( &quot;Login&quot; ,  10 ); edit_set  ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press  ( &quot;OK&quot; ); set_window  ( &quot;Flight Reservation&quot; ,  22 ); menu_select_item  ( &quot;File;Exit&quot; ); } ddt_close (table); Open the Data Table and check that it was successfully opened   1 The DataDriver Wizard will convert your baseline script so that it will: Add a loop to read  through all your data rows 2 Parameterize data values so that it reads from the Data Table 3 Close the Data Table 4
2. Modify Test to Read from Data Table Running the DataDriver Wizard invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, ”Catherine&quot;); password_edit_set (&quot;password&quot;,  “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); 1.  Highlight area you want  to be data driven. 2.  Start the DataDriver  Wizard. invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, ”Catherine&quot;); password_edit_set (&quot;password&quot;,  “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); 1 2
2. Modify Test to Read from Data Table Running the DataDriver Wizard Final Result table  = &quot; default.xls &quot;;   rc = ddt_open( table , DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause(&quot;Cannot open table.&quot;); ddt_get_row_count( table , table_RowCount); for(table_Row = 1; table_Row <= table_RowCount; table_Row ++) { ddt_set_row( table ,table_Row); invoke_application(&quot;D:flight1a.exe&quot;,&quot;&quot;,&quot;&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;Agent Name:&quot;,ddt_val( table ,&quot;Agent_Name&quot;)); password_edit_set(&quot;Password:&quot;,ddt_val( table ,&quot;Password&quot;)); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 22); menu_select_item (&quot;File;Exit&quot;); } ddt_close( table );
2. Modify Test to Read from Data Table Running the DataDriver Wizard Where does the Data Table reside? <test   name> default.xls
2. Modify Test to Read from Data Table Running the DataDriver Wizard How do you populate the Data Table? ,[object Object],[object Object]
3. Move Data to Data Table Importing Data From Database to Data Table Database
3. Move Data to Data Table Importing Data From Database to Data Table Database
2. Modify Test to Read from Data Table Running the DataDriver Wizard edit_set (&quot;Agent Name:&quot;, “Catherine”); ? Final Result edit_set(“Agent Name:”, ddt_val(table,”Agent_Name”) );
2. Modify Test to Read from Data Table Running the DataDriver Wizard
Data Driving Tests Create a test 1 2 3 Move data to  Data Table Modify test to read from Data Table
3. Move Data to Data Table How Is Data Moved to Data Table? ,[object Object],[object Object],[object Object]
3. Move Data to Data Table Insert Data Manually Open the Data Table 1 Enter Data you want to test 2 Close Data Table and save script 3
3. Move Data to Data Table Add Data Dynamically During Run Create Invoice Test 1 mer InvoiceNum 3421 yelet phine Data Table 3423 3423 3423 . . . . . . ddt_set_val(... Update Invoice Test 2 . . . . . . edit_set(...,ddt_val ...
3. Move Data to Data Table Add Data Dynamically During Run Add column to Data Table for data to be  added 1
3. Move Data to Data Table Add Data Dynamically During Run table = &quot;default.xls&quot;;  rc = ddt_open(table, DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause(&quot;Cannot open table.&quot;); ddt_get_row_count(table,table_RowCount); for(table_Row = 1; table_Row <= table_RowCount; table_Row ++) {   ddt_set_row(table,table_Row);   set_window (&quot;Automobile Purchase Form&quot;, 2);   edit_set (&quot;Customer Name&quot;,ddt_val(table,&quot;Customer_Name&quot;));   edit_set(&quot;Address:&quot;,ddt_val(table,&quot;Address&quot;));   edit_set (&quot;License&quot;,ddt_val(table,&quot;License&quot;));   obj_mouse_click (&quot;Method of Payment&quot;, 23, 13, LEFT);   button_set (ddt_val(table,&quot;Cash&quot;), ON);   list_select_item (&quot;Make&quot;,ddt_val(table,&quot;Make&quot;));  # Item Number 0;   edit_set (&quot;Model&quot;,ddt_val(table,&quot;Model&quot;));   button_press (&quot;Insert Sale&quot;);   edit_wait_info(&quot;StatusBar&quot;,&quot;value&quot;,&quot;New Purchase Completed Successfully...&quot;,10); } ddt_close(table); Add column to Data Table for data to be added 1 ddt_set_val  ( table , “  ”,  InvoiceNumber  );   obj_get_info (&quot;Invoice No:&quot;,&quot;label&quot;, InvoiceNumber ); ddt_save  ( table ); Modify the script so  that it: 2 captures the data   and saves it to a   variable a sets the  value   in the  Data Table b saves changes  to the   Data Table c Data Table InvoiceNo
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise
[object Object],[object Object]
Lesson Objectives ,[object Object],[object Object],[object Object],[object Object]
How Do Client-Server Applications Behave? Single User Database server Server response time:
How Do Client-Server Applications Behave?  Several Users Database server Server response time:
How Do Client-Server Applications Behave?  Many Users Database server Server response time:
How Do Client-Server Applications Behave?  Example Response Times RESPONSE TIME Several users 0.61 Many users 1.00 Single user 0.33
Complete the Business Process Manually Database 07/07/01 Los Angeles Denver Cash Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Example steps
Complete the Business Process Manually Database Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Select a flight Example steps
Complete the Business Process Manually Database 07/07/01 Los Angeles Denver Cash Errol Flynn Enter Customer Name Insert Order Wait  for response before continuing Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Select a flight 7328 Close application Example steps
Manual Steps Recorded  in the Test Script edit_set   (&quot;Date&quot;,&quot;070701&quot;); list_select_item  ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item   (&quot;Fly To:&quot;, &quot;Denver&quot;); list_select_item   (&quot;Payment:&quot;, &quot;Cash&quot; ); button_press  ( &quot;Flights&quot; );  button_press  ( &quot;Insert Order&quot; ); ??? Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Enter Customer Name Insert Order Wait  for response before continuing Select a flight win_close  ( &quot;Flight Reservation&quot; ); Close the application  set_window  ( &quot;Flights Table&quot; , 4); button_press  ( &quot;OK&quot; ); Example steps edit_set  ( &quot;Customer Name:&quot; ,  &quot;Errol Flynn&quot; ); set_window  ( &quot;Flight Reservation&quot; , 10);
Why Not Insert a Wait Statement? button_press  ( &quot;Insert Order&quot; ); win_close  ( &quot;Flight Reservation&quot; ); wait  (  ); 10 50 users 5.1 seconds 500 users 9.5  seconds 1 user 3.7 seconds AVERAGE RESPONSE TIMES
Why Not Insert a Wait Statement? AUT 11.3 seconds RUN #1 Wait (10); button_press  ( &quot;Insert Order&quot; ); win_close  ( &quot;Flight Reservation&quot; ); wait  (  ); 10 button_press  ( &quot;Insert Order&quot; ); win_close  ( &quot;Flight Reservation&quot; ); wait  (  ); 15 PROBLEM: Test run failed because wait didn't last long enough  SOLUTION: Add 50% to wait time as safety cushion
Why Not Insert a Wait Statement? AUT 5.5 seconds RUN #2 Wait (15); 15 seconds button_press  ( &quot;Insert Order&quot; ); win_close  ( &quot;Flight Reservation&quot; ); wait  (  ); 15 PROBLEM: Most of the wait time was unnecessary  SOLUTION: Don't use a wait statement – use something that will continue as soon a s the AUT is finished. But what will do that? button_press  ( &quot;Insert Order&quot; ); win_close  ( &quot;Flight Reservation&quot; ); ???
What Is a Synchronization Point? A synchronization point is a line in the test script that instructs WinRunner to wait for a certain response from the application during playback, just as a real user would. Definition:
ADD SYNCHRONIZATION POINTS Introduction to Synchronization Add Synchronization Points Record user actions in script 1 Synchronize script to application under test 2 Add verification statements to check AUT 3 Run test or suite of tests 4
Process to Add Synchronization Points Add Synchronization Points Establish visual cues to synchronize 1 Determine type of synchronization point 2 Add  synchronization point to test script 3 Play back revised script 4
Establish Visual Cue to Synchronize Examples 1 Wait for a bitmap to refresh BITMAP Wait for a window WINDOW Wait for an object state OBJECT STATE
Methods of Synchronization  obj_wait_info (&quot;Bar&quot;,&quot;label&quot;, &quot;Insert Done...&quot;, 20); Wait for an object state/property value obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); Wait for a bitmap set_window (&quot;Flight Reservation&quot;, 20); Wait for a window
Determine Type of Synchronization (Waiting for a Window) 2 Window name Time set_window (&quot;Flight Reservation&quot;, 20); Wait for main window to appear after login
Properties of Standard GUI Objects (Examples) Boolean Values 0 = False 1 = True State 3 State 2 State 1 class: push_button, focused: 1, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 0
Properties of Standard GUI Objects (Examples) Boolean Values 0 = False 1 = True State 3 State 2 State 1 class: list, focused: 1, value: &quot;Paris&quot; class: list, focused: 0, value: &quot;Los Angeles&quot; class: list, focused: 0, value: &quot;&quot; class: push_button, focused: 1, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 0
Properties of Standard GUI Objects (Examples) Boolean Values 0 = False 1 = True State 3 State 2 State 1 class: list, focused: 1, value: &quot;Paris&quot; class: list, focused: 0, value: &quot;Los Angeles&quot; class: list, focused: 0, value: &quot;&quot; class: push_button, focused: 1, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 0 class: radio_button, focused: 1, value: 1 class: radio_button, focused: 0, value: 1 class: radio_button, focused: 0, value: 0
Determine Type of Synchronization (Change in Object Property/State) 2 obj_wait_info (&quot;Bar&quot;,&quot;label&quot;, &quot;Insert Done...&quot;, 20); Object name Object property Synchronize with a progress bar message
Determine Type of Synchronization (Change in Object Property/State) 2 obj_wait_info (&quot;Bar&quot;,&quot;label&quot;, &quot;Insert Done...&quot;, 20); value Time Synchronize with a progress bar message
Determine Type of Synchronization (Waiting for a Bitmap) 2 obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); Object name Bitmap name Sync with browser loading a bitmap
Determine Type of Synchronization (Waiting for a Bitmap) 2 obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); Time x  ,  y Sync with browser loading a bitmap
Determine Type of Synchronization (Waiting for a Bitmap) 2 obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); width height Img1.bmp Bitmap File Location: Test_name exp Test_name Sync with browser loading a bitmap
How Long Does It Wait? &quot;OK&quot; &quot;Error&quot; TIME PARAMETER Global timeout setting Global timeout interval GLOBAL + Test run 1 TOTAL = Maximum total timeout Synchronization statement timeout parameter Script continues Script continues Test run 2
Add Synchronization to Test Script Wait for a Window 3 # Login set_window  ( &quot;Login&quot; ,4); edit_set  ( &quot;Agent Name:&quot;, &quot;mercury&quot; ); password_edit_set  ( &quot;Password:&quot;,&quot;kjzisllz&quot; ); button_press  ( &quot;OK&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; , 25 ); Locate the TSL statement that points to the determined visual cue 1
Add Synchronization to Test Script Wait for a Window # Login set_window  ( &quot;Login&quot; ,4); edit_set  ( &quot;Agent Name:&quot;, &quot;mercury&quot; ); password_edit_set  ( &quot;Password:&quot;,&quot;kjzisllz&quot; ); button_press  ( &quot;OK&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; , 25 ); 3 Recorded time parameter reflects delay during script recording session 60 Locate the TSL statement that points to the determined visual cue 1 Modify timeout parameter to allow ample time for window to appear 2
Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item  ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item  ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window  ( &quot;Flights Table&quot; ,2); list_activate_item  ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; ,3); edit_set  ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press  ( &quot;Insert Order&quot; ); 3 Locate the line in the script to insert the synchronization point 1
Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item  ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item  ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window  ( &quot;Flights Table&quot; ,2); list_activate_item  ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; ,3); edit_set  ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press  ( &quot;Insert Order&quot; ); 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item  ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item  ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window  ( &quot;Flights Table&quot; ,2); list_activate_item  ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; ,3); edit_set  ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press  ( &quot;Insert Order&quot; ); 3 Using the Hand pointer, click on the object to synchronize 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item  ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item  ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window  ( &quot;Flights Table&quot; ,2); list_activate_item  ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; ,3); edit_set  ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press  ( &quot;Insert Order&quot; ); 3 &quot;Progress Bar&quot; Select the object attribute that will contain the value of the visual cue 4 Using the Hand pointer, click on the object to synchronize 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item  ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item  ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window  ( &quot;Flights Table&quot; ,2); list_activate_item  ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window  ( &quot;Flight Reservation&quot; ,3); edit_set  ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press  ( &quot;Insert Order&quot; ); 3 obj_wait_info ( &quot;Progress Bar&quot; ,  &quot;label&quot; ,  &quot;Insert Done…”, 10); &quot;Progress Bar&quot; Click the  Paste  button in Wait for object window 5 Select the object attribute that will contain the value of the visual cue 4 Using the Hand pointer, click on the object to synchronize 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
Add Synchronization to Test Script Wait for a Bitmap Area 3 # Mercury Homepage set_window  (  &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com”  ); obj_mouse_click (  &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); Locate the line in the script to insert the synchronization point 1
Add Synchronization to Test Script Wait for a Bitmap Area # Mercury Homepage set_window  (  &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com”  ); obj_mouse_click (  &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); 3 Select Create > Synchronization Point > For Screen Area Bitmap 2 Locate the line in the script to insert the synchronization point 1
Add Synchronization to Test Script Wait for a Bitmap Area 3 # Mercury Homepage set_window  (  &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com”  ); obj_mouse_click (  &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); Click left mouse button and drag pointer to select area; press right button to complete selection 3 Select Create > Synchronization Point > For Screen Area Bitmap 2 Locate the line in the script to insert the synchronization point 1
Add Synchronization to Test Script Wait for a Bitmap Area 3 # Mercury Homepage set_window  (  &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com”  ); obj_wait_bitmap  ( &quot;mpage&quot;,&quot;Img2&quot; ,6,7,8,101,114); obj_mouse_click (  &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); TSL statement appears in script 4 Locate the line in the script to insert the synchronization point 1 Click left mouse button and drag pointer to select area; press right button to complete selection 3 Select Create > Synchronization Point > For Screen Area Bitmap 2
Other Object State Synchronization Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Play Back Revised Script 4 edit_set (&quot;Date&quot;,&quot;070703&quot;); list_select_item (&quot;Fly From:&quot;, &quot;Los Angeles&quot;); button_press  ( &quot;Flights&quot; ); set_window (&quot;Flights Table&quot;, 4); list_activate_item (&quot;Flight&quot;, . . .) edit_set  ( &quot;Customer Name:&quot;, &quot;Errol Flynn&quot; ); button_press  ( &quot;Insert Order&quot; ); obj_wait_info  ( &quot;ProgressBar&quot;,&quot;label&quot;, &quot;Insert Done...&quot; ,10); 07/07/03 Los Angeles Denver Cash edit_set  ( &quot;Date&quot;,&quot;070703&quot; ); list_select_item  ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item  ( &quot;Fly To:&quot;, &quot;Denver&quot; ); list_select_item  ( &quot;Payment:&quot;, &quot;Cash&quot; ); set_window  ( &quot;Flights Table&quot; , 4); list_activate_item  ( &quot;Flight&quot; , . . .);
Play Back Revised Script 4 07/07/03 Los Angeles Denver Cash edit_set (&quot;Date&quot;,&quot;070703&quot;); list_select_item (&quot;Fly From:&quot;, &quot;Los Angeles&quot;); list_select_item (&quot;Payment:&quot;, &quot;Cash&quot;); button_press  ( &quot;Flights&quot; ); edit_set  ( &quot;Customer Name:&quot; ,  &quot;Errol Flynn&quot; ); button_press  ( &quot;Insert Order&quot; ); set_window (&quot;Flights Table&quot;, 4); list_activate_item (&quot;Flight&quot;, . . .) obj_wait_info  ( &quot;ProgressBar&quot;,&quot;label&quot;, &quot;Insert Done...&quot; ,10); 07/07/03 edit_set  ( &quot;Date&quot;,&quot;070703&quot; ); list_select_item  ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item  ( &quot;Fly To:&quot;, &quot;Denver&quot; ); list_select_item  ( &quot;Payment:&quot;, &quot;Cash&quot; ); set_window  ( &quot;Flights Table&quot; , 4); list_activate_item  ( &quot;Flight&quot; , . . .);
Play Back Revised Script 4 edit_set  ( &quot;Date&quot;,&quot;070703&quot; ); list_select_item  ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item  ( &quot;Fly To:&quot;, &quot;Denver&quot; ); list_select_item  ( &quot;Payment:&quot;, &quot;Cash&quot; ); button_press  ( &quot;Flights&quot; ); edit_set  ( &quot;Customer Name:&quot;, &quot;Errol Flynn&quot; ); button_press  ( &quot;Insert Order&quot; ); obj_wait_info( &quot;ProgressBar&quot;,&quot;label&quot;, &quot;Insert Done...&quot; ,10); set_window  ( &quot;Flights Table&quot; , 4); list_activate_item  ( &quot;Flight&quot; , . . .); . . . Errol Flynn 07/07/03 101
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LAB EXERCISE
[object Object],[object Object]
Enhancing Your Test Using TSL   Test Script Language
Enhancing Your Test Using TSL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is TSL ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variables and Constants ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variables and Constants    Variable and Constant Names: -  letters, numbers, underscore -  first character must be a letter   or an underscore -  case sensitive # Constant declarations public const  GUI_FILE_PATH  = “c:testsguifiles”; public const  AUT_PATH  = “c:appbin”; public const  E_MY_ERROR_CODE  = -12345; # Variable declarations static  lineCounter ;  public  flightVersion  = “Flight1a.exe”; Test Script 1 Examples GUI_load ( GUI_FILE_PATH  & “myFile.gui”); invoke_application ( AUT_PATH  &  flightVersion , ““,  AUT_PATH , SW_SHOW); ... rc  = my_function (); if (rc ==  E_MY_ERROR_CODE ) ... Test Script 2
Variables and Constants  Strings and Numbers number1 =  &quot;4&quot; ; number2 =  3 ; value = number1 * number2; value contains 12 cost =  &quot;10 Dollars&quot; ; amount =  “The price is “  & cost +  5 ; amount contains “The price is 15” value_a =  &quot;3.3&quot; ; value_b =  &quot;2,5&quot; ; result_a = value_a *  2 ; result_b = value_b *  4 ; result_a contains 6.6 result_b contains 8 Sample 1 Sample 2 Sample 3 WinRunner can convert strings to numbers and vice versa! If a string is converted to a number, WinRunner cuts off all following non-numeric characters!
Variables and Constants  Special Characters in Strings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],value =  &quot;This is a amp;quot;Stringamp;quot; with very special character&quot; ; pause ( value );
Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arrays Simple Array fltclass[ 1 ]=  &quot;First&quot; ; fltclass[ 2 ]=  &quot;Business&quot; ; fltclass[ 3 ]=  &quot;Economy&quot; ; # Data Window set_window  (  &quot;Data Window&quot; ,  1  ); edit_get_text (  &quot;Class Number:&quot; , class ); # Flight Reservation set_window  (  &quot;Flight Reservation&quot; ,  1  ); button_set  ( fltclass[class] , ON ); Sample
Arrays Associative Array userdata[ &quot;name&quot; ]=  &quot;John Smith&quot; ; userdata[ &quot;address&quot; ]=  &quot;1234 Main Street&quot; ; userdata[ &quot;zip&quot; ]=  98711 ; userdata[ &quot;city&quot; ]=  &quot;Hometown &quot; ; # Customer Information Window set_window  (  ”Customer Information Window&quot; ,  1  ); edit_set (  &quot;Name:&quot; , userdata[ &quot;name&quot; ] ); edit_set (  &quot;Address:&quot; , userdata[ &quot;address&quot; ] ); edit_set (  &quot;City:&quot; , userdata[ &quot;zip&quot; ] &  &quot;, &quot;  & userdata[ &quot;city&quot; ] ); Sample
Arrays Multi-dimensional Arrays flightinfo[  1 ,  &quot;Date”  ] =  &quot;07/22/99&quot; ; flightinfo[  1 ,  &quot;FlyFrom”  ] =  &quot;Los Angeles&quot; ; flightinfo[  1 ,  &quot;FlyTo”  ] =  &quot;Denver&quot; ; flightinfo[  1 ,  &quot;Flight No”  ] =  &quot;4300&quot; ; flightinfo[  2 ,  &quot;Flight No”  ] =  &quot;1234&quot; ; flightinfo[  3 ,  &quot;Flight No”  ] =  &quot;9999&quot; ; Example: Multi-dimensional Array Date Fly From Fly To Flight No 1 2 3 07/22/99 09/28/01 12/26/02 Los Angeles Seattle Dallas Detroit Portland Denver 4300 1234 9999 Multi-dimensional Arrays; Data in table format
Flow Control ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Flow Control  Conditional Decision Making set_window (“Flight Reservation”); obj_get_info (“Order No:”, “value”, OrderNo); if (  OrderNo == “ ” ) report_msg (“No order number.”); else button_press (“Update Order”); set_window (“Flight Reservation”); obj_get_info (“Order No:”, “value”, OrderNo); if (  OrderNo == “ ” )  { report_msg (“No order number.”); } else   { button_press (“Update Order”); } win_get_text(”Flight Info”, version, 42, 68, 159, 89); if (  version != “Version 1.0”  ) { report_msg (“Wrong Version!”); texit; } Example 2 Best practice: always set curly brackets Example 1
Flow Control switch Statement set_window (&quot;Fax Order&quot;); edit_get_text (&quot;Class:&quot;, class); switch  (class)  { case &quot;Economy&quot;: result = PASS; message=&quot;Correct class: Economy&quot;; break; case &quot;Business&quot;: result = FAIL; message=&quot;Wrong class: Business&quot;; break; case &quot;First&quot;: result = FAIL; message=&quot;Wrong class: First&quot;; break; } tl_step (“Class of Service”, result, message); Example
Flow Control for Loop # Looping for stress testing for (i=0; i<1000; i++) { set_window (“Flight Reservation”); menu_select_item (&quot;File;Fax Order...&quot;); set_window (&quot;Fax Order&quot;); edit_set (&quot;Fax Number:&quot;, “4085551212”); button_press (”Send&quot;); set_window (“Flight Reservation”); obj_wait_info (“StatusBar”, “label”, “Fax Sent”, 50); }   Example
Flow Control  while Loop file= &quot;c:dataflight_orders.txt&quot;; file_open( file, FO_MODE_READ ); while ( file_getline( file, line ) == E_OK ) { ord_num= substr( line, 0, 5 ); open_order( ord_num ); report_msg( &quot;Opened Order &quot; & ord_num ); } file_close( file ); The statements in this  while  loop will not be executed if the condition is not TRUE (if the file cannot be opened) Example
Flow Control  do while Loop # Flight Reservation set_window ( &quot;Flight Reservation&quot;, 2 ); edit_set ( &quot;Name:&quot;, &quot;&quot; ); new_len=0; do { old_len= new_len; edit_type( &quot;Name:&quot;, &quot;123&quot; ); edit_get_info( &quot;Name:&quot;, &quot;value&quot;, value ); new_len= length( value ); } while( old_len < new_len ); report_msg( &quot;Max Name length ” & new_len & &quot; characters&quot; ); The statements in this  while  loop are executed at least once. Example
Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Operators Arithmetic/Relational edit_get_text (&quot;Tickets&quot;, tickets);  edit_get_text (&quot;Price&quot;, price); edit_get_text (&quot;Total&quot;, total); if (  tickets * price == total  ) tl_step (“Total”, PASS, “Correct Total”); else { tl_step (“Total”, FAIL, &quot;Wrong Total&quot;); report_msg(“Expected Value: ” & tickets * price); report_msg(“Actual Value: ” & total ); } Best Practice: For complicated calculations, check values in the AUT against pre-calculated values in a data table or data file Example
Operators Logical Operators # Value is greater than 50 AND less than 100 if ( value > 50  &&  value <100 ) tl_step (“Value tested”, PASS, “Correct Value”); Logical AND # Value equals Saturday OR value equals Sunday if ( value== “Saturday”  ||  value== “Sunday” ) tl_step (“Value tested”, PASS, “ it’s Weekend !”); Logical OR # Value is equal to or greater than 1 AND less than or equal to 10 # AND value IS NOT 5 if ( value >=1  &&  value <=10  &&  value  !=  5 ) tl_step (“Value tested ”, PASS, “is between 1-10 and not 5”); Combination
TSL Testing Functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
TSL Testing Functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Examples
Important TSL Functions Invoking an Application ,[object Object],[object Object],app_path= “c:mercurywinrunnersamples”; invoke_application  (app_path & “flight1a.exe”,“”, app_path, SW_SHOW); Example
Important TSL Functions Checking for a Window ,[object Object],[object Object],If ( win_exists ( “Flight Message” ) == E_OK ) {  set_window( “Flight Message”, 2 ); button_press( “OK” ); } Example
Important TSL String Functions Splitting a String ,[object Object],[object Object],set_window(&quot;Flights Table&quot;, 1);  list_get_item(&quot;Flight&quot;,num, flight); split  ( flight, values, &quot; &quot;); if( values[1] == flight_num ) { Example
Important TSL Functions Accessing DOS ,[object Object],[object Object],dos_system  ( &quot;del c:demo.tmp” );  Example
Important TSL Functions Input/Output ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],Output to Test Report & TestDirector win_get_text (&quot;File Name&quot;, text,  247, 309, 427, 329); if (text == &quot;letter.doc&quot;) tl_step  (“Verify Text”,  PASS , “Correct text”); else tl_step  (“Verify Text”,  FAIL , “Wrong text: ” & text ); Example
Output to Report report_msg Statement ,[object Object],[object Object],edit_get_text (&quot;File Name&quot;, val ); if (val != &quot;letter.doc&quot;) { report_msg  (&quot;Error: Illegal file name: ” & val & “ Test Aborted&quot;); } Example
[object Object],Accessing Functions The Function Generator ,[object Object],[object Object],[object Object]
Accessing Functions The Editor # Automobile Purchase Form set_window ( &quot;Automobile Purchase Form&quot; , 10); edit_set  ( &quot;Customer Name&quot; ,  &quot;Thomas Paine&quot; ); edit_ edit_set ,[object Object],[object Object],[object Object],[object Object]
Accessing Functions The Editor # Automobile Purchase Form set_window ( &quot;Automobile Purchase Form&quot; , 10); edit_set  ( &quot;Customer Name&quot; ,  &quot;Thomas Paine&quot; ); edit_set edit_set  ( edit_set  ( ”Password”, “Mercury”  ,[object Object],edit_set (Edit Object, New String) edit_set  ( ”Password”, “Mercury”  );
Using Return Codes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Example 2 Example 1
Debugging Tests ,[object Object],[object Object],[object Object],[object Object]
Debugging Tests pause Statement ,[object Object],[object Object],Capital = &quot;Sacramento&quot;; pause  (&quot;The capital of California is &quot; & Capital);
Comments ,[object Object],[object Object],[object Object],################################################################## # Test Name: Verify Login # # Test Developer: John Doe # # Purpose: This test verifies that the login procedure… # # Date: 12.12.97 # # Date of Last Revision: 2.14.98 # ################################################################## # Performing a login to AUT set_window (“Login”); edit_set (“Login Name”, name);  # name stores the actual login name Example You can insert comments either during recording or after recording
Creating a Startup Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Creating a Startup Script ############################################ #  TestSuite Training Init Test  # ############################################ # Loading the prepared GUI file GUI_load  ( getvar  ( &quot;testname&quot; )& &quot;flight60.gui&quot; ); # Configure the MS Mask object to map to edit objec # Data of Flight recording depends on this set_class_map ( &quot;MSMaskWndClass&quot; ,  &quot;edit&quot; ); set_record_attr ( &quot;MSMaskWndClass&quot; ,  &quot;class attached_t set_record_method ( &quot;MSMaskWndClass&quot; , RM_RECORD); # Configure the status bar in the GUI Map set_class_map ( &quot;AfxWnd40&quot; ,  &quot;object&quot; ); set_record_attr ( &quot;AfxWnd40&quot; ,  &quot;class regexp_MSW_class S:estProjectnitScript WinRunner - [InitScript] Create a startup script in WinRunner.   1 Open the General Options window and click the Environment tab.   2 Enter the path where you saved your startup script in the  Startup test  box.  3
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LAB EXERCISE
[object Object],[object Object],[object Object]

More Related Content

What's hot

Android architecture
Android architectureAndroid architecture
Android architecturepoojapainter
 
Logging, Serilog, Structured Logging, Seq
Logging, Serilog, Structured Logging, SeqLogging, Serilog, Structured Logging, Seq
Logging, Serilog, Structured Logging, SeqDoruk Uluçay
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsDamien Dallimore
 
Developing AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityDeveloping AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityMark Billinghurst
 
User Interface Design Chapter 2 Galiz
User Interface Design Chapter 2 GalizUser Interface Design Chapter 2 Galiz
User Interface Design Chapter 2 GalizLatesh Malik
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows ProgramsCNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows ProgramsSam Bowne
 
Unit 2 Virtualization Part I.pptx
Unit 2 Virtualization Part I.pptxUnit 2 Virtualization Part I.pptx
Unit 2 Virtualization Part I.pptxNayanrai14
 
Server virtualization
Server virtualizationServer virtualization
Server virtualizationofsorganizer
 
Hosting a website on IIS Server
Hosting a website on IIS ServerHosting a website on IIS Server
Hosting a website on IIS ServerDinesh Vasamshetty
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsWebStackAcademy
 
Sql Considered Harmful
Sql Considered HarmfulSql Considered Harmful
Sql Considered Harmfulcoderanger
 
Hardware virtualization basic
Hardware virtualization basicHardware virtualization basic
Hardware virtualization basicSanoj Kumar
 

What's hot (20)

Virtual Machine
Virtual MachineVirtual Machine
Virtual Machine
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Logging, Serilog, Structured Logging, Seq
Logging, Serilog, Structured Logging, SeqLogging, Serilog, Structured Logging, Seq
Logging, Serilog, Structured Logging, Seq
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
 
Developing AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityDeveloping AR and VR Experiences with Unity
Developing AR and VR Experiences with Unity
 
User Interface Design Chapter 2 Galiz
User Interface Design Chapter 2 GalizUser Interface Design Chapter 2 Galiz
User Interface Design Chapter 2 Galiz
 
Azure Service Fabric
Azure Service FabricAzure Service Fabric
Azure Service Fabric
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows ProgramsCNIT 126 Ch 7: Analyzing Malicious Windows Programs
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
 
Introduction to virtualization
Introduction to virtualizationIntroduction to virtualization
Introduction to virtualization
 
Unit 2 Virtualization Part I.pptx
Unit 2 Virtualization Part I.pptxUnit 2 Virtualization Part I.pptx
Unit 2 Virtualization Part I.pptx
 
Server virtualization
Server virtualizationServer virtualization
Server virtualization
 
Hosting a website on IIS Server
Hosting a website on IIS ServerHosting a website on IIS Server
Hosting a website on IIS Server
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
 
Sql Considered Harmful
Sql Considered HarmfulSql Considered Harmful
Sql Considered Harmful
 
Virtual machine
Virtual machineVirtual machine
Virtual machine
 
Hardware virtualization basic
Hardware virtualization basicHardware virtualization basic
Hardware virtualization basic
 
Grafana.pptx
Grafana.pptxGrafana.pptx
Grafana.pptx
 

Viewers also liked

Win runner testing tool
Win runner testing toolWin runner testing tool
Win runner testing toolmansirajpara
 
Load runner & win runner
Load runner & win runnerLoad runner & win runner
Load runner & win runnerHimanshu
 
Qtp realtime scripts
Qtp realtime scriptsQtp realtime scripts
Qtp realtime scriptsRamu Palanki
 
Diff between win runner vs and qtp
Diff between win runner vs and qtpDiff between win runner vs and qtp
Diff between win runner vs and qtpRamu Palanki
 
Basic Differences Between Winrunner And Qtp
Basic Differences Between Winrunner And QtpBasic Differences Between Winrunner And Qtp
Basic Differences Between Winrunner And Qtpwlxfeedpartner1
 
Qtp 92 Tutorial
Qtp 92 TutorialQtp 92 Tutorial
Qtp 92 Tutorialsasidhar
 
QTP Training by INFOTECH
QTP Training by INFOTECHQTP Training by INFOTECH
QTP Training by INFOTECHPravinsinh
 
Niyati_Manual_Testing_ISTQB_Certified_Resume
Niyati_Manual_Testing_ISTQB_Certified_ResumeNiyati_Manual_Testing_ISTQB_Certified_Resume
Niyati_Manual_Testing_ISTQB_Certified_ResumeNiyati Madad
 
Manual Testing
Manual TestingManual Testing
Manual TestingG.C Reddy
 

Viewers also liked (14)

Win runner testing tool
Win runner testing toolWin runner testing tool
Win runner testing tool
 
Load runner & win runner
Load runner & win runnerLoad runner & win runner
Load runner & win runner
 
Winrunner
WinrunnerWinrunner
Winrunner
 
Winrunner
WinrunnerWinrunner
Winrunner
 
Qtp realtime scripts
Qtp realtime scriptsQtp realtime scripts
Qtp realtime scripts
 
Diff between win runner vs and qtp
Diff between win runner vs and qtpDiff between win runner vs and qtp
Diff between win runner vs and qtp
 
Basic Differences Between Winrunner And Qtp
Basic Differences Between Winrunner And QtpBasic Differences Between Winrunner And Qtp
Basic Differences Between Winrunner And Qtp
 
Qtp 92 Tutorial
Qtp 92 TutorialQtp 92 Tutorial
Qtp 92 Tutorial
 
QTP Training by INFOTECH
QTP Training by INFOTECHQTP Training by INFOTECH
QTP Training by INFOTECH
 
Ppt Qtp
Ppt QtpPpt Qtp
Ppt Qtp
 
Load Runner
Load RunnerLoad Runner
Load Runner
 
Niyati_Manual_Testing_ISTQB_Certified_Resume
Niyati_Manual_Testing_ISTQB_Certified_ResumeNiyati_Manual_Testing_ISTQB_Certified_Resume
Niyati_Manual_Testing_ISTQB_Certified_Resume
 
Manual Testing
Manual TestingManual Testing
Manual Testing
 
Film Genres
Film GenresFilm Genres
Film Genres
 

Similar to WinRunner Training

Android testing
Android testingAndroid testing
Android testingBitbar
 
Event driven theory
Event driven theoryEvent driven theory
Event driven theorynickywalters
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docPalakjaiswal43
 
Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0DivyaR219113
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2Shem Magnezi
 
Lijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunnerLijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunnerLijie Xia
 
Testing project (basic)
Testing project (basic)Testing project (basic)
Testing project (basic)Lokesh Singrol
 
Mobile testing. Xamarin.UITest approach
Mobile testing. Xamarin.UITest approachMobile testing. Xamarin.UITest approach
Mobile testing. Xamarin.UITest approachVolodymyr Kimak
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation toolsSSGMCE SHEGAON
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
What is Android?
What is Android?What is Android?
What is Android?ndalban
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosFlutter Agency
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introductionbloodyedge03
 
automation framework
automation frameworkautomation framework
automation frameworkANSHU GOYAL
 
Android testing
Android testingAndroid testing
Android testingJinaTm
 

Similar to WinRunner Training (20)

Testing
Testing Testing
Testing
 
2.5 gui
2.5 gui2.5 gui
2.5 gui
 
Coded ui test
Coded ui testCoded ui test
Coded ui test
 
Android testing
Android testingAndroid testing
Android testing
 
Event driven theory
Event driven theoryEvent driven theory
Event driven theory
 
Qtp day 2
Qtp day 2Qtp day 2
Qtp day 2
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2
 
Lijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunnerLijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunner
 
Testing project (basic)
Testing project (basic)Testing project (basic)
Testing project (basic)
 
Mobile testing. Xamarin.UITest approach
Mobile testing. Xamarin.UITest approachMobile testing. Xamarin.UITest approach
Mobile testing. Xamarin.UITest approach
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation tools
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
What is Android?
What is Android?What is Android?
What is Android?
 
06 win forms
06 win forms06 win forms
06 win forms
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
 
automation framework
automation frameworkautomation framework
automation framework
 
Android testing
Android testingAndroid testing
Android testing
 

Recently uploaded

Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxAndy Lambert
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst SummitHolger Mueller
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Neil Kimberley
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...Suhani Kapoor
 

Recently uploaded (20)

Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst Summit
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
 

WinRunner Training

  • 1.
  • 2. Benefits of Automated Testing WinRunner Testing Process WinRunner Recording Mode Working with other Test Suite Tools
  • 3.
  • 4. Benefits of Automated Testing Fast: Run tests significantly faster than human users Reliable: Tests perform precisely the same operations each time they are run, thereby eliminating human error Repeatable: You can test how the software reacts under repeated execution of the same operations Programmable: You can program sophisticated tests that bring out hidden information from the application Comprehensive: You can build a suite of tests that covers every feature in your application Reusable: You can reuse tests on different versions of an application, even if the user interface changes
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 13.
  • 14.
  • 15. Benefits of Automated Testing WinRunner Testing Process WinRunner Recording Mode Working with other Test Suite Tools
  • 16.
  • 17.
  • 19.
  • 20.
  • 21. How Does WinRunner Create the Script?
  • 22.
  • 23.
  • 24.
  • 25. How Does WinRunner Identify an Object? John ******* WinRunner uses an object’s physical attributes to identify the object Displayed label class MSW_class x y abs_x abs_y maximizable focused width height active MSW_id handle minimizable nchildren enabled TOOLKIT_class ATTRIBUTES
  • 26. How Does WinRunner Uniquely Identify an Object? John ******* WR uses the minimum number of static attributes to achieve unique identification label class Class: push_button Label: “OK”
  • 27. How Does WinRunner Assign Object Names? John ******* WinRunner assigns a short name to each object called the logical name Class: push_button Label: “OK” button_press (“ OK ”); edit_set (“ Name ”, “John”); edit_set (“ Password ”, “mercury”);
  • 28. Into Which Field Will WinRunner Play Back? set_window(&quot;Login&quot;, 10); edit_set (&quot;Name:&quot;, &quot;John&quot;); John ? ?
  • 29. Scope of Identification edit_set (&quot;Name:&quot;, &quot;John&quot;); John WinRunner identifies an object within the scope of its parent window (not the entire application) set_window (&quot;Login&quot;, 10);
  • 30.
  • 31.
  • 32.
  • 33. GUI Map Translates Logical Names Into Physical Descriptions Options Class: Window Label: Window Dealer Name Class: Edit label: DealerName Address Class: Window Label: Address Login Class: Window Label: Login Automobile Purchase Form Class: Window Label: APF Customer Name Class: Edit label: CustomerName Make Class: Window Label: Make SCRIPT GUI MAP AUT set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Address&quot;,&quot;234 Willow Drive&quot;); edit_set (&quot;Customer Name&quot;, &quot;Thomas Paine&quot;); Logical Name Physical Description
  • 34. Recording Example Application GUI Map Logical Physical { class: window, MSW_id: 3277 label: &quot;Save As&quot; } { class: push_button, label: &quot;OK&quot; } &quot;Save As&quot; &quot;OK&quot; set_window (&quot;Save As&quot;, 1); button_press (&quot;OK&quot;); Test Script WinRunner
  • 35.
  • 36.
  • 37. Techniques For Managing GUI Map Files Technique 1 One GUI Map file per test Technique 2 One GUI Map file for many tests
  • 38. Object and Window Properties During Recording Name: Description: Date class: edit attached_text: &quot;Date&quot; set_window(&quot;Automobile Purchase Form&quot;, 10); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); WINDOW: Automobile Purchase Form Year class: edit attached_text: &quot;Year&quot; Make class: list attached_text: &quot;Make&quot; Model class: edit attached_text: &quot;Model&quot; edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); WinRunner stores the names and descriptions for windows and objects in a temporary GUI Map file Temporary GUI Map file Technique 1
  • 39. What Happens to These Properties? Use the GUI Map Editor to save the contents of the Temporary GUI Map file to a permanent GUI Map file Technique 1 Temporary GUI Map file Name: Description: Date class: edit attached_text: &quot;Date&quot; WINDOW: Automobile Purchase Form Year class: edit attached_text: &quot;Year&quot; Make class: list attached_text: &quot;Make&quot; Model class: edit attached_text: &quot;Model&quot;
  • 40. Creating a Permanent GUI Map File Car_App.gui L1 Car_App.gui Insert Test1 Test2 Testing Project Tests GUI Technique 1
  • 41. Adding New Windows and Objects to a GUI Map File Invoke the GUI Map Editor 1 Technique 1
  • 42. Adding New Windows and Objects to a GUI Map File Technique 1 Invoke the GUI Map Editor 1 Press the Expand Button to display Temporary and Permanent GUI Map files 2
  • 43. Adding New Windows and Objects to a GUI Map File Technique 1 Invoke the GUI Map Editor 1 Move contents of Temp to Permanent by pressing Move button 3 Press the Expand Button to display Temporary and Permanent GUI Map files 2
  • 44. Adding New Windows and Objects to a GUI Map File Technique 1 Save changes to permanent GUI Map file 4 Invoke the GUI Map Editor 1 Press the Expand Button to display Temporary and permanent GUI Map files 2 Move contents of Temp to permanent by pressing Move button 3
  • 45. Save Project GUI Map Files Together Insert Test1 Test2 Testing Project Tests Insert.gui L1 Insert.gui GUI Test1.gui Test2.gui Technique 1
  • 46. Techniques for Managing GUI Map Files Technique 1 One GUI Map file per test Technique 2 One GUI Map file for many tests
  • 47. Creating a Permanent GUI Map File Technique 2 Invoke the GUI Map Editor 1
  • 48. Creating a Permanent GUI Map File The cursor changes to a pointing hand Technique 2 Invoke the GUI Map Editor 1 Click the Learn Button 2
  • 49. Creating a Permanent GUI Map File The cursor changes to a pointing hand Technique 2 Invoke the GUI Map Editor 1 Click the Learn Button 2 Click on the Window to be learned 3
  • 50. Creating a Permanent GUI Map File The cursor changes to a pointing hand WinRunner learns all objects in window Technique 2 Invoke the GUI Map Editor 1 Click the Learn Button 2 Click on the Window to be learned 3
  • 51. Creating a Permanent GUI Map File The cursor changes to a pointing hand WinRunner learns all objects in window Technique 2 Invoke the GUI Map Editor 1 Click the Learn Button 2 Click on the Window to be learned 3 Repeat for all windows in the application 4
  • 52. Modify Names for Script Readability These names are unreadable. To what objects do they refer ? Technique 2
  • 53. Modify Names for Script Readability Technique 2 Highlight the object whose name you want to change 1
  • 54. Modify Names for Script Readability Technique 2 Highlight the object whose name you want to change 1 Click the Modify Button 2
  • 55. Modify Names for Script Readability Technique 2 Highlight the object whose name you want to change 1 Change the Logical Name of the object 3 Click the Modify Button 2 Click OK 4
  • 56. Modify Names for Script Readability &quot;Name:” appears in your test script during recording instead of &quot;ThunderRTTextBox_0&quot; RESULT ! Technique 2 Click OK 4 Highlight the object whose name you want to change 1 Change the Logical Name of the object 3 Click the Modify Button 2
  • 57. Creating a Permanent GUI Map File Car_App.gui L1 Car_App.gui Insert Test1 Test2 Testing Project Tests GUI Technique 2
  • 58. Which Technique Should You Use? Technique 1 Advantages 1. Each test has GUI Map file independence 2. There is no need for a GUI Map file administrator 3. The GUI Map file is very simple to create–record and save Preferred method if the application is not intended to change during renovation Technique 2 Advantages 1. Object and window names can be very readable in the test script 2. If an object or window description changes, you only have to modify one GUI Map file–all tests will play back properly Preferred method if the application might change during renovation
  • 59. Importance of the GUI Map File ? set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); What happens when playback is attempted, and the proper GUI Map file is not loaded? Automobile Purchase Form Date
  • 60. Load GUI Map File from Script GUI_load(&quot;N:Y2K_ProjGUIinsert.gui&quot;); set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); 12/12/03 BMW 1973 2002tii Insert.gui
  • 61. Unload GUI Map File from Script GUI_load(&quot;N:Y2K_ProjGUIinsert.gui&quot;); Insert.gui set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); GUI_close_all( ); 12/12/03 BMW 1973 2002tii
  • 62. Fixing the GUI Map File set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); GUI Map file Name: Description: Date class: edit MSW_id: 14
  • 63. Fixing the GUI Map File 2 set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); edit_set (&quot;Purchase Price&quot;, &quot;20000.00&quot;); 1 GUI Map file Name: Description: Date class: edit MSW_id: 14
  • 64. Use the GUI Map Editor to Fix File *L1 Insert.gui L1 Insert.gui Active GUI file: N:Y2K_ProjectGUInsert.gui Invoke the GUI Map Editor 1 Edit the description 3 Save the file 4 Highlight field and press Modify 2
  • 65. Fixing the GUI Map File 12/12 /03 set_window(&quot;Automobile Purchase Form&quot;, 10); edit_set (&quot;Date&quot;, &quot;12/12/03&quot;); list_select_item (&quot;Make&quot;, &quot;BMW&quot;); edit_set (&quot;Year&quot;, &quot;1973&quot;); edit_set(&quot;Model&quot;, &quot;2002tii&quot;); BMW 1973 2002tii ! Success WinRunner can now successfully playback the script
  • 66.
  • 67. Add GUI Map Editor to the Custom User Toolbar An icon for each command selected is added to the User Toolbar Select Settings > Customize User Toolbar 1 In each category, select command(s) to appear in toolbar 2
  • 68.
  • 70.
  • 71.
  • 72. Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text Checkpoints
  • 73. Verifying the AUT - Manual Testing PASS ? Step Step Description Expected Result 1 Select File > New SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2 Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
  • 74. Verifying the AUT - Manual Testing Step Step Description Expected Result William Frawley PASS ? 2 Enter your name The Terms button is enabled 1 Select File > New SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2 Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
  • 75. Verifying the AUT - Manual Testing Step Step Description Expected Result 2 Enter your name The Terms button is enabled 1 Select File > New William Frawley PASS ? SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2 Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
  • 76. Verifying the AUT - Automated Testing     William Frawley ? set_window (&quot;Automobile Purchase Form&quot;, 8); menu_select_item (&quot;File;New Form&quot;); edit_set (&quot;Customer Name&quot;, &quot;William Frawley&quot;); SOFTWARE REQUIREMENT SPECIFICATIONS 2.3.2 Creating a New Order Once the end user selects File > New and enters their name, the &quot;Terms&quot; button is automatically enabled.
  • 77. What Is WinRunner Verification? Definition: Verification is the process by which WinRunner reports whether expected results are actualized by the application.
  • 78. How WinRunner Verifies WinRunner compares the actual result to the stored, expected result 3 WinRunner captures an actual result during playback 2 1 WinRunner or the tester stores an expected result with the recorded test script WinRunner reports the comparison outcome as PASS or FAIL 4
  • 79. How Does a Checkpoint Work? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected AUT Actual Expected AUT Actual
  • 80. Process to Create Verification Run the recorded test script to verify correct execution 3 Test the checkpoint to ensure that it works for PASS and FAIL conditions 2 1 Capture or create the expected result within the recorded test script The tester creates the expected result only for text verification NOTE
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87. Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text Checkpoints
  • 88. How Does GUI Checkpoints Work ? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected Actual Expected Actual AUT AUT
  • 89. Process for GUI checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create GUI checkpoint 2 1 Determine the visual cue(s) Run the recorded Test Script to verify correct execution 4
  • 90. Process for GUI checkpoints 1 Determine the visual cue(s)
  • 91.
  • 92.
  • 93. Checkpoint differs depending on the object to be verified Win_check_info Window Obj_check_info Generic Object button_check_info Button(check,radio,push) list_check_info List Checkpoint function Type of Object
  • 94. Process for GUI checkpoints Create GUI checkpoint 2 1 Determine the visual cue(s)
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105. Process for GUI checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create GUI checkpoint 2 1 Determine the visual cue(s)
  • 106.
  • 107. Process for GUI checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create GUI checkpoint 2 1 Determine the visual cue(s) Run the recorded Test Script to verify correct execution 4
  • 108.
  • 109. Test directory after GUI Checkpoint Testing Project Tests chklist List1.ckl exp Test2 gui1.chk Test1 Test2
  • 110.
  • 111. Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text Checkpoints
  • 112. Database Checkpoint Definition: A test script checkpoint which verifies the schema table contains the expected data
  • 113. Flight Database Schema Flight_Number (FK) Order_Number (PK) Orders Flight_Number (PK) Flight A Foreign Key value in a table must exist as a Primary Key value in a referenced table or be null Referential Integrity
  • 114.
  • 115.
  • 116.
  • 117.
  • 118. How Does Database Checkpoint Work ? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected Actual Expected Actual AUT AUT
  • 119. Process for Database Checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Use Database Checkpoint wizard to implement the Database Checkpoint 2 1 Record User actions to create database transaction Run the recorded scripts 4
  • 120. Process for Database Checkpoints 1 Record User actions to create database transaction
  • 121. Record user actions to create a Database transaction edit_set ( &quot;Name:&quot; , &quot;Preeti&quot; ); button_press ( &quot;Insert Order&quot; ); Preeti set_window ( &quot;Flight Reservation&quot; , 7 ); edit_set ( &quot;Date of Flight:&quot; , &quot;09/06/02&quot; );
  • 122. Process for Database Checkpoints Use Database Checkpoint wizard to implement the database checkpoint 2 1 Record User actions to create database transaction
  • 123.
  • 124.
  • 125.
  • 126. Process for Database checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Use Database Checkpoint wizard to implement the database checkpoint 2 1 Record User actions to create database transaction
  • 127.
  • 128. Process for Database checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Use Database Checkpoint wizard to implement the database checkpoint 2 1 Record User actions to create database transaction Run the recorded scripts 4
  • 129.
  • 130. Test directory after Database Checkpoint Testing Project Tests chklist list1.cdl msqr1.sql exp Test2 dbvf1 Test1 Test2
  • 131.
  • 132. Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text Checkpoints
  • 133.
  • 134.
  • 135. How Does Bitmap Checkpoint Work ? 1 2 3 4 = X ? WinRunner WinRunner WinRunner WinRunner Pass Fail Test Report Expected Actual Expected Actual AUT AUT
  • 136. Process for Bitmap Checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window? Run the recorded scripts Differences are reported in Test Results and the difference Bitmap is found 4
  • 137. Process for Bitmap Checkpoints Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window?
  • 138.
  • 139.
  • 140.
  • 141. Process for Bitmap Checkpoints Test the condition to ensure that it works for Pass and Fail conditions 3 Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window?
  • 142.
  • 143.
  • 144. Process for Bitmap Checkpoints Test the Checkpoint to ensure that it works for ‘Pass’ & ‘Fail’ conditions 3 Create a Bitmap Checkpoint in the recorded Test Script 2 1 Is Bitmap verification necessary If yes verify screen area or object/window? Run the recorded scripts Differences are reported in Test Results and the difference Bitmap is found 4
  • 145.
  • 146.
  • 147. Verification GUI Checkpoints Database Checkpoints Bitmap Checkpoints Text Checkpoints
  • 148.
  • 149. Process for Text Checkpoints Insert code to compare the actual and expected value 3 Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value Insert code to report the comparison outcome to WinRunner Test Results window 4
  • 150. Process for Text Checkpoints 1 Define a variable in the script and assign the expected value
  • 151.
  • 152. Process for Text Checkpoints Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value
  • 153.
  • 154. Process for Text Checkpoints Insert code to compare the actual and expected value 3 Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value
  • 155.
  • 156. Process for Text Checkpoints Insert code to compare the actual and expected value 3 Insert a function to read the actual text from the AUT during playback 2 1 Define a variable in the script and assign the expected value Insert code to report the comparison outcome to WinRunner Test Results window 4
  • 158.
  • 160.
  • 161.
  • 162.
  • 163. What Is the Data Table? The Data Table is a spreadsheet file in WinRunner that stores the input values you will use to data-drive your test . Definition:
  • 164.
  • 165. Data Driving Tests Create a test 1 Modify test to read from Data Table 2 3 Move data to Data Table 1. Create test with data 2. Verify script is ready for data driving Create a test
  • 166. 1. Create a Test Create Test with Data invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, &quot;Josephine&quot;); password_edit_set (&quot;password&quot;, “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); Test Script
  • 167. 1. Create a Test Verify that Script Is Ready to Data Drive invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, &quot;Josephine&quot;); password_edit_set (&quot;password&quot;, “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); Does the script verify the expected results? Are all actions that involve inputting data recorded into the script? Are all synchronization points entered into the script? Are the initial and end conditions the same? ? Test Script
  • 168. Data Driving Tests Create a test 1 Move data to Data Table 3 Modify test to read from Data Table 2 Modify test to read from Data Table 1. Run DataDriver Wizard
  • 169. The DataDriver Wizard will convert your baseline script table = &quot;default.xls&quot; ; rc = ddt_open (table, DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row = 1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window ( &quot;Login&quot; , 10 ); edit_set ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press ( &quot;OK&quot; ); set_window ( &quot;Flight Reservation&quot; , 22 ); menu_select_item ( &quot;File;Exit&quot; ); } ddt_close (table); so that it will: 2. Modify Test to Read from Data Table What Does the DataDriver Do? Open the Data Table and check that it was successfully opened 1 invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window ( &quot;Login&quot; , 10 ); edit_set ( &quot;Agent Name:&quot; , &quot;Catherine&quot; ); password_edit_set ( &quot;Password:&quot; , &quot;kzptnyoslzjsaz&quot; ); button_press ( &quot;OK&quot; ); set_window ( &quot;Flight Reservation&quot; , 22 ); menu_select_item ( &quot;File;Exit&quot; );
  • 170. Open the Data Table and check that it was successfully opened 1 table = &quot;default.xls&quot; ; rc = ddt_open (table, DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row = 1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window ( &quot;Login&quot; , 10 ); edit_set ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press ( &quot;OK&quot; ); set_window ( &quot;Flight Reservation&quot; , 22 ); menu_select_item ( &quot;File;Exit&quot; ); } ddt_close (table); The DataDriver Wizard will convert your baseline script so that it will: 2. Modify Test to Read from Data Table What Does the DataDriver Do? Add a loop to read through all your data rows 2
  • 171. table = &quot;default.xls&quot; ; rc = ddt_open (table, DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row = 1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window ( &quot;Login&quot; , 10 ); edit_set ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press ( &quot;OK&quot; ); set_window ( &quot;Flight Reservation&quot; , 22 ); menu_select_item ( &quot;File;Exit&quot; ); } ddt_close (table); Open the Data Table and check that it was successfully opened 1 The DataDriver Wizard will convert your baseline script so that it will: 2. Modify Test to Read from Data Table What Does the DataDriver Do? Add a loop to read through all your data rows 2 Parameterize data values so that it reads from the Data Table 3
  • 172. 2. Modify Test to Read from Data Table What Does the DataDriver Do? table = &quot;default.xls&quot; ; rc = ddt_open (table, DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause ( &quot;Cannot open table.&quot; ); ddt_get_row_count (table,table_RowCount); for (table_Row = 1 ; table_Row <= table_RowCount; table_Row ++) { ddt_set_row (table,table_Row); invoke_application ( &quot;D:flight1a.exe&quot; , &quot;&quot; , &quot;&quot; ,SW_SHOW); set_window ( &quot;Login&quot; , 10 ); edit_set ( &quot;Agent Name:&quot; , ddt_val (table, &quot;Agent_Name&quot; )); password_edit_set ( &quot;Password:&quot; , ddt_val (table, &quot;Password&quot; )); button_press ( &quot;OK&quot; ); set_window ( &quot;Flight Reservation&quot; , 22 ); menu_select_item ( &quot;File;Exit&quot; ); } ddt_close (table); Open the Data Table and check that it was successfully opened 1 The DataDriver Wizard will convert your baseline script so that it will: Add a loop to read through all your data rows 2 Parameterize data values so that it reads from the Data Table 3 Close the Data Table 4
  • 173. 2. Modify Test to Read from Data Table Running the DataDriver Wizard invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, ”Catherine&quot;); password_edit_set (&quot;password&quot;, “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); 1. Highlight area you want to be data driven. 2. Start the DataDriver Wizard. invoke_application(“flight1a.exe&quot;,&quot;&quot;,&quot;C:&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;userid&quot;, ”Catherine&quot;); password_edit_set (&quot;password&quot;, “kxpvnwoulxjuax” ); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 10); win_check_gui(&quot;Flight Reservation&quot;, &quot;list1.ckl&quot;, &quot;gui1&quot;, 1); menu_select_item (&quot;File;Exit&quot;); 1 2
  • 174. 2. Modify Test to Read from Data Table Running the DataDriver Wizard Final Result table = &quot; default.xls &quot;; rc = ddt_open( table , DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause(&quot;Cannot open table.&quot;); ddt_get_row_count( table , table_RowCount); for(table_Row = 1; table_Row <= table_RowCount; table_Row ++) { ddt_set_row( table ,table_Row); invoke_application(&quot;D:flight1a.exe&quot;,&quot;&quot;,&quot;&quot;,SW_SHOW); set_window (&quot;Login&quot;, 10); edit_set (&quot;Agent Name:&quot;,ddt_val( table ,&quot;Agent_Name&quot;)); password_edit_set(&quot;Password:&quot;,ddt_val( table ,&quot;Password&quot;)); button_press (&quot;OK&quot;); set_window (&quot;Flight Reservation&quot;, 22); menu_select_item (&quot;File;Exit&quot;); } ddt_close( table );
  • 175. 2. Modify Test to Read from Data Table Running the DataDriver Wizard Where does the Data Table reside? <test name> default.xls
  • 176.
  • 177. 3. Move Data to Data Table Importing Data From Database to Data Table Database
  • 178. 3. Move Data to Data Table Importing Data From Database to Data Table Database
  • 179. 2. Modify Test to Read from Data Table Running the DataDriver Wizard edit_set (&quot;Agent Name:&quot;, “Catherine”); ? Final Result edit_set(“Agent Name:”, ddt_val(table,”Agent_Name”) );
  • 180. 2. Modify Test to Read from Data Table Running the DataDriver Wizard
  • 181. Data Driving Tests Create a test 1 2 3 Move data to Data Table Modify test to read from Data Table
  • 182.
  • 183. 3. Move Data to Data Table Insert Data Manually Open the Data Table 1 Enter Data you want to test 2 Close Data Table and save script 3
  • 184. 3. Move Data to Data Table Add Data Dynamically During Run Create Invoice Test 1 mer InvoiceNum 3421 yelet phine Data Table 3423 3423 3423 . . . . . . ddt_set_val(... Update Invoice Test 2 . . . . . . edit_set(...,ddt_val ...
  • 185. 3. Move Data to Data Table Add Data Dynamically During Run Add column to Data Table for data to be added 1
  • 186. 3. Move Data to Data Table Add Data Dynamically During Run table = &quot;default.xls&quot;; rc = ddt_open(table, DDT_MODE_READ); if (rc!= E_OK && rc != E_FILE_OPEN) pause(&quot;Cannot open table.&quot;); ddt_get_row_count(table,table_RowCount); for(table_Row = 1; table_Row <= table_RowCount; table_Row ++) { ddt_set_row(table,table_Row); set_window (&quot;Automobile Purchase Form&quot;, 2); edit_set (&quot;Customer Name&quot;,ddt_val(table,&quot;Customer_Name&quot;)); edit_set(&quot;Address:&quot;,ddt_val(table,&quot;Address&quot;)); edit_set (&quot;License&quot;,ddt_val(table,&quot;License&quot;)); obj_mouse_click (&quot;Method of Payment&quot;, 23, 13, LEFT); button_set (ddt_val(table,&quot;Cash&quot;), ON); list_select_item (&quot;Make&quot;,ddt_val(table,&quot;Make&quot;)); # Item Number 0; edit_set (&quot;Model&quot;,ddt_val(table,&quot;Model&quot;)); button_press (&quot;Insert Sale&quot;); edit_wait_info(&quot;StatusBar&quot;,&quot;value&quot;,&quot;New Purchase Completed Successfully...&quot;,10); } ddt_close(table); Add column to Data Table for data to be added 1 ddt_set_val ( table , “ ”, InvoiceNumber ); obj_get_info (&quot;Invoice No:&quot;,&quot;label&quot;, InvoiceNumber ); ddt_save ( table ); Modify the script so that it: 2 captures the data and saves it to a variable a sets the value in the Data Table b saves changes to the Data Table c Data Table InvoiceNo
  • 187.
  • 189.
  • 190.
  • 191. How Do Client-Server Applications Behave? Single User Database server Server response time:
  • 192. How Do Client-Server Applications Behave? Several Users Database server Server response time:
  • 193. How Do Client-Server Applications Behave? Many Users Database server Server response time:
  • 194. How Do Client-Server Applications Behave? Example Response Times RESPONSE TIME Several users 0.61 Many users 1.00 Single user 0.33
  • 195. Complete the Business Process Manually Database 07/07/01 Los Angeles Denver Cash Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Example steps
  • 196. Complete the Business Process Manually Database Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Select a flight Example steps
  • 197. Complete the Business Process Manually Database 07/07/01 Los Angeles Denver Cash Errol Flynn Enter Customer Name Insert Order Wait for response before continuing Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Select a flight 7328 Close application Example steps
  • 198. Manual Steps Recorded in the Test Script edit_set (&quot;Date&quot;,&quot;070701&quot;); list_select_item ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item (&quot;Fly To:&quot;, &quot;Denver&quot;); list_select_item (&quot;Payment:&quot;, &quot;Cash&quot; ); button_press ( &quot;Flights&quot; ); button_press ( &quot;Insert Order&quot; ); ??? Enter 07/07/01 on Date field Select LA from Fly From field Select Denver from Fly To field Enter Cash as Method of Payment Press Flights button Enter Customer Name Insert Order Wait for response before continuing Select a flight win_close ( &quot;Flight Reservation&quot; ); Close the application set_window ( &quot;Flights Table&quot; , 4); button_press ( &quot;OK&quot; ); Example steps edit_set ( &quot;Customer Name:&quot; , &quot;Errol Flynn&quot; ); set_window ( &quot;Flight Reservation&quot; , 10);
  • 199. Why Not Insert a Wait Statement? button_press ( &quot;Insert Order&quot; ); win_close ( &quot;Flight Reservation&quot; ); wait ( ); 10 50 users 5.1 seconds 500 users 9.5 seconds 1 user 3.7 seconds AVERAGE RESPONSE TIMES
  • 200. Why Not Insert a Wait Statement? AUT 11.3 seconds RUN #1 Wait (10); button_press ( &quot;Insert Order&quot; ); win_close ( &quot;Flight Reservation&quot; ); wait ( ); 10 button_press ( &quot;Insert Order&quot; ); win_close ( &quot;Flight Reservation&quot; ); wait ( ); 15 PROBLEM: Test run failed because wait didn't last long enough SOLUTION: Add 50% to wait time as safety cushion
  • 201. Why Not Insert a Wait Statement? AUT 5.5 seconds RUN #2 Wait (15); 15 seconds button_press ( &quot;Insert Order&quot; ); win_close ( &quot;Flight Reservation&quot; ); wait ( ); 15 PROBLEM: Most of the wait time was unnecessary SOLUTION: Don't use a wait statement – use something that will continue as soon a s the AUT is finished. But what will do that? button_press ( &quot;Insert Order&quot; ); win_close ( &quot;Flight Reservation&quot; ); ???
  • 202. What Is a Synchronization Point? A synchronization point is a line in the test script that instructs WinRunner to wait for a certain response from the application during playback, just as a real user would. Definition:
  • 203. ADD SYNCHRONIZATION POINTS Introduction to Synchronization Add Synchronization Points Record user actions in script 1 Synchronize script to application under test 2 Add verification statements to check AUT 3 Run test or suite of tests 4
  • 204. Process to Add Synchronization Points Add Synchronization Points Establish visual cues to synchronize 1 Determine type of synchronization point 2 Add synchronization point to test script 3 Play back revised script 4
  • 205. Establish Visual Cue to Synchronize Examples 1 Wait for a bitmap to refresh BITMAP Wait for a window WINDOW Wait for an object state OBJECT STATE
  • 206. Methods of Synchronization obj_wait_info (&quot;Bar&quot;,&quot;label&quot;, &quot;Insert Done...&quot;, 20); Wait for an object state/property value obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); Wait for a bitmap set_window (&quot;Flight Reservation&quot;, 20); Wait for a window
  • 207. Determine Type of Synchronization (Waiting for a Window) 2 Window name Time set_window (&quot;Flight Reservation&quot;, 20); Wait for main window to appear after login
  • 208. Properties of Standard GUI Objects (Examples) Boolean Values 0 = False 1 = True State 3 State 2 State 1 class: push_button, focused: 1, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 0
  • 209. Properties of Standard GUI Objects (Examples) Boolean Values 0 = False 1 = True State 3 State 2 State 1 class: list, focused: 1, value: &quot;Paris&quot; class: list, focused: 0, value: &quot;Los Angeles&quot; class: list, focused: 0, value: &quot;&quot; class: push_button, focused: 1, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 0
  • 210. Properties of Standard GUI Objects (Examples) Boolean Values 0 = False 1 = True State 3 State 2 State 1 class: list, focused: 1, value: &quot;Paris&quot; class: list, focused: 0, value: &quot;Los Angeles&quot; class: list, focused: 0, value: &quot;&quot; class: push_button, focused: 1, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 1 class: push_button, focused: 0, label: &quot;Insert Order&quot;, enabled: 0 class: radio_button, focused: 1, value: 1 class: radio_button, focused: 0, value: 1 class: radio_button, focused: 0, value: 0
  • 211. Determine Type of Synchronization (Change in Object Property/State) 2 obj_wait_info (&quot;Bar&quot;,&quot;label&quot;, &quot;Insert Done...&quot;, 20); Object name Object property Synchronize with a progress bar message
  • 212. Determine Type of Synchronization (Change in Object Property/State) 2 obj_wait_info (&quot;Bar&quot;,&quot;label&quot;, &quot;Insert Done...&quot;, 20); value Time Synchronize with a progress bar message
  • 213. Determine Type of Synchronization (Waiting for a Bitmap) 2 obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); Object name Bitmap name Sync with browser loading a bitmap
  • 214. Determine Type of Synchronization (Waiting for a Bitmap) 2 obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); Time x , y Sync with browser loading a bitmap
  • 215. Determine Type of Synchronization (Waiting for a Bitmap) 2 obj_wait_bitmap (&quot;Window&quot;, &quot;Img1&quot;, 10, 209, 170, 81, 20 ); width height Img1.bmp Bitmap File Location: Test_name exp Test_name Sync with browser loading a bitmap
  • 216. How Long Does It Wait? &quot;OK&quot; &quot;Error&quot; TIME PARAMETER Global timeout setting Global timeout interval GLOBAL + Test run 1 TOTAL = Maximum total timeout Synchronization statement timeout parameter Script continues Script continues Test run 2
  • 217. Add Synchronization to Test Script Wait for a Window 3 # Login set_window ( &quot;Login&quot; ,4); edit_set ( &quot;Agent Name:&quot;, &quot;mercury&quot; ); password_edit_set ( &quot;Password:&quot;,&quot;kjzisllz&quot; ); button_press ( &quot;OK&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; , 25 ); Locate the TSL statement that points to the determined visual cue 1
  • 218. Add Synchronization to Test Script Wait for a Window # Login set_window ( &quot;Login&quot; ,4); edit_set ( &quot;Agent Name:&quot;, &quot;mercury&quot; ); password_edit_set ( &quot;Password:&quot;,&quot;kjzisllz&quot; ); button_press ( &quot;OK&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; , 25 ); 3 Recorded time parameter reflects delay during script recording session 60 Locate the TSL statement that points to the determined visual cue 1 Modify timeout parameter to allow ample time for window to appear 2
  • 219. Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window ( &quot;Flights Table&quot; ,2); list_activate_item ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; ,3); edit_set ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press ( &quot;Insert Order&quot; ); 3 Locate the line in the script to insert the synchronization point 1
  • 220. Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window ( &quot;Flights Table&quot; ,2); list_activate_item ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; ,3); edit_set ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press ( &quot;Insert Order&quot; ); 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
  • 221. Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window ( &quot;Flights Table&quot; ,2); list_activate_item ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; ,3); edit_set ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press ( &quot;Insert Order&quot; ); 3 Using the Hand pointer, click on the object to synchronize 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
  • 222. Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window ( &quot;Flights Table&quot; ,2); list_activate_item ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; ,3); edit_set ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press ( &quot;Insert Order&quot; ); 3 &quot;Progress Bar&quot; Select the object attribute that will contain the value of the visual cue 4 Using the Hand pointer, click on the object to synchronize 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
  • 223. Add Synchronization to Test Script Wait for an Object State/Property Value list_select_item ( &quot;Fly From:&quot;,&quot;Denver&quot; ); list_select_item ( &quot;Fly To:&quot;,&quot;San Francisco&quot; ); # Flights Table set_window ( &quot;Flights Table&quot; ,2); list_activate_item ( &quot;Flight&quot;, &quot;2452...&quot; ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; ,3); edit_set ( &quot;Customer Name:&quot;,&quot;Bob Smith&quot; ); button_press ( &quot;Insert Order&quot; ); 3 obj_wait_info ( &quot;Progress Bar&quot; , &quot;label&quot; , &quot;Insert Done…”, 10); &quot;Progress Bar&quot; Click the Paste button in Wait for object window 5 Select the object attribute that will contain the value of the visual cue 4 Using the Hand pointer, click on the object to synchronize 3 Locate the line in the script to insert the synchronization point 1 Select Create > Synchronization Point/For Object/Window Property 2
  • 224. Add Synchronization to Test Script Wait for a Bitmap Area 3 # Mercury Homepage set_window ( &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com” ); obj_mouse_click ( &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); Locate the line in the script to insert the synchronization point 1
  • 225. Add Synchronization to Test Script Wait for a Bitmap Area # Mercury Homepage set_window ( &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com” ); obj_mouse_click ( &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); 3 Select Create > Synchronization Point > For Screen Area Bitmap 2 Locate the line in the script to insert the synchronization point 1
  • 226. Add Synchronization to Test Script Wait for a Bitmap Area 3 # Mercury Homepage set_window ( &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com” ); obj_mouse_click ( &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); Click left mouse button and drag pointer to select area; press right button to complete selection 3 Select Create > Synchronization Point > For Screen Area Bitmap 2 Locate the line in the script to insert the synchronization point 1
  • 227. Add Synchronization to Test Script Wait for a Bitmap Area 3 # Mercury Homepage set_window ( &quot;Mercury Homepage&quot; , 5 ); edit_set ( &quot;Address&quot;, &quot;http://www.merc-int.com” ); obj_wait_bitmap ( &quot;mpage&quot;,&quot;Img2&quot; ,6,7,8,101,114); obj_mouse_click ( &quot;mpage&quot;, &quot;Img2&quot; , 471, 328 ); TSL statement appears in script 4 Locate the line in the script to insert the synchronization point 1 Click left mouse button and drag pointer to select area; press right button to complete selection 3 Select Create > Synchronization Point > For Screen Area Bitmap 2
  • 228.
  • 229. Play Back Revised Script 4 edit_set (&quot;Date&quot;,&quot;070703&quot;); list_select_item (&quot;Fly From:&quot;, &quot;Los Angeles&quot;); button_press ( &quot;Flights&quot; ); set_window (&quot;Flights Table&quot;, 4); list_activate_item (&quot;Flight&quot;, . . .) edit_set ( &quot;Customer Name:&quot;, &quot;Errol Flynn&quot; ); button_press ( &quot;Insert Order&quot; ); obj_wait_info ( &quot;ProgressBar&quot;,&quot;label&quot;, &quot;Insert Done...&quot; ,10); 07/07/03 Los Angeles Denver Cash edit_set ( &quot;Date&quot;,&quot;070703&quot; ); list_select_item ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item ( &quot;Fly To:&quot;, &quot;Denver&quot; ); list_select_item ( &quot;Payment:&quot;, &quot;Cash&quot; ); set_window ( &quot;Flights Table&quot; , 4); list_activate_item ( &quot;Flight&quot; , . . .);
  • 230. Play Back Revised Script 4 07/07/03 Los Angeles Denver Cash edit_set (&quot;Date&quot;,&quot;070703&quot;); list_select_item (&quot;Fly From:&quot;, &quot;Los Angeles&quot;); list_select_item (&quot;Payment:&quot;, &quot;Cash&quot;); button_press ( &quot;Flights&quot; ); edit_set ( &quot;Customer Name:&quot; , &quot;Errol Flynn&quot; ); button_press ( &quot;Insert Order&quot; ); set_window (&quot;Flights Table&quot;, 4); list_activate_item (&quot;Flight&quot;, . . .) obj_wait_info ( &quot;ProgressBar&quot;,&quot;label&quot;, &quot;Insert Done...&quot; ,10); 07/07/03 edit_set ( &quot;Date&quot;,&quot;070703&quot; ); list_select_item ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item ( &quot;Fly To:&quot;, &quot;Denver&quot; ); list_select_item ( &quot;Payment:&quot;, &quot;Cash&quot; ); set_window ( &quot;Flights Table&quot; , 4); list_activate_item ( &quot;Flight&quot; , . . .);
  • 231. Play Back Revised Script 4 edit_set ( &quot;Date&quot;,&quot;070703&quot; ); list_select_item ( &quot;Fly From:&quot;, &quot;Los Angeles&quot; ); list_select_item ( &quot;Fly To:&quot;, &quot;Denver&quot; ); list_select_item ( &quot;Payment:&quot;, &quot;Cash&quot; ); button_press ( &quot;Flights&quot; ); edit_set ( &quot;Customer Name:&quot;, &quot;Errol Flynn&quot; ); button_press ( &quot;Insert Order&quot; ); obj_wait_info( &quot;ProgressBar&quot;,&quot;label&quot;, &quot;Insert Done...&quot; ,10); set_window ( &quot;Flights Table&quot; , 4); list_activate_item ( &quot;Flight&quot; , . . .); . . . Errol Flynn 07/07/03 101
  • 232.
  • 234.
  • 235. Enhancing Your Test Using TSL Test Script Language
  • 236.
  • 237.
  • 238.
  • 239. Variables and Constants Variable and Constant Names: - letters, numbers, underscore - first character must be a letter or an underscore - case sensitive # Constant declarations public const GUI_FILE_PATH = “c:testsguifiles”; public const AUT_PATH = “c:appbin”; public const E_MY_ERROR_CODE = -12345; # Variable declarations static lineCounter ; public flightVersion = “Flight1a.exe”; Test Script 1 Examples GUI_load ( GUI_FILE_PATH & “myFile.gui”); invoke_application ( AUT_PATH & flightVersion , ““, AUT_PATH , SW_SHOW); ... rc = my_function (); if (rc == E_MY_ERROR_CODE ) ... Test Script 2
  • 240. Variables and Constants Strings and Numbers number1 = &quot;4&quot; ; number2 = 3 ; value = number1 * number2; value contains 12 cost = &quot;10 Dollars&quot; ; amount = “The price is “ & cost + 5 ; amount contains “The price is 15” value_a = &quot;3.3&quot; ; value_b = &quot;2,5&quot; ; result_a = value_a * 2 ; result_b = value_b * 4 ; result_a contains 6.6 result_b contains 8 Sample 1 Sample 2 Sample 3 WinRunner can convert strings to numbers and vice versa! If a string is converted to a number, WinRunner cuts off all following non-numeric characters!
  • 241.
  • 242.
  • 243. Arrays Simple Array fltclass[ 1 ]= &quot;First&quot; ; fltclass[ 2 ]= &quot;Business&quot; ; fltclass[ 3 ]= &quot;Economy&quot; ; # Data Window set_window ( &quot;Data Window&quot; , 1 ); edit_get_text ( &quot;Class Number:&quot; , class ); # Flight Reservation set_window ( &quot;Flight Reservation&quot; , 1 ); button_set ( fltclass[class] , ON ); Sample
  • 244. Arrays Associative Array userdata[ &quot;name&quot; ]= &quot;John Smith&quot; ; userdata[ &quot;address&quot; ]= &quot;1234 Main Street&quot; ; userdata[ &quot;zip&quot; ]= 98711 ; userdata[ &quot;city&quot; ]= &quot;Hometown &quot; ; # Customer Information Window set_window ( ”Customer Information Window&quot; , 1 ); edit_set ( &quot;Name:&quot; , userdata[ &quot;name&quot; ] ); edit_set ( &quot;Address:&quot; , userdata[ &quot;address&quot; ] ); edit_set ( &quot;City:&quot; , userdata[ &quot;zip&quot; ] & &quot;, &quot; & userdata[ &quot;city&quot; ] ); Sample
  • 245. Arrays Multi-dimensional Arrays flightinfo[ 1 , &quot;Date” ] = &quot;07/22/99&quot; ; flightinfo[ 1 , &quot;FlyFrom” ] = &quot;Los Angeles&quot; ; flightinfo[ 1 , &quot;FlyTo” ] = &quot;Denver&quot; ; flightinfo[ 1 , &quot;Flight No” ] = &quot;4300&quot; ; flightinfo[ 2 , &quot;Flight No” ] = &quot;1234&quot; ; flightinfo[ 3 , &quot;Flight No” ] = &quot;9999&quot; ; Example: Multi-dimensional Array Date Fly From Fly To Flight No 1 2 3 07/22/99 09/28/01 12/26/02 Los Angeles Seattle Dallas Detroit Portland Denver 4300 1234 9999 Multi-dimensional Arrays; Data in table format
  • 246.
  • 247. Flow Control Conditional Decision Making set_window (“Flight Reservation”); obj_get_info (“Order No:”, “value”, OrderNo); if ( OrderNo == “ ” ) report_msg (“No order number.”); else button_press (“Update Order”); set_window (“Flight Reservation”); obj_get_info (“Order No:”, “value”, OrderNo); if ( OrderNo == “ ” ) { report_msg (“No order number.”); } else { button_press (“Update Order”); } win_get_text(”Flight Info”, version, 42, 68, 159, 89); if ( version != “Version 1.0” ) { report_msg (“Wrong Version!”); texit; } Example 2 Best practice: always set curly brackets Example 1
  • 248. Flow Control switch Statement set_window (&quot;Fax Order&quot;); edit_get_text (&quot;Class:&quot;, class); switch (class) { case &quot;Economy&quot;: result = PASS; message=&quot;Correct class: Economy&quot;; break; case &quot;Business&quot;: result = FAIL; message=&quot;Wrong class: Business&quot;; break; case &quot;First&quot;: result = FAIL; message=&quot;Wrong class: First&quot;; break; } tl_step (“Class of Service”, result, message); Example
  • 249. Flow Control for Loop # Looping for stress testing for (i=0; i<1000; i++) { set_window (“Flight Reservation”); menu_select_item (&quot;File;Fax Order...&quot;); set_window (&quot;Fax Order&quot;); edit_set (&quot;Fax Number:&quot;, “4085551212”); button_press (”Send&quot;); set_window (“Flight Reservation”); obj_wait_info (“StatusBar”, “label”, “Fax Sent”, 50); } Example
  • 250. Flow Control while Loop file= &quot;c:dataflight_orders.txt&quot;; file_open( file, FO_MODE_READ ); while ( file_getline( file, line ) == E_OK ) { ord_num= substr( line, 0, 5 ); open_order( ord_num ); report_msg( &quot;Opened Order &quot; & ord_num ); } file_close( file ); The statements in this while loop will not be executed if the condition is not TRUE (if the file cannot be opened) Example
  • 251. Flow Control do while Loop # Flight Reservation set_window ( &quot;Flight Reservation&quot;, 2 ); edit_set ( &quot;Name:&quot;, &quot;&quot; ); new_len=0; do { old_len= new_len; edit_type( &quot;Name:&quot;, &quot;123&quot; ); edit_get_info( &quot;Name:&quot;, &quot;value&quot;, value ); new_len= length( value ); } while( old_len < new_len ); report_msg( &quot;Max Name length ” & new_len & &quot; characters&quot; ); The statements in this while loop are executed at least once. Example
  • 252.
  • 253. Operators Arithmetic/Relational edit_get_text (&quot;Tickets&quot;, tickets); edit_get_text (&quot;Price&quot;, price); edit_get_text (&quot;Total&quot;, total); if ( tickets * price == total ) tl_step (“Total”, PASS, “Correct Total”); else { tl_step (“Total”, FAIL, &quot;Wrong Total&quot;); report_msg(“Expected Value: ” & tickets * price); report_msg(“Actual Value: ” & total ); } Best Practice: For complicated calculations, check values in the AUT against pre-calculated values in a data table or data file Example
  • 254. Operators Logical Operators # Value is greater than 50 AND less than 100 if ( value > 50 && value <100 ) tl_step (“Value tested”, PASS, “Correct Value”); Logical AND # Value equals Saturday OR value equals Sunday if ( value== “Saturday” || value== “Sunday” ) tl_step (“Value tested”, PASS, “ it’s Weekend !”); Logical OR # Value is equal to or greater than 1 AND less than or equal to 10 # AND value IS NOT 5 if ( value >=1 && value <=10 && value != 5 ) tl_step (“Value tested ”, PASS, “is between 1-10 and not 5”); Combination
  • 255.
  • 256.
  • 257.
  • 258.
  • 259.
  • 260.
  • 261.
  • 262.
  • 263.
  • 264.
  • 265.
  • 266.
  • 267.
  • 268.
  • 269.
  • 270.
  • 271.
  • 272. Creating a Startup Script ############################################ # TestSuite Training Init Test # ############################################ # Loading the prepared GUI file GUI_load ( getvar ( &quot;testname&quot; )& &quot;flight60.gui&quot; ); # Configure the MS Mask object to map to edit objec # Data of Flight recording depends on this set_class_map ( &quot;MSMaskWndClass&quot; , &quot;edit&quot; ); set_record_attr ( &quot;MSMaskWndClass&quot; , &quot;class attached_t set_record_method ( &quot;MSMaskWndClass&quot; , RM_RECORD); # Configure the status bar in the GUI Map set_class_map ( &quot;AfxWnd40&quot; , &quot;object&quot; ); set_record_attr ( &quot;AfxWnd40&quot; , &quot;class regexp_MSW_class S:estProjectnitScript WinRunner - [InitScript] Create a startup script in WinRunner. 1 Open the General Options window and click the Environment tab. 2 Enter the path where you saved your startup script in the Startup test box. 3
  • 273.
  • 275.