HP LoadRunner User Guide

HP LoadRunner User Guide
HP LoadRunner
Software Version: 12.00
LoadRunner User Guide
Document Release Date: March 2014
Software Release Date: March 2014
Legal Notices
Warranty
The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP
shall not be liable for technical or editorial errors or omissions contained herein.
The information contained herein is subject to change without notice.
Restricted Rights Legend
Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and
Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.
Copyright Notice
© Copyright 1993-2014 Hewlett-Packard Development Company, L.P.
Trademark Notices
Adobe™ is a trademark of Adobe Systems Incorporated.
Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
UNIX® is a registered trademark of The Open Group.
Documentation Updates
The title page of this document contains the following identifying information:
l
l
l
Software Version number, which indicates the software version.
Document Release Date, which changes each time the document is updated.
Software Release Date, which indicates the release date of this version of the software.
To check for recent updates or to verify that you are using the most recent edition of a document, go to: http://h20230.www2.hp.com/selfsolve/manuals
This site requires that you register for an HP Passport and sign in. To register for an HP Passport ID, go to: http://h20229.www2.hp.com/passport-registration.html
Or click the New users - please register link on the HP Passport login page.
You will also receive updated or new editions if you subscribe to the appropriate product support service. Contact your HP sales representative for details.
Support
Visit the HP Software Support Online web site at: http://www.hp.com/go/hpsoftwaresupport
This web site provides contact information and details about the products, services, and support that HP Software offers.
HP Software online support provides customer self-solve capabilities. It provides a fast and efficient way to access interactive technical support tools needed to manage your business. As a valued support customer, you
can benefit by using the support web site to:
l
l
l
l
l
l
l
l
Search for knowledge documents of interest
Submit and track support cases and enhancement requests
Download software patches
Manage support contracts
Look up HP support contacts
Review information about available services
Enter into discussions with other software customers
Research and register for software training
Most of the support areas require that you register as an HP Passport user and sign in. Many also require a support contract. To register for an HP Passport ID, go to:
http://h20229.www2.hp.com/passport-registration.html
To find more information about access levels, go to:
http://h20230.www2.hp.com/new_access_levels.jsp
HP Software Solutions Now accesses the HPSW Solution and Integration Portal Web site. This site enables you to explore HP Product Solutions to meet your business needs, includes a full list of Integrations between
HP Products, as well as a listing of ITIL Processes. The URL for this Web site is http://h20230.www2.hp.com/sc/solutions/index.jsp
About this PDF Version of Online Help
This document is a PDF version of the online help. This PDF file is provided so you can easily print multiple topics from the help information or read the online help in PDF format. Because this content was originally
created to be viewed as online help in a web browser, some topics may not be formatted properly. Some interactive topics may not be present in this PDF version. Those topics can be successfully printed from within the
online help.
We appreciate your feedback!
If you have comments about this document, you can contact the documentation team by email. If
an email client is configured on this system, click the link above and an email window opens with
the following information in the subject line:
Feedback on LoadRunner User Guide (LoadRunner 12.00)
Just add your feedback to the email and click send.
If no email client is available, copy the information above to a new message in a web mail client,
and send your feedback to sw-doc@hp.com.
HP LoadRunner (12.00)
Page 6 of 1743
LoadRunner User Guide
We appreciate your feedback!
HP LoadRunner (12.00)
Page 7 of 1743
Contents
LoadRunner User Guide
1
We appreciate your feedback!
6
Contents
8
Welcome to the LoadRunner User Guide
58
LoadRunner Online Help
58
Additional Online Resources
58
What's New in LoadRunner 12.00
60
VuGen Concepts
64
VuGen - Overview
64
Vuser Technology Overview
64
Vuser Types
65
Vuser Protocols
66
Keyboard Shortcuts
69
IPv6 Support
72
VuGen User Interface
75
VuGen User Interface - Overview
75
VuGen Layouts - Overview
79
Solution Explorer - Overview
80
Editor - Overview
82
Snapshot Pane - Overview
85
How to Work with Snapshots
88
How to Add a Text Check From the XML View in the Snapshot Pane
90
How to Create a Vuser Script - Workflow
91
How to Compare Scripts Side by Side
91
How to Create a Business Process Report
92
How to Modify the VuGen Layout
93
Options Overview
94
General Options
95
Editor Options
98
HP LoadRunner (12.00)
Page 8 of 1743
LoadRunner User Guide
Contents
Scripting Options
103
Search and Replace Dialog Boxes
109
Editor
112
Thumbnail Explorer
113
Business Process Report Dialog Box
115
Steps Toolbox Pane
117
Solution Explorer Pane
118
Output Pane
124
Snapshot Pane
126
Bookmarks Pane
131
Step Navigator Pane
132
Errors Pane
133
Task Pane
134
Breakpoints Pane
135
Watch Pane
138
Run Time Data Pane
138
Call Stack Pane
139
Replay Summary Tab
140
VuGen - Troubleshooting and Limitations
146
Protocol Advisor - Overview
147
How to use the Protocol Advisor
148
Protocol Advisor Dialog Box
150
Protocol Advisor - Troubleshooting and Limitations
151
HP Live Network (HPLN) Integration
152
How to Download Content from HP Live Network (HPLN) to LoadRunner
152
How to Upload Content from LoadRunner to HP Live Network (HPLN)
154
HP Live Network Connection Dialog Box
157
Download from HP Live Network Dialog Box
158
Script Workflow
162
How to Create or Open a Vuser Script
162
Creating Vuser Scripts - Overview
162
HP LoadRunner (12.00)
Page 9 of 1743
LoadRunner User Guide
Contents
How to Create and Open Vuser Scripts
163
Working with Application Lifecycle Management
163
Managing Scripts Using ALM - Overview
164
ALM Version Control - Overview
164
How to Work with Scripts in ALM Projects
164
How to Connect to ALM
165
How to Work with Version Controlled Scripts in ALM Projects
165
How to Save VuGen Vuser Scripts to ALM Projects
166
How to Compare Previous Versions of a Script
167
HP ALM Connection Dialog Box [VuGen]
167
Multiple Protocol Scripts
169
Script Directory Files
170
Create a New Script Dialog Box
170
How to Work with .zip Files
172
Vuser Script Templates
172
How to Create and Open Vuser Script Templates
173
Recording a Vuser Script
174
Recording - Overview
174
How to Record a Vuser Script
175
Recording Options
176
Citrix > Configuration Node
177
Citrix > Code Generation
177
Citrix > Login Node
178
Citrix > Recorder Node
179
COM/DCOM > Filter Node
180
COM/DCOM > Options Node
182
Correlations > Configuration
184
Correlations > Rules
186
New Rule Pane
187
Advanced Correlation Properties Dialog Box
189
Token Substitution Testpad Dialog Box
189
HP LoadRunner (12.00)
Page 10 of 1743
LoadRunner User Guide
Contents
Database > Database Node
190
Database > Advanced Recording Options Dialog Box
190
Data Format Extension > Chain Configuration Node
191
Add Prefix/Postfix to Chain Dialog Box
193
Add Data Format Extension
194
Data Format Extension > Code Generation Node
195
Flex > RTMP Node
197
Flex > Configuration Node (Recording)
197
Flex > Externalizable Objects Node (Recording)
198
General > Code Generation
199
General > Protocol Node
200
General > Recording Node
200
Advanced URL Dialog Box
201
Advanced HTML Dialog Box
202
General > Script Node
203
GUI Properties > Web Event Configuration Node
205
Custom Web Event Recording Configuration Dialog Box
HTTP > Advanced Node
206
208
Headers Dialog Box
211
Content Type Filters Dialog Box
212
Non-Resources Dialog Box
212
Flex > Configuration Node (Recording)
213
Flex > Externalizable Objects Node (Recording)
214
.NET > Filters Node
215
Create a New Filter Dialog Box [.NET Protocol]
216
Filter Manager [.NET Protocol]
216
Add Reference Dialog Box [.NET Protocol]
219
GUI Properties > Advanced Node
219
.NET > Recording - Recording Node
Remote Objects Property
.NET > Shared DLLs
HP LoadRunner (12.00)
221
223
224
Page 11 of 1743
LoadRunner User Guide
Contents
Mobile TruClient Properties > Mobile Device Node
225
Network > Port Mapping Node
226
Server Entry Dialog Box
227
Advanced Port Mapping Settings Dialog Box
229
RDP > Code Generation > Advanced Node
229
RDP > Code Generation > Agent Node
230
RDP > Code Generation > Basic Node
231
RDP > Client Startup Node
232
Recording Properties > Corba Options Node
233
Recording Properties > Correlation Options Node
234
Recording Properties > Log Options Node
234
Recording Properties > Recorder Options Node
235
Recording Properties > Serialization Options Node
236
RTE > Configuration Node
237
RTE > RTE Node
238
SAPGUI > Auto Logon Node
239
SAPGUI > Code Generation Node
239
SAPGUI > General Node
240
Silverlight > Services Node
240
Add / Edit Services Dialog Box
241
Connection Settings Dialog Box
242
Protocol and Security Scenario Data Dialog Box
242
Traffic Analysis > Traffic Filter
243
WinSock Node
244
Recording Options - Miscellaneous Topics
246
Protocol Compatibility Table
246
Port Mapping Overview
249
Port Mapping Auto Detection
250
EUC-Encoding (Japanese Windows only)
251
Script Generation Preference Overview
251
Script Language Options
252
HP LoadRunner (12.00)
Page 12 of 1743
LoadRunner User Guide
Contents
Recording Levels - Overview
252
Serialization Overview
253
Tips for Working with Event Listening and Recording
254
Example of Click & Script Out of Context Recording
254
Vuser Script Sections
255
Providing Authentication Information
258
Recording via a Proxy- Overview
260
How to Record a Script via a Proxy
261
How to Import Actions to a Script
265
How to Regenerate a Vuser Script
266
Start Recording Dialog Box
266
Floating Recording Toolbar
269
Files Generated During Recording
271
Troubleshooting and Limitations - Recording
273
Correlation Studio
274
Correlation Overview
274
Correlation Tab [Design Studio] Overview
275
Determining Which Values to Correlate
277
Modifying Saved Parameters
278
Correlation vs. Parameterization
278
Wdiff Correlation Utility
278
Correlating Java Scripts
278
How to Correlate Scripts Using Design Studio
280
How To Manually Correlate Scripts
282
How to Correlate Scripts From a Snapshot
282
Correlating Winsock Scripts
283
How to Correlate Scripts - Winsock (Manually)
284
How to Correlate Scripts - Web (Manually)
286
How to Correlate Scripts - Siebel Protocol
287
How to Correlate Scripts - Oracle NCA
292
How to Correlate Scripts - Microsoft .NET
294
HP LoadRunner (12.00)
Page 13 of 1743
LoadRunner User Guide
Contents
How to Correlate Scripts - Java Scripts - Serialization
296
How to Correlate Scripts - Java
299
How to Correlate Scripts - XPath Correlation in Flex Vuser Scripts
301
How to Correlate Scripts - COM Protocol
302
How to Search for Values that Need Correlation
302
How to Modify Correlation Definitions
303
How to Exclude Content Based on Content-Type
307
How to Exclude Strings from the Correlation Scan
308
Correlation Functions - Database Vuser Scripts
309
Correlation Functions - Java Vuser Scripts
309
Web_reg_save_param function details
310
Correlation Functions - C Vuser Scripts
311
Design Studio [Correlation Tab] Dialog Box
312
Replaying a Vuser Script
316
Replaying - Overview
316
How to Replay a Vuser Script
316
Run-Time Settings
317
Run-Time Settings - Miscellaneous Topics
317
Content Checking Overview
317
Copying, Importing, and Exporting Run-Time Settings
318
Multithreading
320
Protocol Compatibility Table
320
Browser > Browser Emulation Node
325
Citrix > Configuration Node
327
Citrix > Synchronization Node
328
COM/DCOM > Filter Node
329
COM/DCOM > Options Node
331
Data Format Extension > Configuration Node
332
Flex > Configuration Node (Run-Time Settings)
332
Flex > RTMP Node
333
Flex > Externalizable Node (Run-Time Settings)
334
HP LoadRunner (12.00)
Page 14 of 1743
LoadRunner User Guide
Contents
General > Additional Attributes Node
335
General > Log Node
335
General > Log Node (AjaxTruClient)
336
General > Advanced Settings (TruClient)
338
Load > Browser Settings Node (Ajax TruClient)
338
Load > Other Settings (TruClient)
342
General > Replay Node
343
General > Miscellaneous Node
348
General > Pacing Node
349
General > Run Logic Node
350
General > Think Time Node
350
Internet Protocol > ContentCheck Node
351
Internet Protocol > Download Filters Node
352
Internet Protocol > Preferences Node
353
Advanced Options Dialog Box
354
Internet Protocol > Proxy Node
363
Java Environment Settings > Java Classpath Node
364
Java Environment Settings > Java VM Node
365
JMS > Advanced Node
366
MMS > Server and Protocol Node
368
Mobile TruClient Properties > Mobile Device Node
368
.NET > .NET Environment Node
369
.NET > Shared DLLs
370
Network > Speed Simulation Node
371
Oracle NCA > Client Emulation Node
371
RDP > Advanced Node
372
RDP > Configuration Node
373
RDP > RDP Agent Node
374
RDP > Synchronization Node
375
RTE > RTE Node
376
SAPGUI > General Node
377
HP LoadRunner (12.00)
Page 15 of 1743
LoadRunner User Guide
Contents
Silverlight > Services Node
378
WAP > Gateway Node
379
WAP > Radius Node
381
Bookmarks Overview
382
How to Run a Vuser Script from a Command Prompt
382
How to Run a Vuser Script from a Linux Command Line
383
How to Use Bookmarks
385
Files Generated During Replay
386
Debugging Vuser Scripts
387
Debugging - Overview
388
Error Handling
390
Additional Debugging Information
391
Working with Breakpoints
392
Watching Expressions and Variables
392
Debugging Web Vuser Scripts
393
How to Debug Scripts with Breakpoints
394
Enhancing a Script for Load Testing
395
Enhancing a Script for Load Testing - Overview
395
Transaction Overview
397
How to Insert Transactions
398
How to Display Transactions
399
Rendezvous Points
400
Adding VuGen Functions - Overview
400
General Vuser Functions
402
Protocol-Specific Vuser Functions
402
Encrypting Text
403
Password Encoding
403
Encrypting Text
403
How to Encrypt/Decrypt Text
404
How to Encode a Password
404
Password Encoder Dialog Box
404
HP LoadRunner (12.00)
Page 16 of 1743
LoadRunner User Guide
Contents
How to Create a Controller Scenario from VuGen
405
How to Insert Steps into a Script
406
Create Controller Scenario Dialog Box
406
Parameters
408
Parameterizing - Overview
408
Parameter Types
410
How to Create a Parameter
412
Data Assignment Methods for File/Table/XML Parameters
413
Data Assignment and Update Methods for File/Table/ XML Parameters
414
Vuser Behavior in the Controller (LoadRunner Only)
415
How to Work with Existing Parameters
416
XML Parameters
416
How to Create an XML Parameter from a Web Service Call
417
How to Create XML Parameters - Standard Method
418
How to Define XML Value Sets
419
How to Set an Assignment Method
422
How to Modify XML Parameter Properties
423
How to Set AUT Environment Parameters
424
How to Import Parameter Data from a Database
424
Select or Create Parameter Dialog Box
425
Parameter Properties Dialog Box
426
Parameter Simulation Dialog Box
435
Parameter List Dialog Box
439
Database Query Wizard
440
Create Parameter Dialog Box (Winsock)
441
Parameter Original Value Dialog Box
441
Parameters - Troubleshooting and Limitations
442
Async Studio
442
Synchronous and Asynchronous Concepts
443
Types of Asynchronous Communication
443
LoadRunner Support for Asynchronous Communication - Overview
446
HP LoadRunner (12.00)
Page 17 of 1743
LoadRunner User Guide
Contents
How to Create an Asynchronous Vuser Script
448
Asynchronous Communication API
450
How Asynchronous Functions Differ from Synchronous Functions
451
How VuGen Modifies a Vuser Script for Asynchronous Communication
451
Defining the Start of an Asynchronous Conversation
454
Defining the End of an Asynchronous Conversation
456
Using Asynchronous Request Thresholds
457
Fine-Tuning the End of an Asynchronous Conversation
458
Correlating Asynchronous Vuser Scripts
459
Implementing Callbacks
459
Modifying Callbacks
462
Parsing URLs
466
Async Rules - Overview
468
Adding Async Rules
469
Async Tab [Design Studio]
471
Asynchronous Options Dialog Box
473
Asynchronous Example - Poll
474
Asynchronous Example - Push
476
Asynchronous Example - Long-Poll
477
Viewing Replay Results
479
Viewing Replay Results - Overview
480
Customizing the Test Results Display
480
Connecting to Application Lifecycle Management from the Test Results Window
481
How to Send Custom Information to the Report
481
How to Configure the Appearance of the Test Results Window
481
How to Open the Test Results of a Specific Run
481
How to Find Steps in the Test Results
482
Test Results Window
482
Filters Dialog Box
484
Print Dialog Box
485
Print Preview Dialog Box
486
HP LoadRunner (12.00)
Page 18 of 1743
LoadRunner User Guide
Contents
Export to HTML File Dialog Box
Protocols
487
489
Protocol Support for Async, IPv6, and 64-bit Recording
489
Ajax - Click & Script Protocol
490
Ajax (Click & Script) Protocol Overview
490
Ajax (Click & Script) Supported Frameworks
491
Ajax (Click & Script) Example Script
491
Ajax (Click & Script) Recording Tips
492
Ajax (Click & Script) - Replay Tips
493
Ajax (Click & Script) Miscellaneous Tips
494
Click & Script Troubleshooting and Limitations
495
TruClient Protocol
499
What is TruClient?
499
TruClient Step Structure
502
Understanding Step Events
506
How to Synchronize TruClient Scripts Steps
508
Developing TruClient Scripts
How to Develop TruClient Scripts
511
511
How to Calculate the Number of Load Generators Required for TruClient Scripts 513
TruClient - Debugging a TruClient Script
515
TruClient Alternative Steps
515
TruClient Script Levels
515
TruClient Snapshots
517
How to Debug TruClient Scripts
517
Additional Script Debugging Tips
519
How to Resolve Object Identification Issues
519
Troubleshooting Object Identification Issues
525
Troubleshooting TruClient Scripts
527
TruClient - Enhancing a TruClient Script
531
TruClient Event Handlers
531
TruClient Functions and Function Libraries
533
HP LoadRunner (12.00)
Page 19 of 1743
LoadRunner User Guide
Contents
Working With JavaScript in TruClient Scripts
533
JavaScript Support
533
How Can I Learn More about JavaScript
533
Using Regular Expressions
534
How to Enhance TruClient Scripts
534
How To Use The Events Handler
536
How to Insert and Modify Loops
538
How to Insert Custom JavaScript and C Code into TruClient Scripts
539
How to Use VTS in TruClient
539
How To Create and Use Function and Libraries
542
How to Display Client Side Breakdown Data for TruClient Scripts
544
TruClient Events Handler Editor Dialog Box
544
TruClient Client Side Breakdown Data
547
Create New Function Dialog Box
549
Transaction Editor Dialog Box (TruClient)
550
The TruClient Sidebar
553
TruClient Home Tab
553
TruClient Edit Tab
556
Window Tab
558
TruClient Toolbox
558
Browsers in TruClient
560
General Browser Settings (TruClient)
560
Private Browsing (TruClient)
560
TruClient Browser for IE
561
TruClient General Settings Dialog Box
562
TruClient - Troubleshooting and Limitations (General)
564
Troubleshooting Communication between VuGen and TruClient
565
Word Verification Function in the Business Process
565
Protocol Limitations
566
Converting a TruClient Script to a Web HTTP/HTML Script
567
LR Function Reference
568
HP LoadRunner (12.00)
Page 20 of 1743
LoadRunner User Guide
Contents
TruClient Functions
568
TruClient VTS Functions
571
TruClient Properties
578
TruClient Step Arguments
579
Citrix Protocol
584
Citrix Protocol - Overview
584
Citrix Recording Tips
584
Citrix Replaying Tips
586
Citrix Synchronization
587
Citrix - Automatic Synchronization
587
Citrix Alternate Synchronization
588
Agent for Citrix Presentation Server - Overview
590
Troubleshooting XenApp 5.0
593
How to Configure the Citrix Client and Server
593
How to Synchronize Citrix Scripts Manually
594
How to Install and Uninstall the Citrix Agent
595
Citrix Functions
595
Citrix - Understanding ICA Files
596
Failed Bitmap Synchronization Dialog Box
597
Citrix - Troubleshooting and Limitations
597
Click & Script Protocols
601
Click & Script Protocols - Overview
602
Click & Script Recording Tips
603
Click & Script - Replay Tips
604
Click & Script Miscellaneous Tips
606
Click & Script Enhancements
606
Click & Script API Notes
609
Ordinals
609
Empty Strings
610
Click & Script Troubleshooting and Limitations
COM Protocol
HP LoadRunner (12.00)
610
614
Page 21 of 1743
LoadRunner User Guide
Contents
COM Protocol Overview
614
COM Technology Overview
615
COM Vuser Script Structure
616
COM Sample Vuser Scripts
617
Selecting COM Objects to Record
621
Database Protocols
622
Database Protocols Overview
622
VuGen Database Recording Technology
623
Database Grids
623
Flex (RTMP/AMF) Protocol
625
Flex Overview
625
Recording Flex Scripts
627
AMF
628
RTMP Functions
629
RTMP Tunneled Functions
630
RTMP/RTMPT Streaming
630
RTMP Tunneled
638
How to Record a Flex Script
639
Setting the Flex Recording Mode
640
Example
640
Code Generation in the Flex Protocol
641
Externalizable Objects in Flex Scripts
642
Flex Correlations
643
Flex Snapshots
644
How to Serialize Flex Scripts
645
How to Query an XML Tree
646
Flex - Troubleshooting and Limitations
648
GraniteDS (Data Services)
Java Protocols
649
650
Java Protocol Recording Overview
650
Java Vuser Script Overview
651
HP LoadRunner (12.00)
Page 22 of 1743
LoadRunner User Guide
Contents
RMI over IIOP Overview
651
Corba Recording Options
652
CORBA Application Vendor Classes
652
Recording RMI
652
Recording a Jacada Vuser
652
Working with CORBA
653
Working with RMI
654
Working with Jacada
655
Java Custom Filters - Overview
656
Java Custom Filters - Determining which Elements to Include
657
How to Record a Java Vuser Script
657
How to Record Java Scripts Using Windows XP and 2000 Server
658
How to Run a Script as Part of a Package
659
How to Manually Insert Java Methods
659
How to Manually Configure Script Generation Settings
661
How to Create a Custom Java Filter
663
Hook File Structure
664
Java Icon Reference List
666
Java Vuser Protocol - Manually Programming Scripts
667
Manually Programming Java Scripts - Overview
667
Java Protocol Programming Tips
667
Running Java Vuser Scripts
669
Opening Java Vuser Scripts in Eclipse
670
Compiling and Running a Script as Part of a Package
670
How to Manually Create a Java Script
671
How to Enhance a Java Script
673
Troubleshooting and Limitations - Java Protocol
677
Java over HTTP Protocol
677
Java over HTTP Protocol Overview
677
Viewing Responses and Requests in XML Format
677
How to Record with Java over HTTP
678
HP LoadRunner (12.00)
Page 23 of 1743
LoadRunner User Guide
Contents
How to Debug Java over HTTP scripts
679
How to Insert Parameters into Java over HTTP Scripts
680
Java over HTTP - Troubleshooting and Limitations
680
LDAP Protocol
681
LDAP Protocol Overview
682
LDAP Protocol Example Script
682
Defining Distinguished Name Entries
683
LDAP Connection Options
684
Troubleshooting and Limitations - LDAP
685
Mailing Service Protocols
685
Mailing Service Protocols Overview
685
IMAP Protocol Overview
686
MAPI Protocol Overview
686
POP3 Protocol Overview
687
SMTP Protocol Overview
687
Mobile Protocols
Mobile Protocols Overview
688
688
Protocol Options for Mobile
688
How to Select a Recording Method for Mobile Applications
689
Network Speed Simulation
Network > Speed Simulation Node
Mobile Application - HTTP/HTML
691
692
693
Recording Methods
693
Recording Traffic into a Capture (Sniffer) File
694
Record Traffic with VuGen's Mobile Sniffer Agent
695
Capture Traffic With an External SnifferTool
697
Analyzing Traffic
698
Recording with Emulation
699
How to Create a Script by Analyzing Traffic
704
How to Record and Analyze a Script for Mobile Applications
707
How to Record with the Mobile Recorder
708
HP LoadRunner (12.00)
Page 24 of 1743
LoadRunner User Guide
Contents
Recording Wizard
709
Recording Method Dialog Box
710
Analyze Traffic Dialog Box
710
Configure and Record Dialog Box
711
Record Emulation Dialog Box
712
Proxy Recording Dialog Box
712
LoadRunner Mobile Recording Application User Interface
713
Mobile TruClient
715
Mobile TruClient Protocol
715
How to Record a Script with Mobile TruClient
715
How to Add, Remove, and Import Mobile Device Settings for Mobile TruClient
716
Mobile TruClient Device Manager Dialog Box
716
SAP Mobile Platform
How to create an SMP (SAP Mobile Platform) script
.NET Protocol
.NET Protocol Overview
Considerations for Working with the .NET Protocol
717
717
718
718
718
Viewing Data Sets and Grids
719
Recording WCF Duplex Communication
720
Replacement of the Callback in the Script
723
Asynchronous Calls
724
Recording Dual HTTP Bindings
725
Connection Pooling
725
Debugging .NET Vuser Scripts
726
.NET Filters Overview
727
.NET Filters - Advanced
728
Guidelines for Setting .NET Filters
729
How to Configure Application Security and Permissions
732
.NET - Troubleshooting and Limitations
733
Oracle NCA Protocol
Oracle NCA Protocol Overview
HP LoadRunner (12.00)
734
734
Page 25 of 1743
LoadRunner User Guide
Contents
Oracle NCA Protocol Example Scripts
735
Oracle NCA Record and Replay Tips
736
Pragma Mode
736
How to Enable the Recording of Objects by Name
738
How to Launch Oracle Applications via the Personal Home Page
740
Oracle NCA - Troubleshooting and Limitations
740
RDP Protocol
742
RDP Protocol - Overview
743
RDP Recording Tips
743
Working with Clipboard Data (RDP Protocol)
745
Correlating Clipboard Parameters
747
RDP Snapshots - Overview
747
Image Synchronization Overview
748
Image Synchronization Tips (RDP Protocol)
749
Image Synchronization - Shifted Coordinates (RDP Protocol)
750
Setting Security Levels in RDP Vuser Scripts
750
RDP Agent (Agent for Microsoft Terminal Server) Overview
753
How to Install / Uninstall the RDP Agent
755
How to Add Image Synchronization Points to a Script
756
Failed Image Synchronization Dialog Box (RDP Protocol)
756
RDP - Troubleshooting and Limitations
758
RTE Protocol
759
RTE Protocol Overview
759
Working with Ericom Terminal Emulation
760
SSL and SSH Support for Ericom
761
Typing Input into a Terminal Emulator
762
Setting the Timeout Value for TE_type
762
Allowing a Vuser to Type Ahead
763
Generating Unique Device Names
763
Setting the Field Demarcation Characters
764
Reading Text from the Terminal Screen
765
HP LoadRunner (12.00)
Page 26 of 1743
LoadRunner User Guide
Contents
RTE Synchronization Overview
766
Synchronizing Block-Mode (IBM) Terminals
767
Synchronizing Character-Mode (VT) Terminals
769
How to Map Terminal Keys to PC Keyboard Keys
772
How to Record RTE Vuser Scripts
773
How to Implement Continue on Error
775
RTE - Terminal Emulation - Troubleshooting and Limitations
776
SAP Protocols
776
Selecting a SAP Protocol Type
776
SAP GUI Protocol
776
SAP Web Protocol
779
SAP (Click & Script) Protocol
780
Replaying SAP GUI Optional Windows
781
How to Configure the SAP Environment
782
How to Record SAP GUI Scripts
787
How to Replay SAP GUI Scripts
789
How to Run SAP GUI Scripts in a Scenario
789
How to Enhance SAP GUI Scripts
790
Additional SAP Resources
795
SAP GUI, SAP Web, and SAP (Click & Script) - Troubleshooting and Limitations
795
Siebel Web Protocol
797
Siebel Web Protocol Overview
797
Siebel Web Recording Options and Run-Time Settings
797
How to Record Transaction Breakdown Information
798
Siebel Web - Troubleshooting and Limitations
799
Silverlight Protocol
801
Silverlight Protocol - Overview
801
How to Import WSDL Files
801
Silverlight - Troubleshooting and Limitations
802
Web (HTTP/HTML) Protocol
Web (HTTP/HTML) Protocol - Overview
HP LoadRunner (12.00)
803
803
Page 27 of 1743
LoadRunner User Guide
Contents
Using the LoadRunner JavaScript Engine
806
JavaScript Engine: XMLHTTPRequest Example
811
How to Convert a Web (HTTP/HTML) Vuser Script into a Java Vuser Script
812
How to create a script for a REST API
813
Examples
814
How to record the SPDY protocol
815
Applications that Use Smooth Streaming
815
Converting a TruClient Script to a Web HTTP/HTML Script
817
Troubleshooting and Limitations - Web (HTTP/HTML) Protocol
818
Web Protocols (Generic)
818
Web Protocols - Overview
818
Web Vuser Technology
819
Web Vuser Types
820
Text and Image Verification (Web Vuser Scripts) - Overview
820
Understanding Web Text Check Functions
821
How to Add Text Checks and Image Checks (Web Vuser Protocols)
822
Web Snapshots - Overview
823
Browser Emulation - Overview
825
How to Perform Load Testing with nCipher HSM
827
Working with Cache Data
828
How to Insert Caching Functions
Data Format Extensions (DFEs) - Overview
830
831
How to Implement Data Format Extension (DFE) Support
834
How to Define a Chain of DFEs
834
How to Enable DFE Support
835
How to Configure DFE Support
836
How to Apply DFE Chains to Sections of the HTTP Message
837
How DFEs Modify a Vuser Script
838
Data Format Extension List
839
Applying DFEs to a String
840
Google Web Toolkit - Data Format Extension (GWT-DFE) - Overview
841
HP LoadRunner (12.00)
Page 28 of 1743
LoadRunner User Guide
Contents
Implementing GWT-DFE Support
Troubleshooting - Data Format Extension (DFE)
Web Services
845
847
847
Web Services - Adding Script Content
847
Web Service Testing Overview
847
Adding Web Service Script Content - Overview
848
Script Integration
849
Web Service Call Attachments
850
Special Argument Types
850
Server Traffic Scripts Overview
853
Capture Files
854
Filtering Traffic
855
Data on Secure Servers
856
How to Add Content
856
How to Assign Values to XML Elements
858
How to Generate a Test Automatically
859
How to Create a Script by Analyzing Traffic
860
How to Create Capture Files Using lrtcpdump
861
Specify Services Screen
862
Specify Application to Record Dialog Box
863
Import SOAP Dialog Box
864
New Web Service Call Dialog Box
865
Add Input Attachment Dialog Box
872
Add Array Elements Dialog Box
873
Process Base64 Data - Simple Data Dialog Box
873
Process Base64 Data - Complex Data Dialog Box
874
Aspects List
875
Specify Services Screen
876
Specify Traffic Information Screen
877
SSL Configuration Dialog Box
877
Web Services - Preparing Scripts for Replay
HP LoadRunner (12.00)
878
Page 29 of 1743
LoadRunner User Guide
Contents
Preparing for Replay Overview
878
Testing Web Service Transport Layers Overview
879
Sending Messages over HTTP/HTTPS
879
JMS Transport Overview
879
JMS Script Functions
880
JMS Message Structure
881
Asynchronous Messages Overview
881
Sending Asynchronous Calls with HTTP/HTTPS
881
WS-Addressing
882
Database Integration Overview
883
Connecting to a Database
884
Using Data Retrieved from SQL Queries
884
Validating Database Values after a Web Service Call
886
Checking Returned Values Through a Database
887
Performing Actions on Datasets
889
Customizing Overview
889
User Handlers
889
Custom Configuration Files
891
User Handler Examples
892
How to Prepare Scripts for Replay
894
How to Send Messages over JMS
895
How to Send Messages over HTTP/S
896
How to Define a Testing Method
898
How to Add a Database Connection
899
How to Create a User Handler
900
How to Customize Configuration Files
903
Web Services Snapshots - Overview
903
Database Connection Dialog Box
906
Connection String Generator Dialog Box
906
Web Services - Managing Services
907
Managing Services Overview
907
HP LoadRunner (12.00)
Page 30 of 1743
LoadRunner User Guide
Contents
Importing Services
910
Comparison Reports
910
Web Reference Analyzer
911
How to Add and Manage Services
912
How to Analyze WSDL Dependencies
913
Manage Services Dialog Box
913
Connection Settings Dialog Box
916
Import Service Dialog Box
917
Search for Service in UDDI Dialog Box
917
XML/WSDL Comparison Dialog Box
918
WSDL Reference Analyzer Dialog Box
919
Web Services - Security
Setting Security Overview
919
919
Security Tokens and Encryption
920
SAML Security Options
923
Security Scenarios Overview
924
Choosing a Security Model
924
Private, Imported, and Shared Scenarios
925
Scenario Categories
925
WCF Scenario Settings
927
The WsHttpBinding Scenario
928
The Federation Scenario
929
The Custom Binding Scenarios
930
Advanced Scenario Setting
931
WCF Extensibility
936
Preparing Security Scenarios for Running
937
Parameterizing Security Elements
937
Protecting Custom Headers
937
Emulating Users with Iterations
938
How to Add Security to a Web Service Script
939
How to Add SAML Security
940
HP LoadRunner (12.00)
Page 31 of 1743
LoadRunner User Guide
Contents
How to Create and Manage Security Scenarios
940
How to Parameterize Security Elements
942
Set Security Properties Dialog Box
943
Security Scenario Editor Dialog Box
948
Select Certificate Dialog Box
948
Web Services Security Examples
950
Troubleshooting and Limitations - Web Services
952
Troubleshooting and Limitations - Web Services
Windows Sockets Protocol
Recording Windows Sockets - Overview
953
954
954
Translation Tables
954
Windows Sockets Data
955
Windows Sockets Snapshots - Overview
956
Data Navigation Tools
958
Buffer Data Editing
958
How to Record a Windows Sockets Script
959
How to View and Modify Windows Sockets Buffers
960
Data Buffers
963
Go To Offset Dialog Box
964
MMS (Multimedia Messaging Service) Protocol Overview
965
How to Run an MMS Scenario in the Controller
965
Advanced Topics
Manually Programming a Script using the VuGen Editor
967
967
Manually Programming Scripts - Overview
967
C Vuser Scripts
967
Java Vusers
968
.NET Vusers
969
Creating Scripts in External IDEs
969
Creating Vuser Scripts or LoadRunner Tests in Visual Studio or Eclipse
969
How to Create a Vuser Script in Visual Studio
970
How to Create a Vuser Script in Eclipse
971
HP LoadRunner (12.00)
Page 32 of 1743
LoadRunner User Guide
Contents
How to Develop a Unit Test Using Visual Studio (NUnit test)
972
How to Develop a Unit Test Using Eclipse (JUnit or Selenium test)
973
Using DLLs and Customizing VuGen
974
Calling Functions from External DLLs
974
How to Load a DLL Locally
975
How to Load a DLL Globally
976
Recording OLE Servers
976
Using CmdLine
977
CmdLine Environment Variables
978
How to Create a New Vuser Type
978
VuGen File and Library Locations
981
Storing Run-Time Settings in External Files
982
Creating and Running Scripts in Linux
982
Creating and Running Scripts in Linux - Overview
982
Programming Vuser Actions
983
How to Create a Template
984
How to Configure Run-Time Settings Manually
984
How to Define Transaction and Insert Rendezvous Points Manually
987
How to Compile Scripts Manually on Linux
987
Programming with the XML API
988
Programming with the XML API - Overview
988
Using XML Functions
988
Specifying XML Function Parameters
991
XML Attributes
992
Structuring XML Scripts
992
Enhancing a Recorded Session with XML
993
How to Use Result Parameters
996
Troubleshooting and Limitations - Programming
998
Non-English Language Support
999
Non-English Language Support - Overview
Page Request Header Language
HP LoadRunner (12.00)
999
1000
Page 33 of 1743
LoadRunner User Guide
Contents
How to Convert Encoding Format of a String
1000
How to Convert Encoding Format of Parameter Files
1001
How to Record Web Pages with Foreign Languages
1002
Foreign Languages - Troubleshooting and Limitations
1003
Additional Components
1006
Third Party Components
1009
Installing the Citrix Server Agent
1009
Installing VTS
1010
Installing the Microsoft Terminal Server Agent
1011
Troubleshooting and Limitations - Additional Components
1011
Controller
Understanding LoadRunner
LoadRunner Controller Overview
Scripts and Test Types
1013
1013
1013
1013
Controller Workflow
1014
Controller Technology
1015
Controller Window
1016
HP LoadRunner Agents
1018
Load Testing Overview
1019
The HP LoadRunner Solution
1020
HP LoadRunner Terminology
1020
The HP LoadRunner Testing Process
1021
License Utility
1022
LoadRunner License Utility
1022
LoadRunner License Utility - New License
1026
How to Install a New License
1029
Additional Information About VUD Licenses
1029
Designing Load Test Scenarios
Planning Load Test Scenarios
1030
1030
Load Test Planning Overview
1030
Load Testing Objectives
1031
HP LoadRunner (12.00)
Page 34 of 1743
LoadRunner User Guide
Contents
How to Plan a Load Test
1033
How to Analyze the Application
1033
How to Define the Load Test Objectives
1036
How to Plan the LoadRunner Implementation
1037
Designing Scenarios
Manual Scenarios
Changing Scenario Modes
1040
1040
1040
Goals Types for Goal-Oriented Scenarios
1041
How to Design a Goal-Oriented Scenario
1043
How to Design a Manual Scenario
1045
How to Change the Scenario Mode (Manual Scenario)
1047
How to View/Modify Scripts in the Scenario
1047
Relative Paths for Scripts
1050
Vuser Statuses
1050
Add Group Dialog Box
1051
Add Script Dialog Box
1052
Add Vusers Dialog Box
1053
Design Tab
1054
Edit Scenario Goal Dialog Box
1056
Group Information Dialog Box
1058
Multiple Run-Time Settings Mode Dialog Box
1060
New Scenario Dialog Box
1061
Scenario Goal Pane
1063
Scenario Groups/Scripts Pane - Manual Scenarios
1064
Scenario Scripts Pane - Goal-Oriented Scenarios
1067
Scenario Start Time Dialog Box
1069
Script Information Dialog Box
1070
Vuser Information Dialog Box
1071
Vusers Dialog Box
1072
Load Generators
Load Generators - Overview
HP LoadRunner (12.00)
1074
1074
Page 35 of 1743
LoadRunner User Guide
Contents
Adding a Cloud-Based Load Generator - Overview
1076
How to Add a Load Generator to a Scenario
1077
Managing Cloud Accounts - Overview
1079
How to Manage Cloud Accounts
1081
Manage Cloud Accounts Dialog Box
1081
How to Modify Load Generator Settings
1083
Load Balancing
1083
Setting up a Load Generator Environment
1084
How to Connect/Disconnect a Load Generator
1084
How to Connect to a Linux Load Generator Without Using RSH
1084
To stop the agent daemon:
1085
Linux Environment Variables
1085
Add New Load Generator/Load Generator Information Dialog Box
1085
Create Cloud Load Generator Dialog Box
1088
Use Cloud Load Generator Dialog Box
1090
Load Generator Configuration > Connection Log Tab
1091
Load Generator Configuration > Run-Time File Storage Tab
1092
Load Generator Configuration > Run-Time Quota Tab
1093
Load Generator Configuration > Connections Tab
1093
Load Generator Configuration > Status Tab
1094
Load Generator Configuration > Terminal Services Tab
1094
Load Generator Configuration > Linux Environment Tab
1096
Load Generator Configuration > Vuser Limits Tab
1098
Load Generator Configuration > Vuser Status Tab
1099
Load Generator Configuration > Network Virtualization Tab
1100
Load Generators Dialog Box
1101
Network Profile Manager Dialog Box
1104
Network and Security Manager
1105
Network and Security Manager - Command Line Tool
1108
Common Examples
1113
Set the agent proxy and port, and the MI Listener over a firewall
HP LoadRunner (12.00)
1113
Page 36 of 1743
LoadRunner User Guide
Contents
Read parameters from a file
1113
Remote updates
1113
Remote updates - multiple
1114
Remote updates - multiple from file
1114
Restarting the agent
1114
SSL Utility
Scheduling Manual Scenarios
1114
1116
Scheduling Manual Scenarios Overview
1116
Scheduling by Scenario or Group
1116
Schedule Run Modes
1117
How to Define a Schedule for the Scenario - Workflow
1118
How to Add Actions to the Scenario Schedule
1121
How to Edit Schedule Actions
1124
Schedule Actions
1125
Add Action Dialog Box
1127
Edit Action Dialog Box
1128
Scenario Schedule Pane
1129
Service Level Agreements
1129
Service Level Agreements Overview
1130
Tracking Period
1130
How to Define Service Level Agreements
1131
How to Define Service Level Agreements - Use-Case Scenario
1132
Advanced Options Dialog Box
1134
Goal Details Dialog Box
1135
Service Level Agreement Pane
1135
Service Level Agreement Wizard
1136
Select a Measurement Page
1137
Select Transactions Page
1138
Set Load Criteria Page
1139
Set Percentile Threshold Values Page
1140
Set Threshold Values Page (Goal Per Time Interval)
1141
HP LoadRunner (12.00)
Page 37 of 1743
LoadRunner User Guide
Contents
Set Threshold Values Page (Goal Per Whole Run)
Multiple IP Addresses
1142
1142
Multiple IP Addresses Overview
1142
How to Add IP Addresses to a Load Generator
1143
IP Wizard
1144
Configuring Terminal Services Settings
1146
Terminal Services Overview
1146
About Terminal Services
1146
How to Use the Terminal Services Manager
1147
How to Configure Terminal Sessions Over a Firewall
1148
Configuring Network Virtualization Settings
1149
Network Virtualization Overview
1149
Virtual Locations Overview
1151
Excluding Machines from Network Virtualization
1151
How to Run a Scenario with Network Virtualization
1152
Network Virtualization Settings Dialog Box
1155
Running Load Test Scenarios
1156
Online Monitor Graphs
1156
Online Monitor Graphs Overview
1157
About Online Monitor Graphs
1157
Viewing Monitor Data Offline
1157
How to Display Online Monitor Graphs
1157
How to Customize Online Graph and Measurement Settings
1158
How to Manage Online Graphs
1160
Graph Configuration Dialog Box
1161
Measurement Configuration Dialog Box
1163
Open a New Graph Dialog Box
1165
Overlay Graphs Dialog Box
1165
Available Graphs Tree
1166
Configuring Scenario Options
1169
Configuring Scenario Options Overview
HP LoadRunner (12.00)
1169
Page 38 of 1743
LoadRunner User Guide
Contents
Expert Mode
1170
Run-Time File Storage Locations
1170
Path Translation
1171
How to Configure Scenario Options
1172
Path Translation Table
1173
Options Dialog Box
1175
Options > Debug Information Tab
1176
Options > Execution Tab
1177
Options > General Tab
1178
Options > Monitors Tab
1178
Options > Output Tab
1180
Options > Path Translation Tab
1181
Options > Run-Time File Storage Tab
1182
Options > Run-Time Settings Tab
1182
Options > Timeout Tab
1183
Before Running Your Scenario
1185
How to Prepare a Scenario to Run
1185
Set Results Directory Dialog Box
1188
Summary Information Dialog Box
1189
Running Scenarios
1190
Running Scenarios Overview
1190
Before run
1190
Start of run
1190
During run
1190
End of run
1191
How to Run a Scenario
1191
Initialize, Run, or Stop Vuser Groups - Use-Case Scenario
1193
Control Vusers During a Scenario Run - Use-Case Scenario
1194
Run/Stop Individual Vusers, or Add New Vusers - Use-Case Scenario
1196
Initialize/Run Additional Vusers or Stop Running Vusers - Use-Case Scenario
1199
Execution Notes Dialog Box
1204
HP LoadRunner (12.00)
Page 39 of 1743
LoadRunner User Guide
Contents
Output Window
1205
Filtered Tab
1205
Summary Tab
1207
Run Tab
1209
Run/Stop Vusers Dialog Box
1210
Scenario Groups Pane
1213
Scenario Status Pane
1215
Transactions Dialog Box
1215
Vuser Script Log
1216
Rendezvous Points
1217
Rendezvous Points Overview
1218
How to Set Up a Rendezvous in a Scenario
1218
Rendezvous Information Dialog Box
1219
After the Scenario Run
1221
Post Scenario Run Procedures - Overview
1221
Collating Run Data
1221
How to Collate Scenario Run Results
1222
Results Folder File Structure
1222
Collate Results Dialog Box
1224
Using QuickTest or Unified Functional Testing Tests in LoadRunner
1225
Using QuickTest or Unified Functional Testing Tests in LoadRunner - Overview 1225
About GUI Vuser Scripts
1225
Understanding GUI Vuser Technology
1226
Guidelines for Using QuickTest or Unified Functional Testing Tests in
LoadRunner
1227
How to Add a QuickTest or Unified Functional Testing Test to a Load Test
Scenario
1228
Managing Scenarios Using Application Lifecycle Management
1229
Managing Scenarios Using Application Lifecycle Management - Overview
1229
How to Work with Scenarios in ALM Projects
1229
Connect to ALM
1229
How to Save Scenarios to ALM Projects
1230
HP LoadRunner (12.00)
Page 40 of 1743
LoadRunner User Guide
Contents
How to Add Vuser Scripts from an Application Lifecycle Management Project
1230
HP ALM Connection Dialog Box [Controller]
1231
Working with Firewalls in LoadRunner
1232
Monitors Over a Firewall
1233
How to Set Up Your System to Use Firewalls
1233
How to Configure the Over-Firewall System
1234
How to Configure the System to Monitor Servers Over a Firewall
1237
How to Configure the LoadRunner Agent on Each Monitor Over Firewall Machine
1238
How to Configure Monitors Over a Firewall
1240
Agent Configuration Dialog Box
1241
Agent Configuration Settings Dialog Box
1243
Authentication Settings Dialog Box
1244
MI Listener and Over Firewall Overview
1245
MI Listener Configuration Dialog Box
1247
Monitor Configuration Dialog Box
1248
Troubleshooting and Limitations - Firewalls
1250
Working with Diagnostics
1253
Configuring J2EE/.NET Diagnostics
1253
J2EE/.NET Diagnostics Overview
1254
Monitoring Server Requests
1254
How to Specify J2EE/.NET Diagnostics Server Details
1254
How to Configure a LoadRunner Scenario to use J2EE/.NET Diagnostics
1254
How to View J2EE/.NET Diagnostics Data in LoadRunner During a Scenario
Run
1255
How to View Offline J2EE/.NET Diagnostics Results
1256
Diagnostics for J2EE/.NET Setup Dialog Box
1256
J2EE/.NET Configuration Dialog Box
1257
Monitoring Load Test Scenarios
1258
HP Performance Monitoring Best Practices Guide
1258
Working with LoadRunner Online Monitors
1258
Monitoring Process Overview
1258
How to Set Up a Monitoring Environment
1259
HP LoadRunner (12.00)
Page 41 of 1743
LoadRunner User Guide
Contents
Monitor Types
1262
Add Machine Dialog Box
1263
<Monitor Type> Monitor Configuration Dialog Box
1264
<monitor name> Dialog Box
1265
Runtime and Transaction Monitoring
1266
Runtime Graphs Overview
1266
Transaction Monitor Graphs Overview
1267
Web Resource Monitors
1268
Web Resource Monitoring Overview
1268
WebSocket Statistics Monitor
1271
HTTP Status Codes
1272
System Resource Monitoring
1273
System Resource Monitors Overview
1273
Windows Resource Monitoring
1273
UNIX Resource Monitoring
1274
SNMP Resource Monitoring
1274
How to Set up the UNIX Monitoring Environment
1274
UNIX Resources Performance Counters
1276
Add Windows Resources Measurements Dialog Box
1277
Network Delay Monitoring
1277
Network Monitoring Overview
1277
How to Set Up the Network Monitoring Environment
1278
How to Configure the Linux Source Machine for Network Monitoring
1280
Adding Destination Machines for Network Delay Monitoring Dialog Box
1281
Network Delay Time Dialog Box
1282
Network Delay Time Graph
1283
Network Monitor Settings for Defined Path Dialog Box
1283
Troubleshooting and Limitations - Network Delay Monitor
1284
Web Server Resource Monitoring
1286
Web Server Resource Monitoring Overview
1286
How to change the Apache default server properties
1286
HP LoadRunner (12.00)
Page 42 of 1743
LoadRunner User Guide
Contents
HTTP Status Codes
1286
Microsoft IIS Performance Counters
1287
Apache Performance Counters
1288
Web Application Server Monitoring
1289
Web Application Server Resource Monitoring Overview
1289
MS Active Server Pages Performance Counters
1289
Microsoft Active Server Pages Dialog Box
1290
Database Server Resource Monitoring
1290
Database Resource Monitoring Overview
1290
How to Set Up the Oracle Monitoring Environment
1291
Oracle Performance Counters
1293
SQL Server Performance Counters
1294
Configuring Oracle JDBC Monitor Dialog Box
1295
Shunra Network Virtualization Monitoring
1296
Average Latency Monitor
1296
Packet Loss Monitor
1297
Average Throughput Monitor
1299
Average Bandwidth Utilization Monitor
1301
Total Throughput Monitor
1302
SiteScope Server Monitoring
1303
SiteScope Resource Monitoring
1304
Flex Monitoring
1304
Streaming Media Monitoring
1304
Streaming Media Monitoring Overview
1304
RealPlayer Client Performance Counters
1305
Media Player Client Performance Counters
1305
ERP/CRM Server Resource Monitoring
1306
ERP/CRM Server Resource Monitoring Overview
1306
Siebel Server Manager Performance Counters
1306
Siebel Server Manager Configuration Dialog Box
1308
Troubleshooting and Limitations - Siebel Server Manager Monitor
1308
HP LoadRunner (12.00)
Page 43 of 1743
LoadRunner User Guide
Contents
Application Deployment Solution Monitoring
1309
Application Deployment Solution Monitoring Overview
1309
How to Set up the Citrix Monitoring Environment
1309
Citrix MetaFrame Performance Counters
1310
Citrix Monitor Dialog Box
1315
Middleware Performance Monitoring
1315
Middleware Performance Monitoring Overview
1316
How to Set Up the IBM WebSphere MQ Monitor
1316
IBM WebSphere MQ Performance Counters
1317
IBM WebSphere MQ Queue Attributes
1319
MQ Monitor Add Measurements Dialog Box
1320
Infrastructure Resources Monitoring
1322
Infrastructure Resources Monitoring Overview
1322
Network Client Performance Counters
1322
Service Virtualization Integration
HP Service Virtualization Integration - Overview
Virtual Service Locks
1322
1322
1325
Service Virtualization Monitoring Overview
1325
How to Use Service Virtualization when Designing Scenarios
1327
Service Virtualization User Interface
1329
Appendixes
Secure Host Communication
1331
1331
Secure Host Communication Overview
1331
Host Security Configuration
1333
Remote Security Configuration
1333
Host Security Best Practices
1334
How to Configure Security Settings Locally on Hosts
1335
How to Register Hosts in Host Security Manager
1336
How to Update Host Security Settings Remotely
1336
How to Change a Certificate
1338
Add Hosts Dialog Box
1338
HP LoadRunner (12.00)
Page 44 of 1743
LoadRunner User Guide
Contents
Host Security Manager Window
1339
Host Security Setup Dialog Box
1340
Update Security Key Dialog Box
1341
Update Security Mode Dialog Box
1342
Troubleshooting and Limitations - Secure Host Communication
1342
Controller Command Line Arguments
1343
Controller Command Line Arguments Overview
1343
Invoke the Controller from the Command Line
1343
Command Line Arguments - Rules
1344
Application Lifecycle Management Arguments
1344
Run Time Arguments
1345
Working with Digital Certificates
1345
Digital Certificates Overview
1345
Using Digital Certificates with Firewalls
1346
How to Create and Use Digital Certificates
1346
Troubleshooting and Limitations - Controller
Analysis
Working with Analysis
Introduction to Analysis
1348
1350
1350
1350
Analysis Overview
1350
Analysis Basics
1351
Analysis Graphs
1352
Analysis API
1354
Network Virtualization
1354
How to Customize the Layout of Analysis Windows
1354
Analysis Toolbars
1355
Session Explorer Window
1357
Open a New Graph Dialog Box
1359
Print Graphs or Reports
1360
Configuring Analysis
Summary Data Versus Complete Data
HP LoadRunner (12.00)
1361
1361
Page 45 of 1743
LoadRunner User Guide
Contents
Importing Data Directly from the Analysis Machine
1361
How to Configure Settings for Analyzing Load Test Results
1363
General Tab (Options Dialog Box)
1363
Result Collection Tab (Options Dialog Box)
1366
Data Aggregation Configuration Dialog Box (Result Collection Tab)
1369
Database Tab (Options Dialog Box)
1370
Advanced Options Dialog Box (Database Tab)
1375
Web Page Diagnostics Tab (Options Dialog Box)
1375
Session Information Dialog Box (Options Dialog Box)
1376
Configuring Graph Display
1378
How to Customize the Analysis Display
1378
Display Options Dialog Box
1378
Editing Main Chart Dialog Box (Display Options Dialog Box)
1380
Chart Tab (Editing MainChart Dialog Box)
1381
Series Tab (Editing MainChart Dialog Box)
1382
Legend Window
1383
Measurement Description Dialog Box
1386
Measurement Options Dialog Box
1387
Legend Columns Options Dialog Box
1388
Apply/Edit Template Dialog Box
1389
Color Palettes
1391
Color Palette Dialog Box
1391
Filtering and Sorting Graph Data
1394
Filtering Graph Data Overview
1394
Sorting Graph Data Overview
1395
Filter Conditions
1395
Custom Filter Dialog Box
1404
Filter Dialog Boxes
1405
Filter Builder Dialog Box
1407
Hierarchical Path Dialog Box
1408
Scenario Elapsed Time Dialog Box
1409
HP LoadRunner (12.00)
Page 46 of 1743
LoadRunner User Guide
Contents
Set Dimension Information Dialog Box
1409
Vuser ID Dialog Box
1410
Working with Analysis Graph Data
1411
Determining a Point's Coordinates
1412
Drilling Down in a Graph
1412
Changing the Granularity of the Data
1414
Viewing Measurement Trends
1415
Auto Correlating Measurements
1416
Viewing Raw Data
1417
How to Manage Graph Data
1417
Drill Down Options Dialog Box
1419
Auto Correlate Dialog Box
1420
Graph/Raw Data View Table
1423
Graph Properties Window
1424
Viewing Load Test Scenario Information
1426
Viewing Load Test Scenario Information
1426
How to Configure Controller Output Messages Settings
1427
Controller Output Messages Window
1427
Summary Tab
1428
Filtered Tab
1430
Scenario Run Time Settings Dialog Box
1432
Cross Result and Merged Graphs
1432
Cross Result and Merged Graphs Overview
1432
Cross Result Graphs Overview
1433
Merging Types Overview
1434
How to Generate Cross Results Graphs
1436
How to Generate Merged Graphs
1436
Merge Graphs Dialog Box
1437
Defining Service Level Agreements
1437
Service Level Agreements Overview
1438
Tracking Period
1438
HP LoadRunner (12.00)
Page 47 of 1743
LoadRunner User Guide
Contents
How to Define Service Level Agreements
1439
How to Define Service Level Agreements - Use-Case Scenario
1440
Service Level Agreement Pane
1443
Advanced Options Dialog Box (Service Level Agreement Pane)
1443
Goal Details Dialog Box (Service Level Agreement Pane)
1444
Service Level Agreement Wizard
1445
Select a Measurement Page
1445
Select Transactions Page
1446
Set Load Criteria Page
1447
Set Percentile Threshold Values Page
1448
Set Threshold Values Page (Goal Per Time Interval)
1449
Set Threshold Values Page (Goal Per Whole Run)
1450
Working with Application Lifecycle Management
1451
Managing Results Using ALM - Overview
1451
How to Connect to ALM
1451
How to Work with Results in ALM - Without Performance Center
1452
How to Work with Results in ALM - With Performance Center
1453
How to Upload a Report to ALM
1455
HP ALM Connection Dialog Box
1456
Upload Report to Test Lab Dialog Box
1458
Analysis Graphs
Transaction Graphs
1459
1459
Transaction Graphs Overview
1459
Average Transaction Response Time Graph
1459
Total Transactions per Second Graph
1461
Transaction Breakdown Tree
1462
Transactions per Second Graph
1463
Transaction Performance Summary Graph
1464
Transaction Response Time (Distribution) Graph
1465
Transaction Response Time (Percentile) Graph
1466
Transaction Response Time (Under Load) Graph
1467
HP LoadRunner (12.00)
Page 48 of 1743
LoadRunner User Guide
Contents
Transaction Summary Graph
Flex Graphs
1468
1469
Flex RTMP Throughput Graph
1469
Flex RTMP Other Statistics Graph
1470
Flex RTMP Connections Graph
1471
Flex Streaming Delivery Graph
1471
Flex Average Buffering Time Graph
1472
Service Virtualization
1473
Service Virtualization Graphs Overview
1473
HP Service Virtualization Operations Graph
1473
HP Service Virtualization Services Graph
1474
Vuser Graphs
1475
Vuser Graphs Overview
1475
Rendezvous Graph (Vuser Graphs)
1475
Running Vusers Graph
1476
Vuser Summary Graph
1477
Error Graphs
1478
Error Graphs Overview
1478
Errors per Second (by Description) Graph
1478
Errors per Second Graph
1479
Error Statistics (by Description) Graph
1480
Error Statistics Graph
1481
Total Errors per Second Graph
1482
Web Resources Graphs
1483
Web Resources Graphs Overview
1483
Hits per Second Graph
1483
Throughput Graph
1484
HTTP Status Code Summary Graph
1485
HTTP Status Codes
1486
HTTP Responses per Second Graph
1488
Pages Downloaded per Second Graph
1489
HP LoadRunner (12.00)
Page 49 of 1743
LoadRunner User Guide
Contents
Retries per Second Graph
1491
Retries Summary Graph
1492
Connections Graph
1492
Connections per Second Graph
1493
SSLs per Second Graph
1494
User-Defined Data Point Graphs
1495
User-Defined Data Point Graphs Overview
1495
Data Points (Average) Graph
1496
Data Points (Sum) Graph
1497
Network Monitor Graphs
1498
Network Monitor Graphs Overview
1498
Network Delay Time Graph
1499
Network Segment Delay Graph
1500
Network Sub-Path Time Graph
1501
Web Page Diagnostics Graphs
1502
Web Page Diagnostics Tree View Overview
1502
Web Page Diagnostics Graphs Overview
1502
How to View the Breakdown of a Transaction
1504
Web Page Diagnostics Content Icons
1505
Web Page Diagnostics Graph
1505
Page Component Breakdown Graph
1507
Page Component Breakdown (Over Time) Graph
1509
Page Download Time Breakdown Graph
1510
Page Download Time Breakdown (Over Time) Graph
1512
Page Download Time Breakdown Graph Breakdown Options
1514
Time to First Buffer Breakdown Graph
1515
Time to First Buffer Breakdown (Over Time) Graph
1517
Client Side Breakdown (Over Time) Graph
1519
Client Side Java Script Breakdown (Over Time) Graph
1520
Downloaded Component Size Graph
1521
System Resource Graphs
HP LoadRunner (12.00)
1522
Page 50 of 1743
LoadRunner User Guide
Contents
System Resource Graphs Overview
1523
Server Resources Performance Counters
1523
Linux Resources Default Measurements
1523
Windows Resources Default Measurements
1524
Server Resources Graph
1526
Host Resources Graph
1527
SiteScope Graph
1528
SNMP Resources Graph
1529
Linux Resources Graph
1530
Windows Resources Graph
1531
Network Virtualization Graphs
1532
Packet Loss Graph
1532
Average Latency Graph
1534
Average Bandwidth Utilization Graph
1536
Average Throughput Graph
1537
Total Throughput Graph
1539
Firewall Server Graphs
1540
Firewall Server Monitor Graphs Overview
1540
Check Point FireWall-1 Server Measurements
1540
Check Point FireWall-1 Server Graph
1541
Web Server Resource Graphs
1541
Web Server Resource Graphs Overview
1542
Apache Server Measurements
1542
IIS Server Measurements
1542
Apache Server Graph
1543
Microsoft Information Internet Server (IIS) Graph
1544
Web Application Server Resource Graphs
1545
Web Application Server Resource Graphs Overview
1545
Web Application Server Resource Graphs Measurements
1546
Microsoft Active Server Pages (ASP) Graph
1553
Oracle9iAS HTTP Server Graph
1553
HP LoadRunner (12.00)
Page 51 of 1743
LoadRunner User Guide
Contents
WebLogic (SNMP) Graph
1554
WebSphere Application Server Graph
1554
Database Server Resource Graphs
1554
Database Server Resource Graphs Overview
1554
DB2 Database Manager Counters
1555
DB2 Database Counters
1556
DB2 Application Counters
1561
Oracle Server Monitoring Measurements
1566
SQL Server Default Counters
1567
Sybase Server Monitoring Measurements
1568
DB2 Graph
1572
Oracle Graph
1573
SQL Server Graph
1573
Sybase Graph
1574
Streaming Media Graphs
1575
Streaming Media Graphs Overview
1575
Media Player Client Monitoring Measurements
1575
RealPlayer Client Monitoring Measurements
1576
RealPlayer Server Monitoring Measurements
1577
Windows Media Server Default Measurements
1578
Media Player Client Graph
1579
Real Client Graph
1579
Real Server Graph
1580
Windows Media Server Graph
1581
ERP/CRM Server Resource Graphs
1581
ERP/CRM Server Resource Graphs Overview
1582
ERP/CRM Server Resources Graphs Measurements
1582
Tuxedo Graph
1588
SAP Graph
1589
SAPGUI Graph
1590
SAP CCMS Graph
1591
HP LoadRunner (12.00)
Page 52 of 1743
LoadRunner User Guide
Contents
SAP Portal Graph
1592
Siebel Server Manager Graph
1593
Siebel Web Server Graph
1594
Application Component Graphs
1595
Microsoft COM+ Performance Graphs Overview
1595
Microsoft .NET CLR Performance Graphs Overview
1595
COM+ Average Response Time Graph
1596
COM+ Breakdown Graph
1597
COM+ Call Count Distribution Graph
1599
COM+ Call Count Graph
1601
COM+ Call Count Per Second Graph
1602
COM+ Total Operation Time Distribution Graph
1603
COM+ Total Operation Time Graph
1605
Microsoft COM+ Graph
1606
.NET Average Response Time Graph
1609
.NET Breakdown Graph
1610
.NET Call Count Distribution Graph
1612
.NET Call Count Graph
1612
.NET Call Count per Second Graph
1613
.NET Resources Graph
1614
.NET Total Operation Time Distribution Graph
1618
.NET Total Operation Time Graph
1619
Application Deployment Solutions Graphs
1619
Application Deployment Solutions Graph Overview
1620
Citrix Measurements
1620
Citrix MetaFrame XP Graph
1624
Middleware Performance Graphs
1625
Middleware Performance Graphs Overview
1625
IBM WebSphere MQ Counters
1625
Tuxedo Resources Graph Measurements
1627
IBM WebSphere MQ Graph
1629
HP LoadRunner (12.00)
Page 53 of 1743
LoadRunner User Guide
Contents
Tuxedo Resources Graph
1630
Infrastructure Resources Graphs
1631
Infrastructure Resources Graphs Overview
1631
Network Client Measurements
1631
Network Client Graph
1632
Analysis Reports
Understanding Analysis Reports
1632
1632
Analyze Transaction Settings Dialog Box
1633
Analyze Transactions Dialog Box
1634
New Report Dialog Box
1636
Analysis Report Templates
1637
Report Templates Overview
1637
Report Templates Dialog Box
1637
Report Templates - General Tab
1639
Report Templates - Format Tab
1640
Report Templates - Content Tab
1642
Analysis Report Types
1644
Summary Report Overview
1644
Summary Report
1644
HTML Report
1649
SLA Reports
1650
Transaction Analysis Report
1651
Analysis Reports Overview
1652
Importing External Data
1653
Import Data Tool Overview
1653
How to Use the Import Data Tool
1653
How to Define Custom File Formats
1655
Supported File Types
1655
Advanced Settings Dialog Box (Import Data Dialog Box)
1657
Define External Format Dialog Box
1658
Import Data Dialog Box
1659
HP LoadRunner (12.00)
Page 54 of 1743
LoadRunner User Guide
Contents
Siebel Diagnostics Graphs
1661
Siebel Diagnostics Graphs Overview
1661
How to Enable Siebel Diagnostics
1662
Call Stack Statistics Window
1663
Chain of Calls Window
1665
Siebel Area Average Response Time Graph
1666
Siebel Area Call Count Graph
1667
Siebel Area Total Response Time Graph
1668
Siebel Breakdown Levels
1669
Siebel Diagnostics Graphs Summary Report
1673
Siebel Request Average Response Time Graph
1673
Siebel Transaction Average Response Time Graph
1674
Working with Diagnostics
Siebel DB Diagnostics Graphs
1675
1675
Siebel DB Diagnostics Graphs Overview
1675
How to Enable Siebel DB Diagnostics
1676
How to Synchronize Siebel Clock Settings
1677
Measurement Description Dialog Box
1677
Siebel Database Breakdown Levels
1678
Siebel Database Diagnostics Options Dialog Box
1682
Siebel DB Side Transactions Graph
1683
Siebel DB Side Transactions by SQL Stage Graph
1683
Siebel SQL Average Execution Time Graph
1684
Oracle 11i Diagnostics Graphs
1684
Oracle 11i Diagnostics Graphs Overview
1684
How to Enable Oracle 11i Diagnostics
1685
Measurement Description Dialog Box
1686
Oracle Breakdown Levels
1687
Oracle 11iDB Side Transactions Graph
1689
Oracle 11iDB Side Transactions by SQL Stage Graph
1690
Oracle 11i SQL Average Execution Time Graph
1690
HP LoadRunner (12.00)
Page 55 of 1743
LoadRunner User Guide
Contents
SAP Diagnostics Graphs
1691
SAP Diagnostics Graphs Overview
1691
How to Enable SAP Diagnostics
1691
How to Configure SAP Alerts
1692
SAP Diagnostics - Guided Flow Tab
1693
SAP Diagnostics Application Flow
1694
Dialog Steps per Second Graph
1695
OS Monitor Graph
1695
SAP Alerts Configuration Dialog box
1696
SAP Alerts Window
1696
SAP Application Processing Time Breakdown Graph
1698
SAP Primary Graphs
1698
SAP Average Dialog Step Response Time Breakdown Graph
1698
SAP Average Transaction Response Time Graph
1699
SAP Breakdown Task Pane
1700
SAP Server Time Breakdown (Dialog Steps) Graphs
1703
SAP Server Time Breakdown Graph
1703
SAP Database Time Breakdown Graph
1704
SAP Diagnostics Summary Report
1705
SAP Interface Time Breakdown Graph
1706
SAP System Time Breakdown Graph
1706
SAP Secondary Graphs
1707
Work Processes Graph
1707
J2EE & .NET Diagnostics Graphs
1708
J2EE & .NET Diagnostics Graphs Overview
1708
How to Enable Diagnostics for J2EE & .NET
1708
Viewing J2EE to SAP R3 Remote Calls
1709
J2EE & .NET Diagnostics Data
1710
Example Transaction Breakdown
1711
Using the J2EE & .NET Breakdown Options
1715
Viewing Chain of Calls and Call Stack Statistics
1717
HP LoadRunner (12.00)
Page 56 of 1743
LoadRunner User Guide
Contents
The Chain of Calls Windows
1718
Understanding the Chain of Calls Window
1719
Graph Filter Properties
1721
J2EE/.NET - Average Method Response Time in Transactions Graph
1722
J2EE/.NET - Average Number of Exceptions in Transactions Graph
1723
J2EE/.NET - Average Number of Exceptions on Server Graph
1724
J2EE/.NET - Average Number of Timeouts in Transactions Graph
1724
J2EE/.NET - Average Number of Timeouts on Server Graph
1725
J2EE/.NET - Average Server Method Response Time Graph
1726
J2EE/.NET - Method Calls per Second in Transactions Graph
1727
J2EE/.NET - Probes Metrics Graph
1728
J2EE/.NET - Server Methods Calls per Second Graph
1729
J2EE/.NET - Server Requests per Second Graph
1730
J2EE/.NET - Server Request Response Time Graph
1731
J2EE/.NET - Server Request Time Spent in Element Graph
1732
J2EE/.NET - Transactions per Second Graph
1734
J2EE/.NET - Transaction Response Time Server Side Graph
1734
J2EE/.NET - Transaction Time Spent in Element Graph
1735
Troubleshooting and Limitations - Analysis
1736
LoadRunner Guides and References
1739
Additional Components
1741
Third Party Components
HP LoadRunner (12.00)
1743
Page 57 of 1743
LoadRunner User Guide
Welcome to the LoadRunner User Guide
Welcome to the LoadRunner User Guide
Welcome to LoadRunner, the HP solution for application performance testing. LoadRunner
stresses your entire application to isolate and identify potential client, network, and server
bottlenecks.
LoadRunner includes:
l
VuGen. HP's tool for creating Vuser scripts. You use VuGen to develop a Vuser script by
recording a user performing typical business processes. The scripts let you emulate real-life
situations.
l
Controller. Allows you to easily and effectively control all the Vusers from a single point of
control and monitor the scenario performance during test execution.
l
Analysis. You use Analysis after running a load test scenario in the HP LoadRunner Controller
or HP Performance Center. The Analysis graphs help you determine system performance and
provide information about transactions and Vusers. You can compare multiple graphs by
combining results from several load test scenarios or merging several graphs into one.
LoadRunner Online Help
LoadRunner Help is an online help system that describes how to use LoadRunner. You can access
the LoadRunner Help in the following ways:
l
Select HP Virtual User Generator Help, HP Controller Help, or HP Analysis Help from the Help
menu of any of the LoadRunner components to open the LoadRunner Help home page. The
home page provides quick links to the main help topics.
l
Click F1 on any window or dialog box to open the LoadRunner Help to the topic that describes
the currently displayed screen.
l
Use the Help menu in LoadRunner to access the Knowledge Base and other useful resources.
Additional Online Resources
The following online resources provide more information for LoadRunner users:
Resource
URL
HP Software Web site
http/: www.hp.com/go/software
HP Software Support
http://www.hp.com/go/hpsoftwaresupport
Troubleshooting & Knowledge Base
http://h20230.www2.hp.com/troubleshooting.jsp.
LoadRunner Community Forums
http://www.hp.com/go/lrpc
HP LoadRunner (12.00)
Page 58 of 1743
LoadRunner User Guide
Welcome to the LoadRunner User Guide
Resource
URL
LoadRunner Blog
http://h30499.www3.hp.com/t5/HP-LoadRunnerand-Performance/bg-p/sws-585
HP Live Network (HPLN)
https://hpln.hp.com/group/performance-centerand-loadrunner
LoadRunner Integrations
http://support.openview.hp.com/sc/solutions/inde
x.jsp#tab=tab1
LoadRunner on Twitter
LoadRunner on Linked In
HP LoadRunner (12.00)
https://twitter.com/hploadrunner
http://www.linkedin.com/groups?home=&gid=187
9289
Page 59 of 1743
LoadRunner User Guide
What's New in LoadRunner 12.00
What's New in LoadRunner 12.00
Ability to run load generators on the cloud
l
Easily provision cloud load generators from the Controller. For details, see "Adding a CloudBased Load Generator - Overview" on page 1076.
l
Run tests on load generators on the Amazon cloud
Enhanced communication interface between Controller and load
generators
l
Ability to configure the ports between all LoadRunner components—Controller, load generator,
MI Listener, and Monitor over Firewall
l
Ability to connect from Controller to load generator, MI Listener, and Monitor over Firewall via
proxy
l
Use of Network Connection profiles that let you configure connection information, such as port
and proxy, separately for each load generator For details, see "Network Profile Manager Dialog
Box" on page 1104.
l
Improved support and enhanced usability for SSL security
l
Ability to configure load generator to accept communication only from trusted Controllers using
SSL authentication
Network and security manager
l
New utility to configure network and security settings for LoadRunner agent, for both local and
remote machines. For details, see "Network and Security Manager - Command Line Tool" on
page 1108.
Enhancements for testing mobile applications
l
Replay support for SMP (SAP Mobile Platform) recorded sessions. For details, see "How to
create an SMP (SAP Mobile Platform) script" on page 717.
l
Enhanced proxy recording. For details, see "How to Record a Script via a Proxy" on page 261.
Improvements and added features in VuGen
l
Enhanced replay summary with transaction breakdown with new time- trend charts. For details
see "Replay Summary Tab" on page 140.
l
Support for editing common file types in VuGen editor—not limited to Vuser scripts
l
Multiple VuGen usability improvements for better productivity
HP LoadRunner (12.00)
Page 60 of 1743
LoadRunner User Guide
What's New in LoadRunner 12.00
l
Ability to cancel a recording session without overwriting script
l
Improved search capabilities
l
Debugger improvements
Enhancements and added integrations for protocols
l
Web HTTP/HTML:
n
HTML5 WebSocket support. For details, see the web_websocket functions in the
LoadRunner Function Reference.
n
TruClient to Web HTTP/HTML protocol script converter. For details, see "Converting a
TruClient Script to a Web HTTP/HTML Script" on page 567.
n
SSL utility for performing various OpenSSL commands through a user-friendly interface. For
details, see "SSL Utility" on page 1114.
n
SPDY support. For details, see "How to record the SPDY protocol" on page 815.
n
Internet Explorer 11 support
n
TLS 1.1, TLS 1.2, and NPN support
n
Enhanced asynchronous support with ResponseHeader callback
n
Recording troubleshooting: ability to identify recording failure and suggest a possible fix
l
Linux support: Replay support on Linux-based load generators was added for the following
protocols: FTP, IMAP, LDAP, POP3, SMTP, and Windows Sockets
l
TruClient: Support for rendezvous points, IP spoofing, VTS, and Shunra network virtualization
l
Silverlight: Support for latest version and IP Spoofing
l
SAP-Web: Correlation Studio support in VuGen
l
LDAP: Support for latest version of LDAP SDK
l
Flex: Support for the latest Apache SDK
l
.NET: Support for version 4.5
l
Citrix: Support for latest client receiver, ability to run multiple published applications in the same
session, and latest XenDesktop support
l
SAP: The SAP Application Testing by HP, HANA Edition (LoadRunner and Quality
Center/Application Lifecycle Management) has received a Premium Qualification for SAP
Vendor Branded Resellers. This certification is effective from LoadRunner 11.50 and Application
HP LoadRunner (12.00)
Page 61 of 1743
LoadRunner User Guide
What's New in LoadRunner 12.00
Lifecycle Management 11.00.
New supported technologies and platforms
l
Windows Server 2012 support
l
Record and replay support for Internet Explorer 11, Chrome version 30, and Firefox version 23
l
Support for latest versions of Eclipse, JUnit, and Selenium
External IDE integration/add-ins for LoadRunner scripts and applications
l
Ability to invoke the Controller directly from Visual Studio and Eclipse
l
Add-in for Visual Studio 2012 for VuGen scripts and unit test developers
l
Support for latest version of Eclipse
For details, see "Additional Components" on page 1741.
Improvements in Virtual Table Server (VTS)
l
Create multiple running instances of VTS
l
Run VTS commands and batch files from the command line
l
VTS support through a JavaScript API
l
Populate data tables with sample data from the main menu
For details, see the Virtual Table Server documentation.
Integration with latest HP product versions
l
HP Service Virtualization
l
HP Diagnostics
l
HP SiteScope
l
HP Unified Functional Testing (UFT)
l
HP Application Lifecycle Management (ALM)
Improved documentation
l
Workflow diagrams added to user guide for testing and script creation processes
l
Enhancements to Flex, Web HTTP/HTML, and TruClient protocol documentation, with added
tasks and procedures
HP LoadRunner (12.00)
Page 62 of 1743
LoadRunner User Guide
What's New in LoadRunner 12.00
l
Improved organization of function reference including additional code samples and the new
WebSocket functions
General enhancements
l
Simplified product installation with shorter installation time
l
Non-admin user support: LoadRunner components can now run under a standard user account
and with UAC and DEP enabled—an administrator account is no longer required. This applies to
all LoadRunner components and tools accessible from the LoadRunner > Tools node under
the Start menu.
l
Shunra integration enhancements
l
Database API functions are now available for all C language protocols
Community license bundle
l
LoadRunner now delivered with the Community bundle which replaces the Instant-on license
n
The new bundle is permanent, with 50 Vusers
n
Included are all the protocols except for GUI (UFT), COM/DCOM and protocols in the
template bundle
For a complete list of supported integrations and product versions, see the Software Support site at
www.hp.com/go/hpsoftwaresupport. or select Help > HP Software Support Online. Click the
Self-solve tab, and search for the LoadRunner PAM (Product Availability Matrix) for this version.
HP LoadRunner (12.00)
Page 63 of 1743
LoadRunner User Guide
VuGen Concepts
VuGen Concepts
The VuGen Concepts section provides information about various topics relating to the use of
VuGen to create Vuser scripts.
VuGen - Overview
When testing or monitoring an environment, you need to emulate the true behavior of users on your
system. HP testing tools emulate an environment in which users concurrently work on, or access
your system. To perform this emulation, the human was replaced with a virtual user, or a Vuser.
The actions that a Vuser performs are typically recorded in a Vuser script. The primary tool for
creating Vuser scripts is HP's Virtual User Generator, also known as VuGen.
VuGen not only records Vuser scripts, but also runs them. Running scripts from VuGen is useful for
debugging. It enables you to determine how a Vuser script will run when it is executed as part of a
larger test.
When you record a Vuser script, VuGen generates various functions that define the actions that you
perform during the recording session. VuGen inserts these functions into the VuGen editor to create
a basic Vuser script.
VuGen records Vuser scripts on Windows platforms only. However, a recorded Vuser script can be
run on both Windows and Linux platforms.
You can also program Vuser scripts in your native programming application such as MS Visual
Studio. To access the LoadRunner API, install the appropriate IDE add-in provided on the
LoadRunner DVD.
Vuser Technology Overview
Vusers emulate the actions of human users by performing typical business processes in your
application. The actions that a Vuser performs during the recording session are described in a Vuser
script.
HP's tool for creating Vuser scripts is the Virtual User Generator, VuGen. You use VuGen to
develop a Vuser script by recording a user performing typical business processes on a client
application. VuGen records the actions that you perform during the recording session, recording
only the activity between the client and the server. Instead of having to manually program the
application's API function calls to the server, VuGen automatically generates functions that model
and emulate real world situations.
During recording, VuGen monitors the client and traces all the requests sent to and received from
the server.
HP LoadRunner (12.00)
Page 64 of 1743
LoadRunner User Guide
VuGen Concepts
During playback, Vuser scripts communicate directly with the server by executing calls to the
server API. When a Vuser communicates directly with a server, system resources are not required
for the client interface. This lets you run a large number of Vusers simultaneously on a single
workstation, and enables you to use only a few testing machines to emulate large server loads.
In addition, since Vuser scripts do not rely on client software, you can use Vusers to check server
performance even before the user interface of the client software has been fully developed.
Using VuGen, you can run scripts as standalone tests. This is useful for verifying the script's
functionality and it enables you to see how a Vuser will behave during a test run.
To effectively use the Vuser scripts, you add them to a scenario using the LoadRunner Controller.
While running the Vusers, you gather information about the system's response. Afterwards, you
can view this information with the Analysis tool. For example, you can observe how a server
behaved when one hundred Vusers simultaneously withdrew cash from a bank's ATM. For details,
see "LoadRunner Controller Overview" on page 1013.
VuGen records Vuser scripts on Windows platforms only. However, a recorded Vuser script can be
run on both Windows and Linux platforms.
Vuser Types
LoadRunner supports several Vuser types:
Protocol Based Vusers
LoadRunner supports various types of Vusers using the most common protocols. Each type is
designed to handle different aspects of today's system architectures.
You can create a Vuser script using a single protocol or multiple ones.
HP LoadRunner (12.00)
Page 65 of 1743
LoadRunner User Guide
VuGen Concepts
For a complete list of the available Vuser protocols, see "Vuser Protocols" below.
Unit Test Based Vusers
LoadRunner supports unit tests in the form of .dll or .jar/.class files, created in Microsoft Visual
Studio or Eclipse.
To create these tests, install the appropriate IDE for Developer add-in, available in the Additional
Components folder of the LoadRunner DVD.
GUI Vusers
LoadRunner can integrate functional testing scripts in the form of GUI tests into a load testing
scenario. You create GUI tests using HP Functional Testing software - QuickTest or Unified
Functional Testing.
You can run only a single GUI Vuser on a Windows-based load generator. Use Citrix to run multiple
GUI Vusers. For additional information on Windows-based GUI Vusers, see "Using QuickTest or
Unified Functional Testing Tests in LoadRunner" on page 1225.
Vuser Protocols
VuGen enables you to record a variety of protocols, each suited to a particular load testing
environment or topology and results in a specific type of Vuser script. For example, you can use a
Web (HTTP/HTML) Vuser Script to emulate users operating Web browsers. You can use FTP
Vusers to emulate an FTP session. The various Vuser technologies can be used alone or together,
to create effective load tests.
The following table lists the available Vuser protocols, and a brief description of each protocol.
Note: In the LoadRunner documentation, the terms Vuser protocols and Vuser types are used
interchangeably.
Protocol
Description
.NET
Supports the recording of Microsoft .NET client-server technologies.
Ajax
(Click &
Script)
An acronym for Asynchronous JavaScript and XML. Ajax (Click & Script) uses
asynchronous HTTP requests, allowing Web pages to request small bits of
information instead of whole pages.
C Vuser
A generic virtual user which uses the standard C library.
Citrix ICA
A remote access tool, allowing users to run specific applications on external
machines.
COM/DCOM
Component Object Model (COM) - a technology for developing reusable
software components.
HP LoadRunner (12.00)
Page 66 of 1743
LoadRunner User Guide
VuGen Concepts
Protocol
Description
(DNS)
The DNS protocol is a low-level protocol that allows you to emulate the actions
Domain Name of a user working against a DNS server.
Resolution
The DNS protocol emulates a user accessing a Domain Name Server to resolve
a host name with its IP address. Only replay is supported for this protocol—you
need to manually add the functions to your script.
Flex
Flex is an application development solution for creating Rich Internet
Applications (RIAs) within the enterprise and across the Web. Action Message
Format (AMF), is a Macromedia proprietary protocol that allows Flash Remoting
binary data to be exchanged between a Flash application and an application
server over HTTP.
FTP
(File Transfer
Protocol )
File Transfer Protocol - a system which transfers files from one location to
another over a network.
The FTP protocol is a low-level protocol that allows you to emulate the actions
of a user working against an FTP server.
IMAP
(Internet
Messaging)
Internet Message Application - a protocol which enables clients to read email
from a mail server.
Java over
HTTP
Designed to record java-based applications and applets. It produces a Java
language script using web functions. This protocol is distinguished from other
Java protocols in that it can record and replay Java remote calls over HTTP.
Java Record
Replay
Common Java recorder.
Java Vuser
Java programming language with protocol level support.
LDAP
(Listing
Directory
Service)
An Internet protocol designed to allow email applications to look up contact
information from a server.
MAPI
(Microsoft
Exchange)
Messaging Application Programming Interface designed to allow applications to
send and receive email messages.
MMS
Streaming data from a media server using Microsoft's MMS protocol.
(Media Player) Important: In order to replay Media Player functions, you must place a file
called wmload.asf on the Windows Media server machine. The VuGen machine
must be able to access it using mms://<servername>/wmload.asf. This ASF
file can be any media file renamed to wmload.asf.
MMS
(Multimedia
Messaging
Service)
A messaging service used for sending MMS messages between mobile
devices.
HP LoadRunner (12.00)
Page 67 of 1743
LoadRunner User Guide
VuGen Concepts
Protocol
Description
Mobile
Application HTTP/HTML
Enables the recording of mobile native applications.
ODBC
Open Database Connectivity - a protocol providing a common interface for
accessing databases.
Oracle - 2 Tier
Oracle database using a standard 2-tier client/server architecture.
Oracle Web
Applications
11i
The Oracle Applications interface that performs actions over the Web. This
Vuser type detects actions on both the LoadRunner API and Javascript levels.
Oracle NCA
Oracle 3-tier architecture database consisting of Java client, Web server and
database.
POP3
(Post Office
Protocol)
A protocol designed to allow single computers to retrieve email from a mail
server.
RDP
(Remote
Desktop
Protocol)
A remote access tool using the Microsoft Remote Desktop Connection to run
applications on an external machine.
RTE
(Remote
Terminal
Emulator)
Emulation of users who submit input to, and receive output from, characterbased applications.
SAP (Click &
Script)
Emulation of communication between a browser and SAP server on a GUI or
user-action level.
SAP GUI
An Enterprise Resource Planning system to integrate key business and
management processes using the SAP GUI client for Windows.
SAP - Web
An Enterprise Resource Planning system to integrate key business and
management processes using the SAP Portal or Workplace clients.
Siebel - Web
A Customer Relationship Management Application.
Silverlight
A protocol for Silverlight based applications emulating user activity at the
transport level. Allows generating high level scripts by automatically importing
and configuring WSDL files used by the application.
SMP (SAP
Mobile
Platform)
A protocol for recording actions on a mobile SAP application.
HP LoadRunner (12.00)
Page 68 of 1743
LoadRunner User Guide
VuGen Concepts
Protocol
Description
SMTP
(Simple Mail
Protocol)
Simple Mail Transfer Protocol - a system for distributing mail to a particular
machine.
TruClient Ajax
An advanced protocol for modern JavaScript based applications (including Ajax)
emulating user activity within a web browser. Scripts are developed
interactively in Mozilla Firefox or Internet Explorer.
TruClient Ajax - Mobile
Enables the recording of mobile browser based applications using the TruClient
Ajax technology.
Web
Emulation of communication between a browser and Web server on an HTTP or
(HTTP/HTML) HTML level.
Web Services
Web Services are a programmatic interface for applications to communicate
with one another over the World Wide Web.
Windows
Sockets
The standard network programming interface for the Windows platform.
Note: In order to use the Controller to run Vusers of the various protocols, you must have either
a global license or licenses for the desired protocols. The Community Bundle Includes 50
Vusers for all protocols, except GUI (UFT), COM/DCOM and protocols in the template bundle,
such as C Vuser. To check your Vuser licensing details, open the LoadRunner License Utility
by selecting Start > All Programs > HP Software > HP LoadRunner > License >
LoadRunner License Utility.
Keyboard Shortcuts
The following tables list the keyboard shortcuts available for the VuGen menus:
File Menu
New > Script and Solution
Ctrl+N
Open > Script/Solution
Ctrl+O
Add > New Script
Ctrl+Shift+A
Add > Existing Script
Alt+Shift+A
Close > Document
Ctrl+F4
Close > Solution
Ctrl+Shift+F4
Save Script
Ctrl+S
Save All Scripts
Ctrl+Shift+S
HP LoadRunner (12.00)
Page 69 of 1743
LoadRunner User Guide
VuGen Concepts
Reload File
Ctrl+Shift+U
Print
Ctrl+P
Exit
Alt+F4
Edit Menu
Undo
Ctrl+Z
Redo
Ctrl+Y
Cut
Ctrl+X
Copy
Ctrl+C
Paste
Ctrl+V
Delete
Del
Select All
Ctrl+A
Format > Surround with
Ctrl+J
Format > Increase Indent
Tab
Format > Decrease Indent
Shift+Tab
Folding > Toggle fold
Ctrl+Shift+M
Folding > Toggle all folds
Ctrl+Shift+L
Folding > Show definitions only
Ctrl+Shift+P
Show Function Syntax
Ctrl+Shift+Space
Complete Word
Ctrl+Space
View Menu
Solution Explorer
Ctrl+Alt+L
Search Results
Ctrl+Alt+R
Bookmarks
Ctrl+Alt+K
Steps Toolbox
Ctrl+Alt+B
Snapshot
Ctrl+Alt+P
Steps Navigator
Ctrl+Alt+S
Thumbnail Explorer
Ctrl+Alt+T
HP LoadRunner (12.00)
Page 70 of 1743
LoadRunner User Guide
VuGen Concepts
Properties
Ctrl+Alt+F4
Output
Ctrl+Alt+O
Full Screen
Alt+Shift+Return
Search Menu
Quick Find
Ctrl+F
Find Next
F3
Find Next Selected
Ctrl+F3
Find in Files
Ctrl+Shift+F
Quick Replace
Ctrl+H
Incremental Search
Ctrl+E
Reverse Incremental Search
Ctrl+Shift+E
Bookmarks > Toggle Bookmark
Ctrl+F2
Bookmarks > Prev Bookmark
Shift+F2
Bookmarks > Next Bookmark
F2
Go To
Ctrl+G
Design Menu
Action > Delete Action
Delete
Action > Rename Action
F2
Insert in Script > New Step
Alt+Insert
Insert in Script > Start Transaction
Ctrl+T
Insert in Script > End Transaction
Ctrl+Shift+T
Insert in Script > Comment
Ctrl+Alt+C
Parameters > Parameters List
Ctrl+L
Parameters > Create New Parameter
Ctrl+K
Parameters > Configure Parameter Delimiters
Ctrl+B
Design Studio
Ctrl+U
HP LoadRunner (12.00)
Page 71 of 1743
LoadRunner User Guide
VuGen Concepts
Record Menu
Record
Ctrl+R
Regenerate Script
Ctrl+Shift+R
Recording Options
Ctrl+F7
Replay Menu
Run
F5
Stop
Ctrl+F5
Compile
Shift+F5
Toggle Breakpoint
F9
Continue Debugging
F5
Run Step by Step
F10
Run-Time Settings
F4
ALM
ALM Connection
Ctrl+Q
Windows Menu
Next Window
Ctrl+Tab
Prev Window
Ctrl+Shift+Tab
IPv6 Support
As IPv6 implementation becomes more widespread, LoadRunner now enables you to test IPv6
based applications in addition to IPv4 based ones. Script recording supports recording for both IPv4
and IPv6 simultaneously. The code that is generated is non-IP specific. Except for Web HTTP
based protocols, users will be unaware of which IP version is being used when replaying the script
in a load test. Web HTTP protocols have a Runtime setting that allows you to choose between IPv4
and IPv6 for the replay.
IPv6 Deployment
The internal LoadRunner communication between the Controller and Load Generators still uses
IPv4 communication. To record and replay in both IPv4 and IPv6, install both VuGen and Load
Generator on IPv6-enabled computers, as shown in the diagram below.
HP LoadRunner (12.00)
Page 72 of 1743
LoadRunner User Guide
VuGen Concepts
For more details about IPv6 related changes, see Advanced Options Dialog Box and the IP Wizard
section in the Controller User Guide.
Protocols Supported
The following protocols support IPv6 testing:
l
Citrix ICA
l
DNS
l
Flex
l
FTP
l
IMAP
l
Java over HTTP
l
Mobile Application - HTTP/HTML
l
Window Sockets - Multi protocol
HP LoadRunner (12.00)
Page 73 of 1743
LoadRunner User Guide
VuGen Concepts
l
Oracle NCA
l
POP3
l
RDP
l
Silverlight
l
SMTP
l
TruClient Ajax
l
Click & Script family
l
Web (HTTP/HTML)
l
Web Services
Protocol Support Limitations
Support for IPv6 is available for the protocols shown in the list above with the following limitations:
Web HTTP protocol
l
n
FTP from Web is not supported
n
Web Breakdown is not supported
n
Kerberos is not supported
n
Spoofing from Web is not supported
n
PAC file is not supported
n
An explicit IP (in IPv6 format) in a URL argument cannot be used. For example, the following
step will fail in replay:
web_url("IPv6",
"URL=http://[2001:0dc8:8aa3:0000:0b00:8a2e:0370:7334]/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
HP LoadRunner (12.00)
Page 74 of 1743
LoadRunner User Guide
VuGen Concepts
"Mode=HTML",
LAST);
l
l
Webtrace
n
IPv6 Webtrace is not supported on 6to4 outgoing network interfaces.
n
IPv6 webtrace does not support RawSocket mode
General limitations
n Replay failures may occur because of a IPv4/IPv6 switch between recording and replaying.
VuGen User Interface
The VuGen User Interface section describes each component of the environment you will be
working in while you record, replay, and debug a Vuser script.
VuGen User Interface - Overview
The VuGen User Interface is comprised of several zones, each of which can display a variety of
panes. You can modify the layout of these zones and panes to enhance recording and debugging of
your Vuser scripts. For details, see "VuGen Layouts - Overview" on page 79.
The following table describes each pane and provides a short use case scenario.
Pane
Bookmarks
Purpose
Use Case Scenario
Bookmarks allow you to specify a
location in a script so that you can
easily find it later on for editing.
For details, see "Bookmarks Pane" on
page 131.
Errors
Displays script errors, warnings and
messages generated from script
replay. Additionally, you can create
custom filters for error messages.
For details, see "Errors Pane" on page
133.
Error Filter from the output log
After every test process, such as code
generation and replay, you can check
the error pane for the error log. You can
also view other types such as warning
and message.
Community search is available with
context menu on highlighted error.
In addition, you can double click the
message to jump to the location in the
script.
HP LoadRunner (12.00)
Page 75 of 1743
LoadRunner User Guide
VuGen Concepts
Pane
Snapshot
Purpose
Use Case Scenario
A snapshot displays server and client
data associated with a specific step in
a script. The format of the data is
dependent on the protocol used for
creating the script.
Use the snapshot pane to understand all
data that the steps contain.
For Snapshot details, see "Snapshot
Pane" on page 126.
You can perform certain tasks such as
search for correlations, compare record
versus replay snapshots and search for
the specific values using the standard
search operation.
Data Grid
Simplified view of all the recordsets
associated with the script. Valid for
specific protocols such as MSSQL.
The data pane contains either sent or
received data. The data is displayed in
an easy formatted table and you perform
operations such as parameterization,
and other data manipulations.
Solution
Explorer
The Solution Explorer enables you to
organize and manage multiple scripts
in a named solution.
You can now bundle scripts in a
solution. For example you can bundle
scripts related to one business process.
This pane provides easy access and
manipulation of solutions such as
script assets, parameters, runtime
settings, and replay runs.
For the present, the solution entity is
limited in the following ways:
You can double-click an asset to
activate it in the editor area or rightclick to examine quick operations
available for that asset.
For details, see "Solution Explorer
Pane" on page 118.
HP LoadRunner (12.00)
l
The solution entity is limited to local
script development such as save all
or open.
l
The solution entity can not be
imported into any of the existing
management tools such as ALM or
Controller.
Page 76 of 1743
LoadRunner User Guide
VuGen Concepts
Pane
Step
Navigator
Purpose
Use Case Scenario
Enables you to navigate to a selected
step in your script. If your script
contains many steps, you can use the
search box to search for matching text
in the different parts of the steps.
Table view of all LoadRunner API steps
that exist. The step navigator replaces
the tree view in previous versions of
VuGen.
l
Dynamic filter on various step
properties such as step arguments.
l
You can view the script in either
action or script scope.
l
Every step that has a snapshot is
marked with an icon. When hovering
over a step that has an associated
thumbnail it is presented as a tooltip.
l
Double clicking a step, takes you to
the corresponding location in the
script and synchronizes all other
panes.
l
Various operations can be done from
the context menu such as copy stop.
l
Step Navigation is synchronized
based on the validity of the script.
You can check the status of the pane
during script editing.
For details, see " Step Navigator
Pane" on page 132.
Tasks
You can add, edit or search for tasks
related to a script or solution.
For details, see "Task Pane" on page
134.
Centralized Task Management
During script development, comments
tasks enable you to embed tasks in the
script. For example in a C based
language script, //TODO Add
Parameter
User tasks enable you to add tasks,
assign ownership and track completion
of tasks related to the overall script
process. For example, Add Load Test
Scenario using newly created script.
HP LoadRunner (12.00)
Page 77 of 1743
LoadRunner User Guide
VuGen Concepts
Pane
Editor
Purpose
The editor area contains all open
assets such as script actions, extra
files,report summary enables you to
edit script actions.
In addition you can open community
search, help documentation, and
browser pages.
For details, see "Editor" on page 112.
Use Case Scenario
You can view script actions
simultaneously from different scripts
within a solution.
l
You can insert comment blocks.
l
You can customize the color
scheme.
l
You can enlarge the fonts.
l
Auto-completion options using CTRL +
SPACE.
Thumbnail
Enables you to visually follow the
business process that the script has
recorded.
l
All supportive data in the panes is
synchronized as you navigate
through the script.
l
The script support full debug
capability can be managed within the
script such as toggle breakpoints.
l
Community search is available on
highlighted text in the script.
l
The thumbnail generation is
configurable in Tools > Options.
l
You can enlarge the thumbnail to full
size by double clicking.
l
Additional operations are available
from the context menu such as Go to
Step.
For details, see "Thumbnail Explorer"
on page 113.
Output
Event log from different operations in
VuGen such as code generation,
replay, and recording.
For details, "Output Pane" on page
124
The output pane displays all logs
created during script development
phases such as code generation, replay,
and recording.
l
You can perform quick searches from
the pane or access full search with
CTRL+F
l
HP LoadRunner (12.00)
You can save the logs.
Page 78 of 1743
LoadRunner User Guide
VuGen Concepts
Pane
Purpose
Use Case Scenario
Breakpoints VuGen lets you include breakpoints in
you Vuser scripts to help you to debug
the scripts.
Enables you to set and manage
breakpoints to help analyze the effects
of the script on your application at predetermined points during script
For details, see "Breakpoints Pane" on
execution.
page 135.
Watch
The Watch pane enables you to
monitor variables and expressions
while a script runs, and is in the
Paused state.
For details, see "Watch Pane" on page
138.
Call Stack
This debug pane enables you to view
information about the methods and
functions that are currently on the call
stack of your script, or the context in
which the run session was paused.
For details, see "Call Stack Pane" on
page 139.
VuGen Layouts - Overview
The VuGen window is composed of a number of zones. Each zone can contain a variety of panes,
such as the Errors pane or the Snapshots pane. The panes appear as tabs within the zones. The
figure below shows a zone that contains four tabbed panes: Output, Tasks, Errors, and Run Time
Data. The Output pane is currently visible.
The specific configuration of the zones and the panes contained within the zones is called a layout.
VuGen is supplied with a set of standard layouts: Default, Debug, Plain, Record, Replay, and
Snapshot. Each layout is designed to enhance a specific phase of the Vuser script development
process. For example, the Replay layout includes the panes that are most useful when you run a
HP LoadRunner (12.00)
Page 79 of 1743
LoadRunner User Guide
VuGen Concepts
Vuser script: Errors, Call Stack, Watch, Breakpoints, Output, and Run Time Data. VuGen
automatically uses specific layouts during specific phases of the script development process. For
example, the Record layout is used while you record a script, and the Replay layout is used when
you replay a script.
The VuGen toolbar displays the layout that is currently used:
. To change the
layout, click the Layout drop-down and select the required layout from the list of layouts, as shown
below.
Modifying a layout
You cannot add or delete a standard layout. However, you can modify most of VuGen's standard
layouts to meet your specific requirements. When you modify a layout, you can add, move and
resize zones, select which panes to include in each zone, and specify which of these panes is
displayed by default. For task related details, see "How to Modify the VuGen Layout" on page 93.
After you modify a standard layout, VuGen maintains that layout until you change the layout again
or reset the default layouts.
Note: VuGen does not save any changes that you make to the Plain layout.
Restoring the layout defaults
On the VuGen toolbar, click the Layout drop-down, and select Reset to Defaults. VuGen resets all
standard layouts to their default settings.
Solution Explorer - Overview
The Solution Explorer enables you to easily organize and navigate through script entities,
enhancing the recording, replay and debug process. You can create a solution containing multiple
scripts of different protocols related to a full-cycle business process. Each script entity includes
extra files (such as header files), run-time settings, parameters, and replay runs.
The following graphic illustrates the Solution Explorer structure:
HP LoadRunner (12.00)
Page 80 of 1743
LoadRunner User Guide
VuGen Concepts
Solution
When you create a new script, you can name the solution that contains the script. For example, you
can use the business process as the solution name. If you do not specify a name, the default name
is "Untitled".
Scripts
Your solution can contain multiple scripts. Single-click a script, or one of its assets, to change
focus to that script. When a script in a solution is in focus, it changes the behavior of VuGen. For
example, when you click replay, the script in focus runs. In addition, menus options, toolbars
buttons, and panes display functionality relevant to the script's protocol. For example, the script in
focus is recorded in Web HTTP/HTML , the Recording Options button is displayed on the toolbar.
However, if the script in focus is recorded in TruClient, the Develop Script button is displayed on
the toolbar.
Double-click the script's action to open it in the Editor.
In addition, you can drag and drop scripts (<scriptName>.usr) from the file directory to the
Solution Explorer.
Extra files
Additional files that are called by the script, are contained in the Extra Files node under Solution
Explorer > <ScriptName>. You can drag and drop header files (<headerFileName.h>from your
file directory. When you include files in the Extra Files node, these files will automatically be
included in a Load Generation Scenario.
The information contained in extra files can include:
HP LoadRunner (12.00)
Page 81 of 1743
LoadRunner User Guide
VuGen Concepts
l
Common utility functions used by the script (for example, code)
l
Definition of constants and variables used by the script (for example, code)
l
Special assets used during script execution (such as .jpeg files)
l
Data files manipulated by script code during script execution
The following are examples of file types that can be added as extra files:
.ws,.h,.c.,dat,.ini,.vbs,.java,.js,.txt,.tux,.rec,.msc,.vdf,.xml,.xsl,.dtd,.html,.htm
You can edit extra files in the editor if the file type is included in Tools > Options > Script
Management > List of file types that can be edited in the Editor. Double click the extra file to
open it in the Editor. For details on how to modify the list, see "Scripting Options" on page 103.
Run-time Settings
You can access run-time settings for a specific script from the Run-time Settings node in the
Solution Explorer > <Script> > Run-Time Settings. For details, see "Run-Time Settings" on
page 317.
Parameters
You can access parameters for a specific script from the Parameters node in the Solution
Explorer > <Script> > Parameters. For details, see "Parameterizing - Overview" on page 408.
Replay Runs
This node enables you to access the Replay Summary Reports for each iteration in the replay.
For details, see "Solution Explorer Pane" on page 118.
Editor - Overview
VuGen's Editor enables you to edit recorded scripts and other supplementary files such as header
files. You can open multiple files simultaneously, easily navigating tab by tab.
The Editor facilitates editing by providing the following features:
Tab View
The tab view in the Editor allows you to organize and edit several script assets simultaneously. You
can do the following in the Editor:
l
Double-clicking on a script or extra files in the Solution Explorer will open the file in Editor area
as a tab. The tab name is <script name>:<filename>
l
Drag tabs to reorder them.
Support of Multiple Programming Languages
Recorded scripts are generated in C, which has full language and parsing support in VuGen. You
can enhance your Vuser scripts by adding standard ANSI C functions. ANSI C functions allow you
HP LoadRunner (12.00)
Page 82 of 1743
LoadRunner User Guide
VuGen Concepts
to add comments, control flow statements, conditional statements to your Vuser scripts. You can
add standard ANSI C functions to any type of Vuser script. For details, see "C Vuser Scripts" on
page 967.
In addition, the VuGen Editor enables you to write manual scripts with the following programing
languages:
l
Java
For details, see "Java Vusers" on page 968.
l
C#
For details, see ".NET Vusers" on page 969.
l
VB.NET
For details, see "How to Create a Vuser Script in Visual Studio" on page 970.
Code Completion and Tooltips for C Scripts
Code completion enables you to quickly and accurately write code by providing a list of code items
from which you can select . Press CTRL + SPACE to activate statement completion when your
cursor is in the Editor. Tooltips, containing context information, appear when your mouse hovers
over a code element. The following table describes available code completion items, scope,
identifying icon, and tooltip context:
Code
Completion
Item
Scope
Icon The Tooltip Displays
ANSI C
Keywords
and Types
All possible standard C
keywords.
Function type, name, and parameters
LR API
Functions
All steps in the script.
LR API Step
LR API
Constants
Used to delimit groups of
parameters in steps. For
example, ENDITEM
LR API Constant
User
Functions
All the functions that you have
defined in action files.
• Function type, name and parameters.
• When Using Functions (Method Insight)
The required arguments, highlighting
each argument as you define it moving to
the next argument when you enter the
delimiter.
HP LoadRunner (12.00)
Page 83 of 1743
LoadRunner User Guide
VuGen Concepts
Code
Completion
Item
Scope
Variables
Icon The Tooltip Displays
Local variables – visible only in
the function where they have
been defined.
Type and name.
Global variables – defined
outside of any function body.
Available everywhere in the
script.
Parameters
Available only in the function
body where they have been
defined.
• Parameter type and name
• When Using parameters (Method
Insight)
The required arguments, highlighting
each argument as you define it moving to
the next argument when you enter the
delimiter.
By default, VuGen uses code completion globally. To disable code completion, select Tools > Text
Editor > Code Completion. Clear the Enable code completion features check box.
Script Code-Coloring for C Scripts
To facilitate script writing and debugging, code item types are colored by an identifying background
and foreground. The colored text enables you to easily read scripts and scan for syntax errors.
Below is a table that provides examples of code item types and their assigned colors.
Code Type
Color Example
Comments
/* comment */ // comment
Keywords
if (a) { } else { }
Method Parameter Name
foo( "parameter=value" )
LoadRunner API
web_url
Method Call
foo( )
String
char * text = "Hello, World!"
In addition, you can customize code item types to suit your needs by selecting Tools > Options >
Text Editor > Highlighting.
Script Folding for C Scripts
Script folding enables you to selectively hide and display sections of a script, making it easier to
manage large scripts by viewing only those sections that you are currently editing. For details, see "
Editor Options" on page 98.
HP LoadRunner (12.00)
Page 84 of 1743
LoadRunner User Guide
VuGen Concepts
Community Search
You can perform Web searches from the VuGen toolbar, which opens a browser tab in the Editor.
The default Web site is the LoadRunner Forum which enables you to search topics, post questions,
or blog about your expertise. You can add additional search sites by selecting Tools > Options >
General > Community. For details on adding additional sites, see "General Options" on page 95.
Snapshot Pane - Overview
What is a snapshot?
Snapshots contain the data generated by the traffic between the client and the server and are
captured when a script is recorded and when the script is replayed.
Snapshots are displayed in various formats and provide different functionality depending on the
Vuser protocol:
Type
Description
Snapshot
functionality
Windows Sockets
Textual and hexadecimal representations of data
buffers sent and received.
Create
correlation
Web HTTP/HTML
Textual and hexadecimal representations of the
request and response.
l
Create
correlation
l
Create
correlation
rule
l
Create
Parameter
l
Add text
check step
l
Insert
correlation
l
Create
correlation
rule
l
Create
Parameter
l
Insert XML
check
XML
HP LoadRunner (12.00)
XML, textual and hexadecimal representation of
the request and response bodies.
Page 85 of 1743
LoadRunner User Guide
VuGen Concepts
Type
Description
Snapshot
functionality
Database
Data grid
l
Create
correlation
l
Save grid
to file
Image based protocols
such as Click & Script
Graphic images of the step.
Note: The Snapshot pane is not available for all Vuser protocols - only specific Vuser protocols
give you access to the Snapshot pane.
The Snapshot Pane
VuGen displays record and replay snapshots in the Snapshot pane. By default, the Snapshot pane
shows just a single snapshot. To enable you to compare snapshots, you can split the Snapshot
pane to show two snapshots simultaneously. You can split the Snapshot pane either vertically or
horizontally. Each section of the split Snapshot pane can show either a record snapshot or a replay
snapshot. Typically, you would show a record snapshot together with its corresponding replay
snapshot. This enables you to compare the record snapshot with the replay snapshot.
l
For details on working with the Snapshot pane, see "How to Work with Snapshots" on page 88.
l
For details on the Snapshot pane user interface, see "Snapshot Pane" on page 126.
Basic Snapshot pane functionality
The Snapshot pane that is displayed for all Vuser protocols includes the same basic functionality.
This basic functionality includes the ability to:
l
Show one snapshot, or split the Snapshot pane to show two snapshots. You can split the
Snapshot pane either horizontally or vertically.
l
Show record and replay snapshots.
For details on how to use the basic Snapshot pane functionality, see "How to Work with
Snapshots" on page 88.
Synchronizing snapshots
The Snapshot pane that is displayed for some Vuser protocols improves your ability to compare
snapshots by “synchronizing” the two snapshots that are displayed in the Snapshot pane. For
example, when synchronizing graphic snapshots, if you place the mouse cursor over a specific
location in one of the snapshots, VuGen displays a marker at the corresponding location in the other
snapshot. In addition, as you move one snapshot vertically or horizontally within the Snapshot
pane, VuGen moves the other snapshot accordingly, ensuring that the same section of each
snapshot is displayed.
HP LoadRunner (12.00)
Page 86 of 1743
LoadRunner User Guide
VuGen Concepts
Note: Snapshot synchronization is available for only specific Vuser protocols, and for only
specific views within these protocols.
Copying snapshots to the clipboard
You can copy an image-based snapshot to the clipboard. This enables you to import the image into
a graphics application, where you can analyze and modify the graphic.
For details on how to copy a snapshot to the clipboard, see "How to Work with Snapshots" on the
next page.
Note: The "copy snapshot to the clipboard" functionality is available for only RDP, Citrix, and
SAP GUI protocols.
Copying snapshot text to the clipboard
You can copy text from a snapshot to the clipboard. You can then paste the text from the clipboard
into another application.
For details on how to copy snapshot text to the clipboard, see "How to Work with Snapshots" on
the next page.
Note: The "copy snapshot text to the clipboard" functionality is available for only Ajax - Click &
Script and SAP - Click & Script protocols.
Customized Snapshot pane functionality
In addition to the basic Snapshot pane functionality, the Snapshot panes for some Vuser protocols
include customized functionality. For example, the Snapshot pane for RDP Vuser scripts lets you
display snapshots in either Full or Image modes; the Snapshot pane for Winsock Vuser scripts
lets you display snapshots in either Text or Hex modes. The controls for the customized
functionality can be found in the Snapshot pane toolbars.
Snapshot on error
In addition to showing record and replay snapshots, the Snapshot pane can display snapshots of
errors that occurred during the replay of a script. The "snapshot on error" functionality is available
for only specific Vuser protocols.
You can generate and display snapshots of errors only if the "snapshot on error" functionality is
activated. For details on how to activate the snapshot-on-error functionality, see "How to Work with
Snapshots" on the next page.
Comparing snapshots
The Compare button in the Snapshot pane enables you to compare two snapshots. To enable the
Compare functionality, you must first split the Snapshot pane to show two snapshots. By default,
VuGen uses the WDiff utility to compare snapshots. You can specify an alternative comparison
tool as described in "Scripting Options" on page 103.
HP LoadRunner (12.00)
Page 87 of 1743
LoadRunner User Guide
VuGen Concepts
Note: The snapshot comparison functionality is available for only the Web (HTTP/HTML) and
Web Services protocols.
Setting snapshot options
VuGen allows you to set various options that define how snapshots are displayed in the Snapshot
pane. For details on these snapshot options, see "Scripting Options" on page 103.
How to Work with Snapshots
This topic describes how to use the basic Snapshot pane functionality. For an overview of the
snapshot functionality, see "Snapshot Pane - Overview" on page 85.
How to show the Snapshot pane
To show the Snapshot pane, do one of the following options:
l
Select View > Snapshot.
l
Click the Snapshot button
l
In the Editor, click inside a step that contains a reference to a snapshot.
l
In the Step Navigator, double-click a step that contains a reference to a snapshot. Note that in
the Step Navigator, each step that contains a snapshot displays a Snapshot icon . You can
place your mouse cursor over the snapshot icon to see a thumbnail view of the snapshot.
on the VuGen toolbar.
How to show a record snapshot in the Snapshot pane
Click the Recording Snapshot button
HP LoadRunner (12.00)
Page 88 of 1743
LoadRunner User Guide
VuGen Concepts
on the Snapshot pane toolbar.
How to show a replay snapshot in the Snapshot pane
Click the Replay Snapshot button
on the Snapshot pane toolbar. If more than one
replay snapshot exists for the step, click Iteration and select the required iteration number.
How to split the Snapshot pane to show two snapshots
If the Snapshot pane displays only one snapshot, click the Split Snapshot Pane button
on the Snapshot pane toolbar.
How to show only one snapshot in the Snapshot pane
If the Snapshot pane displays two snapshots, click the Single button
pane toolbar.
on the Snapshot
How to toggle between a horizontal split and a vertical split of the
Snapshot pane
If the Snapshot pane displays two snapshots:
l
Click the Horizontal Split button
snapshots side-by-side.
l
Click the Vertical Split button
snapshots, one above the other.
on the Snapshot pane toolbar to show two
on the Snapshot pane toolbar to show two
How to synchronize the display of two snapshots when the Snapshot
pane is split
1. Make sure that the Snapshot pane is split to show two snapshots.
2. On the Snapshot pane toolbar, click the Synchronization button
.
Note: Snapshot synchronization is available for only specific Vuser protocols, and for only
specific views within these protocols.
How to copy a snapshot to the clipboard
1. Display the snapshot in the Snapshot pane.
2. Right-click on the snapshot, and then select Copy Image to the Clipboard.
Note: The "copy snapshot to the clipboard" functionality is available for only RDP, Citrix, and
SAP Vuser scripts.
HP LoadRunner (12.00)
Page 89 of 1743
LoadRunner User Guide
VuGen Concepts
How to copy snapshot text to the clipboard
1. Display the snapshot in the Snapshot pane.
2. Select the text that you want to copy.
3. Right-click in the selected text, and select Copy Selection.
How to activate the snapshot-on-error functionality
1. Click Replay > Run-Time Settings. The Run-Time Settings dialog box opens.
2. Under General, click Miscellaneous.
3. Under Error Handling, select the Generate snapshot on error check box.
How to set the snapshot options
1. Click Tools > Options. The Options dialog box opens.
2. Click Scripting, and then click Snapshot. The snapshot options appear on the right of the
dialog box.
How to Add a Text Check From the XML View in the
Snapshot Pane
After recording a Vuser script, you can add a text check from the XML view in the Snapshot pane.
For details on the XML view in the Snapshot pane, see Snapshots That Have an XML View.
To add a text check from the XML view in the Snapshot pane:
1. Click View > Snapshot, or click the Show Snapshot Pane button
on the VuGen toolbar.
2. In the Snapshot pane, display a snapshot that contains the text that you want to verify.
3. On the right-side of the Snapshot pane, click the XML View tab.
4. In the Snapshot pane, click the Response Body tab.
5. In either the Tree view or the Grid view, locate and select the text string that you want to verify.
6. Right-click inside the selection, and select Add Text Check Step. The Find Text dialog box
opens.
7. Modify the options in the Find Text dialog box. For details on the dialog box options, press F1
when in the dialog box to open the Function Reference.
8. Click OK to insert a web_reg_find step into the Vuser script.
HP LoadRunner (12.00)
Page 90 of 1743
LoadRunner User Guide
VuGen Concepts
How to Create a Vuser Script - Workflow
The following diagram outlines the process of developing a Vuser script:
The process of creating a Vuser script is as follows:
1. Record a basic script using VuGen.
2. Enhance the basic script by adding control-flow statements and other LoadRunner API
functions into the script.
3. Configure the run-time settings. These settings include iteration, log, and timing information,
and define the Vuser behavior during a script run.
4. Verify the script's functionality, by running it in standalone mode.
5. After you verify that the script is functional, you integrate it into your environment: a
LoadRunner scenario, Performance Center load test, or Business Process Monitor profile.
How to Compare Scripts Side by Side
Vuser scripts can be compared and displayed side by side using the comparison tool.
To compare Vuser scripts
HP LoadRunner (12.00)
Page 91 of 1743
LoadRunner User Guide
VuGen Concepts
1. Right click on the primary script in Solution Explorer and select Set as first comparing
object.
2. Right click on the secondary script in the Solution Explorer and select Compare which will
run the compare functionality.
or
3. Right click and select Compare with external object.
You can compare an asset to a file outside of the solution. This option sets the highlighted
asset as the primary asset and opens Windows Explorer to enable you to select the secondary
asset.
Note: You can change the comparison tool from Options > Scripting> Comparison. For
more information, see "Scripting Options" on page 103.
How to Create a Business Process Report
At the final stage of script creation, you can create a report that describes your business process.
VuGen exports the script information to one of the following formats:
l
Microsoft Word
l
Acrobat PDF
l
HTML
You can use a pre-designed template or one provided with VuGen, to create reports with summary
information about your test run. The VuGen template is available in Microsoft Word 2007 (docx)
format. You can edit or update the template according to your requirements.
VuGen lets you customize the contents of the report by indicating what type of information you
want to include.
Note: Business Process Reports are available for the following protocols: Ajax (Click &
Script), TruClient, Citrix ICA, Oracle NCA, Oracle Web Applications 11i, RDP, SAP (Click &
Script), SAP GUI, SAP - Web, Web (HTTP/HTML), and Web Services.
1.
Create a business process report
Select Tools > Create Business Process Report and complete the dialog box. For user
interface details, see "Business Process Report Dialog Box" on page 115.
2.
Configure additional options
To modify additional report options such as the table of contents, snapshots, and the document
template, click the More button. For user interface details, see "Business Process Report
HP LoadRunner (12.00)
Page 92 of 1743
LoadRunner User Guide
VuGen Concepts
Dialog Box" on page 115.
How to Modify the VuGen Layout
The VuGen window is composed of a number of zones. Each zone can contain a variety of panes,
such as the Errors pane and the Snapshot pane. When more than one pane is included in a zone,
the panes appear as tabs within the zone. This section describes how to customize and modify the
zones and panes that appear in the VuGen window.
Moving a pane to a new zone
You can move any VuGen pane to a new zone. The new zone can be either a portion of an existing
zone, or it can occupy the entire left, right, top, or bottom of the VuGen window.
In the VuGen window, drag the title bar or tab of the pane that you want to move. (If the required
pane is not displayed in the VuGen window, you can select it from the View menu.) As you drag the
pane over the zones in the VuGen window, a complex marker is displayed in the center of the active
zone and a simple marker appears on each edge of the VuGen window.
Note: If you drag the title bar of a zone that contains multiple tabbed panes, then all the panes
in the zone are moved to the new zone.
Marker Type
Marker
Description
Complex
marker - Current
zone
Positions the selected pane in
a new zone. The new zone is
created in the top, bottom, left,
or right of the active zone,
according to the arrow marker
selected when you release the
mouse button.
Simple marker VuGen window
Positions the selected pane in
a new zone. The new zone is
created in the top, bottom, left,
or right of the VuGen window,
according to the arrow marker
selected when you release the
mouse button.
Moving a pane to an existing zone
You can move any VuGen pane from one zone to another. When more than one pane is included in
a zone, the panes appear as tabs within the zone.
1. In the VuGen window, drag the title bar or tab of the pane you want to move. (If the required
pane is not displayed in the VuGen window, you can select it from the View menu). As you
drag the pane over the zones in the VuGen window, a complex marker is displayed in the
center of the active zone.
HP LoadRunner (12.00)
Page 93 of 1743
LoadRunner User Guide
VuGen Concepts
2. Locate the cursor over the center button of the complex marker. When you release the mouse
button, the selected pane is added as a tabbed pane to the selected zone.
3. Repeat this procedure for each pane you want to move.
Note: If you drag the title bar of a zone that contains multiple tabbed panes, then all the panes
in the zone are moved to the selected zone.
Floating and docking panes
Docked panes are fixed in a set position within the VuGen window. For example, when you move a
pane to a position indicated by a marker, the pane is docked in that position.
Floating panes are displayed on top of all other windows. Floating panes can be dragged to any
position on your screen, even outside the VuGen window. Floating panes have their own title bars.
l
To float a pane, right-click the title bar, and click Float. The pane opens on top of all the other
windows and panes, with its own title bar.
l
To dock a pane, double-click the title bar, or right-click the title bar and select Dock as tabbed
document. The pane returns to its previous position in the VuGen window.
Options Overview
The Options dialog box is comprised of VuGen application settings. The settings are common to all
protocols available in VuGen.
Specific details of each of the settings are described in the topic of the relevant category topic.
The following table includes a list of the categories and related sections from the Options dialog
box.
General
l
Task List enables you to add, update and delete comment tags.
l
Projects and Solutions enables you to configure project settings.
l
Community enables you to add, update and delete Community Search Sites.
For details, see "General Options" on the next page.
HP LoadRunner (12.00)
Page 94 of 1743
LoadRunner User Guide
VuGen Concepts
Editor
l
General enables you to configure font and other general options.
l
Markers and Rulers enables you to configure markers and rulers for text used in
a script.
l
Behavior enables you to configure settings related to tabs, keystrokes and
mouse behavior.
l
Code Color enables you to configure the font settings for each heading, control
and text type for each language type.
l
Code Completion enables you to configure the settings for code completion.
For details, see " Editor Options" on page 98.
Scripting
l
Recording UI enables you to configure the settings related to the recording user
interface, for example the floating toolbar used when recording.
l
Replay enables you to configure the settings related to replay of the script.
l
Script Management enables you to edit the list of file extensions.
l
Comparison enables you to enter the location of the comparing application.
l
Step Navigator enables you to select the background and foreground colors for
the Step Navigator pane.
l
Thumbnails enables you to configure the Thumbnail Explorer.
l
Output Pane enables you to configure the appearance of the Output Pane.
l
Snapshot enables you to configure appearance of snapshots in your script.
l
Parameters enables you to define the delimiter to use for parameter braces
throughout a script.
l
Parser enables C language parser.
For details, see "Scripting Options" on page 103.
General Options
This pane enables you to configure general user interface options.
Task List
To access
VuGen > Tools > Options > General > Task List
User interface elements are described below:
HP LoadRunner (12.00)
Page 95 of 1743
LoadRunner User Guide
VuGen Concepts
UI
Element
Description
Comment This pane enables you to add, delete or modify tags names that you can use to label
Tags
comment tasks in your scripts.
Tags. List of available tags.
Name. Displays the name of the highlighted tags in the token list. This area enables
you to modify, add or delete the current tag.
Add. Enables you to add a tag to the token list.
Edit. Enables you to modify the name of tag from the token list.
Delete. Enables you to delete a tag from the token list.
Scripts and Solutions
To access
VuGen > Tools > Options > General > Scripts and Solutions
User interface elements are described below:
UI Element
Description
Settings
Default project location
Enables you to specify a path to your saved projects. Default location =
C:\Users\<username>\Documents\SharpDevelop Projects
Load previous solution on startup
Enables you to automatically load the previous solution.
By default this option is enabled.
Start Page
Settings
Display Start Page on startup
By default this option is enabled.
Close Start Page after script loads
By default this option is enabled.
ALM
To access
VuGen > Tools > Options > General > ALM
User interface elements are described below:
HP LoadRunner (12.00)
Page 96 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Connect to
ALM in CAC
mode
Connects to HP Application Lifecycle Management using CAC (Common
Access Card). This enables you to log in without providing a username and
password.
Community
To access
VuGen > Tools > Options > General > Community
See also
For details, see Community Search in the "Editor - Overview" on page 82.
User interface elements are described below:
UI
Element
Description
Community Search Sites
Adds a new search site to the list of Community search sites.
l
Name: Enables you to specify a name of the search site that is displayed on the
VuGen toolbar.
l
URL: Enables you to specify the URL of the search site.
Example URLs
http://www.bing.com/search?q=%QUERY%
http://www.google.com/search?q=%QUERY%
http://www.google.de/search?q=%QUERY% (localized google site, e.g.
de for Germany)
http://en.wikipedia.org/wiki/%QUERY%
Enables you to edit the properties of the custom search site.
Deletes the search site from the list of available sites.
Moves the search site lower down on the list of available sites.
Moves the search site higher up on the list of available sites.
HP LoadRunner (12.00)
Page 97 of 1743
LoadRunner User Guide
VuGen Concepts
Editor Options
This pane enables you to configure the text editor options.
General
To access
VuGen > Tools > Options > Editor > General
User interface elements are described below:
UI Element
Description
Font
Text Font
Enables you to select the font.
Size
Enables you to select the font size.
General Options
Word wrap
Automatically wraps text to the next line.
By default this option is disabled.
Show
Class/Function
Browser
Show or hide the Class/Function Browser. When enabled, you can navigate
quickly to a specific class or function in your script by selecting it from the
drop-down list in the browser.
By default this option is enabled.
Show line
numbers
Enable line numbering of script in the Editor.
By default this option is enabled.
Check for line
Enable the editor to check for end of line inconsistencies in your script. If
ending
enabled, a utility appears in the script editor that enables you to normalize line
inconsistencies endings based either on a Windows standard (CRLF) or a Linux standard
(LF).
This option is enabled by default.
Enable working Enable URLs in scripts to function as hypertext links. Disabling this option
URL hypertext
may increase performance.
links in the
By default this option is enabled.
Editor
HP LoadRunner (12.00)
Page 98 of 1743
LoadRunner User Guide
VuGen Concepts
Markers and Rulers
To access
VuGen > Tools > Options > Editor > Markers and Rulers
User interface elements are described below:
UI Element
Description
Markers and Rulers
Show spaces
Enable markers that indicate where tabs exists.
By default this option is disabled.
Show tabs
Enable markers that indicate where line ends.
By default this option is disabled.
Show end-ofline makers
Enable markers that indicate where line ends.
Underline
errors
Enable underlining of errors.
Highlight
matching
brackets
Enable highlighting of matching brackets.
Highlight
symbols
When this option is enabled, you can select a non-keyword in your script and
the Editor will highlight all other occurrences in your script.
By default this option is disabled.
By default this option is enabled.
By default this option is enabled.
By default this option is enabled.
HP LoadRunner (12.00)
Page 99 of 1743
LoadRunner User Guide
VuGen Concepts
Behavior
To access
VuGen > Tools > Options > Editor > Behavior
User interface elements are described below:
UI Element
Description
Tabs
Indentation
Enables you to set the spacing for tab indentation.
Default indentation is four spaces.
Convert tabs to spaces
Converts tabs to spaces.
By default this option is disabled.
Use smart indentation
Automatically applies the indentation format from the previous line.
By default this option is enabled.
Behavior
Enable zoom with
mouse wheel
Enables you to use the mouse wheel to zoom.
Cut or Copy entire line
when nothing is
selected
Allows you to cut or copy an entire line without highlighting it in the
editor, as long as the cursor is within that line.
Enable Ctrl + Click for
"Go to Definition"
Enables the Ctrl + Click shortcut for "Go To Definition". This lets you
move the cursor to the definition of a function you highlighted in the
editor.
By default this option is enabled.
By default this option is enabled.
By default this option is enabled.
Code Color
To access
VuGen > Tools > Options > Editor > Highlighting
Important
information
Highlighting options enable you to customize the color of script
elements.
User interface elements are described below:
UI Element
HP LoadRunner (12.00)
Description
Page 100 of 1743
LoadRunner User Guide
VuGen Concepts
<Language
Selection>
Drop-down list of script languages for which you can customize appearance
including:
l
C#
l
HTML
l
VuGen C
l
XML
<Element
Selection>
List of code elements whose appearance you can customize.
Foreground
color
Enables you to select a color from the pallet. The select color is applied to the
foreground of the code element.
Background
color
Enables you to select a color from the pallet. The select color is applied to
background of the code element.
Code Completion
To access
VuGen > Tools > Options > Editor > Code Completion
User interface elements are described below:
UI Element
Description
Enable code
completion features
Code completion features are enabled. For details on code completion,
see "Editor - Overview" on page 82.
By default this option is enabled.
Enable syntax
tooltip
Enables tooltips that display function arguments. Each argument is
highlighted as you are defining it, moving to the subsequent argument
when the delimiter is entered.
By default this option is enabled.
HP LoadRunner (12.00)
Page 101 of 1743
LoadRunner User Guide
VuGen Concepts
Show tooltips when When this option is enabled, a description of the code elements is
mouse pointer stops displayed when the mouse hovers over the identifier. This option is
over an identifier
disabled when Show tooltips in debug mode only is enabled.
By default this option is enabled.
Show tooltips in
debug mode only
Tooltips are displayed in debug mode only.
By default this option is disabled.
Include in the code completion list
ANSI C keywords
Enables you to include ANSI C keywords in code completion list.
By default this option is enabled.
LoadRunner API
Steps
Enables you to include LoadRunner API Steps in the code completion
list.
By default this option is enabled.
LoadRunner API
Constants
Enables you to include LoadRunner API Constants in the code
completion list.
By default this option is disabled.
User-defined
functions
Enables you to include user-defined functions in the code completion
list.
By default this option is enabled.
Function
parameters, local
and global variables
Enables you to include function parameters, local, and global variables
in the code completion list.
By default this option is enabled.
Folding
To access
VuGen > Tools > Options > Editor> Folding
User interface elements are described below:
UI Element
Description
Enable folding features
This option enables expanding and collapsing of script
sections.
By default this option is enabled.
Enable steps folding
This option enables expanding and collapsing of script
steps.
By default this option is disabled.
HP LoadRunner (12.00)
Page 102 of 1743
LoadRunner User Guide
VuGen Concepts
When step length is more than
[ ] characters
Enables you define the number of characters in a step
before implementing folding.
By default this option is disabled.
When step consists of more
than [ ] lines
Enables you to define the number of lines to a step before
implementing folding.
By default this option is disabled.
Scripting Options
This pane enables you to configure options related to recording, replaying and debugging scripts.
Recording UI
To access
VuGen > Tools > Options > Scripting > Recording UI
User interface elements are described below:
UI Element
Description
Enable Recording
Floating Toolbar
transparency mode
Display a transparent floating recording toolbar. When you click or
hover on the toolbar it becomes opaque.
Enable 'Cancel
Recording' button
Enable the Cancel Recording button on the floating recording toolbar.
By default this option is disabled.
Note: When the Cancel Recording button is enabled, there may
be a delay when you start recording into an existing script. This
delay occurs while VuGen makes a copy of the existing script.
By default, this option is enabled.
Open Start
Recording Dialog
Box after new script
is created
Automatically open the Start Recording Dialog Box after a new script is
created.
Automatically close
transactions
Enable this function if you want VuGen to insert an end transaction
step for open transactions before recording a subsequent action.
By default this option is disabled.
By default this option is disabled.
Replay
To access
VuGen > Tools > Options > Scripting > Replay
User interface elements are described below:
HP LoadRunner (12.00)
Page 103 of 1743
LoadRunner User Guide
VuGen Concepts
UI
Element
Layout
Description
Do not switch the layout during Replay. By default, when you replay a script,
VuGen automatically switches the UI layout to the Debug layout. This option
enables you to maintain your selected layout during replay.
By default this option is disabled.
Animated
Run
Animated Run
You can run a Vuser script in animated mode or non-animated mode. When you run
in animated mode, VuGen highlights the line that is running in the Vuser script.
When you run in non-animated mode, VuGen executes the Vuser script, but does
not indicate the line being executed.
By default this option is enabled.
Animated Run Delay
You can set a delay of the highlighting in the animated run, allowing you to better
view the effects of each step. You set the delay in milliseconds.
The default delay is 1.
Animate Functions in the Action section only
Animates the content of the Action sections only, not the init or end sections.
By default this option is enabled.
Results
Enable result of replay summary to be saved to a named folder
after each script run
When this option is enabled the dialog box prompts you to name a results file before
running a script in VuGen. When not enabled, VuGen automatically names the
directory 'result1'. Subsequent script runs will automatically overwrite previous
results files unless you specify a different name.
Note: Results are stored in a subdirectory of the script.
By default this option is disabled.
Generate report during script execution
By default this option is disabled.
HP LoadRunner (12.00)
Page 104 of 1743
LoadRunner User Guide
VuGen Concepts
During
Replay
l
Show run-time view during replay
Enables the run-time viewer
l
Auto Arrange Window
Select this option to arrange the two viewers side by side. This option is disabled
by default.
l
Collect replay statistics
Select this option to enable the collection of replay-time statistics. The data
collected is displayed in the Replay Summary report. This option is enabled by
default. For details, see "Replay Summary Tab" on page 140
After
replay
After replay show
Instructs VuGen how to proceed after the replay:
l
Script. Show script in the Editor.
l
Replay summary. Go directly to the Replay Summary window in the Editor.
(Default)
Script Management
To access
VuGen > Tools > Options > Scripting > Script Management
User interface elements are described below:
UI Element
Description
List of file types, by extension, that
can be edited in the Editor
Enables you to modify the list of valid file extensions
that can be edited in the Editor.
Comparison
To access
VuGen > Tools > Options > Scripting > Comparison
User interface elements are described below:
UI
Element
Description
Path to
You can select a comparison tool to be used when comparing two scripts. VuGen
comparing is installed with a default comparison tool (Wdiff).
tool
Click the browse button to locate a third-party comparison tool that is installed on
your local machine.
HP LoadRunner (12.00)
Page 105 of 1743
LoadRunner User Guide
VuGen Concepts
Command
line
arguments
This option contains the mandatory default arguments %1 and %2 for the two files
you want to compare, which should not be modified. You can add additional
arguments, as needed, for your comparison tool.
Step Navigator
To access
VuGen > Tools > Options > Scripting > Step Navigator
User interface elements are described below:
UI Element
Description
Enable Editor
highlighting
This option enables you to highlight filtered steps in your script.
Background color
Enables you to select a background color to apply to the filtered steps
in your script.
Border color
Enables you to select a border color to apply to the filtered steps in
your script.
Thumbnails
To access
VuGen > Tools > Options > Scripting > Thumbnails
User interface elements are described below:
UI Element
Description
Enable Thumbnail
Explorer
Enables slide view of generated thumbnails in the Thumbnail Explorer.
Double clicking a thumbnail sets the cursor at the associated step in
the script.
Highlight the
thumbnail associated
with a step
Sync the display of the Thumbnail Explorer while scrolling through
steps in the Editor.
Show important
VuGen displays thumbnails directly related to the business process
thumbnails by default and filters out less important thumbnails by default.
Enable Automatic
Creation
Enables the automatic creation of thumbnails during the application's
idle time.
Cache thumbnails to
script folder
Optimize VuGen's performance by saving rendered thumbnails to a
cache file. Thumbnails are loaded from the cache file after the initial
generation.
Output Pane
To access
HP LoadRunner (12.00)
VuGen > Tools > Options > Scripting > Output
Page 106 of 1743
LoadRunner User Guide
VuGen Concepts
User interface elements are described below:
UI Element
Description
Format
Word wrap
Enables word wrapping in Output pane.
Font
Text Font
Enables you to select a font.
Size
Enables you to select a font size.
Java
To access
VuGen > Tools > Options > Scripting > Java
User interface elements are described below:
UI Element
Description
Eclipse IDE Location
Browse
Enables you to set the location of the Eclipse program, eclipse.exe.
Citrix
To access
VuGen > Tools > Options > Scripting > Citrix
User interface elements are described below:
UI Element
Description
Show client
during replay
Shows the Citrix client during script replay.
Show Bitmap
Selection popup
Issues a popup message when inserting a Get Text or Sync Bitmap
function before selecting a bitmap or text in the snapshot.
Snapshots
To access
VuGen > Tools > Options > Scripting > Snapshots
User interface elements are described below:
UI Element
HP LoadRunner (12.00)
Description
Page 107 of 1743
LoadRunner User Guide
VuGen Concepts
Enable
snapshot
viewing
Enables the viewing of snapshots when you click on a step in the editor or
step navigator.This option allows you to improve VuGen's performance when
working with very large scripts.
Enable
enhanced XML
view
Enables the following XML viewer visual features:
l
XML tree
l
coloring
Clear this option to reduce the amount of memory consumed by the XML
view.
Enable
snapshot
caching
Allows snapshots to be cached.
Do not load text
snapshots
larger than
Text-based snapshots are not loaded if they are larger than the specified
size.
Do not load
binary
snapshots
larger than
Binary [hexadecimal] based snapshots are not loaded if they are larger than
the specified size.
Do not load
XML snapshots
larger than
XML-based snapshots are not loaded if they are larger than the specified
size.
Clear this option where you are working with large snapshots and are running
out of memory.
Parameters
To access
VuGen > Tools > Options > Scripting > Parameters
User interface elements are described below:
UI Element
Description
Left parameter
delimiter
Enables you to specify a left parameter delimiter.
The following characters are valid: !, #, $, %, &, (, ), [, ], {, }, |, ~, `, <, >, ?
Note: If you change the left parameter delimiter, the specified delimiter
will be applied to new Vuser scripts only, not to existing scripts.
HP LoadRunner (12.00)
Page 108 of 1743
LoadRunner User Guide
VuGen Concepts
Right
parameter
delimiter
Enables you to specify a right parameter delimiter.
The following characters are valid: !, #, $, %, &, (, ), [, ], {, }, |, ~, `, <, >, ?
Note: If you change the right parameter delimiter, the specified delimiter
will be applied to new Vuser scripts only, not to existing scripts.
Parameter
background
color
Enables you to specify the background color for parameters in a Vuser script.
Parameter
border color
Enables you to specify the border color for parameters in a Vuser script.
Restore
Delimiter
Defaults
Resets both the left and right parameter delimiters to their default values.
Parser
To access
VuGen > Tools > Options > Scripting > Parser
User interface elements are described below:
UI Element
Description
Enable C
Language
Parser
Disabling the C language parser may improve application performance when you
are working with very large scripts. However, the following features will be
disabled:
l
Editing step arguments in the Editor
l
Statement completion
l
Snapshots
l
Tasks
l
Thumbnails
l
Additional step-related functionality
This option is enabled by default.
Search and Replace Dialog Boxes
These dialog boxes enable you to find and replace text strings in Vuser scripts and solutions.
HP LoadRunner (12.00)
Page 109 of 1743
LoadRunner User Guide
VuGen Concepts
Search Dialog Box
To
access
Note
l
VuGen > Search > Quick Find
l
VuGen > Search > Find in Files
Some of the UI elements in the table below appear in the Quick Find dialog box only
and some appear in the Find in Files dialog box only.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Searchtype dropdown>
Enables you to specify the type of search to perform: Quick Find or Find in
Files. Note that the UI of the Search dialog box changes depending on the
selection.
Find text
Specify the text to search for.
Shows the Regular Expression Builder. The Regular Expression Builder enables
you to build a regular expression in the Find text box.
Regular
Expression
Select Regular Expression to indicate that the Find text string is a regular
expression.
Scope
Specify the files in which to search.
Match case
Distinguishes between uppercase and lowercase characters during the search.
Match
whole
word
Searches for occurrences that are whole words, and not part of a larger word.
Search up
Performs the searches upwards.
Include in
search
Enables you to select which entities are included in the search.
Directory
Specify the folder that contains the files that will be searched during a "Find in
Files" search.
Options
Enables you to specify options when performing a "Find in Files" search.
Find Next
Finds the next occurrence of the text or regular expression in the Find text box.
HP LoadRunner (12.00)
Page 110 of 1743
LoadRunner User Guide
VuGen Concepts
Find All
Finds all occurrences of the text or regular expression that appears in the Find
text box. The results appear in the Search Results pane. In the Search Results
pane, you can:
l
Right-click an entry and select Locate to show the corresponding text in the
Vuser script or wherever it is located.
l
Right-click an entry and select Copy to copy the selected search result to the
clipboard.
l
Right-click and select Copy All to copy all the search results to the clipboard.
Replace Dialog Box
To access
VuGen > Search > Quick Replace
User interface elements are described below:
UI Element
Description
Find text
Specify the text to search for.
Shows the Regular Expression Builder. The Regular Expression Builder enables
you to build a regular expression in the Find text box.
Regular
Expression
Select Regular Expression to indicate that the Find text string is a regular
expression.
Replace
with
Specify the text that will replace the Find text.
Scope
Specify the files in which to search.
Options
Enables you to specify options when performing the search.
Match case
Distinguishes between uppercase and lowercase characters during the search.
Match
whole
word
Searches for occurrences that are whole words, and not part of a larger word.
Search up
Performs the searches upwards.
Find Next
Finds the next occurrence of the text or regular expression in the Find text box.
Replace
Replaces the selected text with the text in the Replace with box.
Replace
All
Replaces all found occurrences of the text or regular expression in the Find text
box with the text in the Replace with box.
HP LoadRunner (12.00)
Page 111 of 1743
LoadRunner User Guide
VuGen Concepts
Editor
This pane enables you to edit scripts and other related script files. In addition you can open a
browser session to search sites, such as the LoadRunner Forum.
To access
The Editor is opened when VuGen is loaded.
Important
information
l
The Editor is automatically displayed as part of the default layout.
l
Press Ctrl +Tab to display a list of tabs and panes. Highlight and click to
switch tabs in the Editor.
l
Press Ctrl + g or select Search > Go to... to go to a specific line in the
script.
l
Other main interface panes such as Output, Error, and Snapshot synchronize
their displays based on your location in the Editor.
l
You can double-click an asset in the Solution Explorer to open it in the Editor.
l
Script modifications are displayed as highlighted text in the editor. The
following are examples:
n Script has been modified but not saved.
See Also
n
Script has been modified and saved.
n
Breakpoint has been inserted.
l
"Editor - Overview" on page 82
l
" Editor Options" on page 98
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Gutter>
The Editor gutter enables you to add toggle functionality including:
l
Breakpoints
For details, see "Working with Breakpoints" on page 392 or "Breakpoints
Pane" on page 135.
l
Bookmarks
For details, see "How to Use Bookmarks" on page 385.
Class/Function When enabled, you can navigate quickly to a specific class or function in your
Browser
script by selecting it from the drop-down list in the browser.
HP LoadRunner (12.00)
Page 112 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Line numbers
Display of line numbers in the script.
Context Menu
Comment
region
Enables you to comment out highlighted script lines.
Indent
Indent the selected line or lines of your script.
Show
Snapshot
Show the snapshot associated with the highlighted script step.
Correlate
Selection
Opens Design Studio and scans for dynamic values to be correlated in the
selected script section.
Insert
Insert a Start Transaction step into your script.
For details, see "Transaction Overview" on page 397.
Insert an End Transaction step into your script.
For details, see "Transaction Overview" on page 397.
Insert a Rendezvous point step into your script.
For details, see "Rendezvous Points" on page 400.
Insert comments into your script.
Log
Message
Insert a
into
your script.
Breakpoints
Toggle Breakpoint.
Search
Community
Opens the default Community Search browser.
Thumbnail Explorer
This pane enables you to flip through thumbnail images of your business process, enhancing your
ability to navigate to specific locations in the Editor based on a visual representation of a step.
Conversely, you can scroll through the Editor and see the visual context of your script in the
Thumbnail Explorer.
HP LoadRunner (12.00)
Page 113 of 1743
LoadRunner User Guide
VuGen Concepts
To access
Important
information
Relevant
tasks
Use one of the following:
l
VuGen > View >Thumbnail Explorer
l
Click the
l
You can move this pane to different areas of the Main User Interface. For
details see, "VuGen Layouts - Overview" on page 79.
l
You can configure the Thumbnail Explorer in Options > Scripting Options.
For details, see "Scripting Options" on page 103.
l
Thumbnails are created in the same order as the actions in the Solution
Explorer and not controlled by the settings in Run-Time Settings > General >
Run Logic.
l
Enabling automatic creation of thumbnails in Options > Scripting >
Thumbnails enables VuGen to create thumbnails during the application's idle
time.
l
If the Windows Aero theme is enabled, thumbnails capture more realistic
images of the application.
button on the VuGen toolbar.
"How to Modify the VuGen Layout" on page 93
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Moves the cursor to the step in the Editor associated with the highlighted
thumbnail in the Thumbnail Explorer.
Enables a full screen view of the thumbnail.
Synchronizes the scrolling in the Editor with the associated thumbnail in the
Thumbnail Explorer and step in the Step Navigator.
Filters out minor thumbnails that are not directly related to the recorded
business process.
Refreshes the generated thumbnails.
Scroll a page left in the Thumbnail Explorer.
Move to the previous thumbnail in the Thumbnail Explorer.
Move to the next thumbnail in the Thumbnail Explorer.
HP LoadRunner (12.00)
Page 114 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Scroll a page right in the Thumbnail Explorer.
Business Process Report Dialog Box
This dialog box enables you to create a business process report.
To access
VuGen > Tools > Create Business Process Report
Relevant tasks
"How to Create a Business Process Report" on page 92
User interface elements are described below:
UI Element
Description
Title
The title of the report.
Author
Your name.
HP LoadRunner (12.00)
Page 115 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Comment
Any additional comments you want to appear in the report.
Location
The path where you want the report to be saved.
Default value: script folder.
Expands the Business Process Report dialog box to display more
options.
Table of contents
A table of contents generates for your report. If you disable an option, it
will not appear in the table of contents.
Default value: enabled.
Recording summary
A summary of the recording session as it appears when you click the
Recording Summary link in the Tasks list.
Default value: enabled.
Transactions and
Rendezvous lists
A list of all of the transactions and rendezvous points that were defined
in the script.
Default value: enabled.
Parameters list
A list of all the parameters that were defined in the script. This list
corresponds to the parameters listed in the Parameter List dialog box
Design > Parameter List.
Default value: enabled.
Thumbnails
An actual snapshot of the recorded step, adjacent to the step name and
description.
Default value: enabled.
Step descriptions
A short description of each step.
Default value: enabled.
Script name
The .usr file name of the script.
Output format
Creates the report in the selected format. The following formats are
available:
HP LoadRunner (12.00)
l
Microsoft Word
l
Adobe PDF
l
HTML
Page 116 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Document template
The path and file name of the template to use for the report. The default
template is stored in the LoadRunner's dat folder.
To change the report template, click the browse button and specify new
template with a .docx extension. If you want to create a new template,
we recommend that you use an existing template as a basis for the new
one. This will make sure that the required bookmarks and styles are
maintained within the new template.
Steps Toolbox Pane
This pane enables you to drag and drop API functions into your script.
UI example
To access
Use one of the following:
l
Design > Insert in Script > New Step
l
Right click in the script in Editor > Insert > New Step
l
Press Ctrl+Alt+B
HP LoadRunner (12.00)
Page 117 of 1743
LoadRunner User Guide
VuGen Concepts
Important
information
Relevant
tasks
l
A step's associated parameter dialog box opens when you add the step to
the script.
l
You can drag and drop steps into your script.
l
You cannot drag and drop a step into a step from the Steps Toolbox but you
can manually add a step parameter within a step.
l
If you insert a step into the incorrect location in your script, the script may
fail.
"How to Insert Steps into a Script" on page 406.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Function List>
Displays a list of available functions divided into the following categories:
l
Common
l
Web checks
l
Services
l
XML
l
Web JS
l
Async
Search. Enables you to perform an incremental search in the function list by
entering text. For example, if you type "web" into the search box, the
function list will display only those function that include the letters "web".
Add. Add the highlighted step to the current location in your script.
Expand/Collapse. Expand or collapse the step categories.
Solution Explorer Pane
This pane enables you to navigate through a solution which contains script assets, parameters,
runtime settings, and replay runs.
HP LoadRunner (12.00)
Page 118 of 1743
LoadRunner User Guide
VuGen Concepts
To access
Important
information
Do one of the following:
l
View > Solution Explorer
l
Press Ctrl + Alt + L
l
Solution Explorer is automatically displayed as part of the default layout.
l
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
l
Other main interface panes such as Output, Error and Snapshot synchronize
their displays based on your location in the Solution Explorer.
l
You can double-click an asset to activate it in the editor area or right-click to
examine quick operations available for that asset.
HP LoadRunner (12.00)
Page 119 of 1743
LoadRunner User Guide
VuGen Concepts
See also
l
"VuGen User Interface - Overview" on page 75
l
"Solution Explorer - Overview" on page 80
l
"VuGen Layouts - Overview" on page 79
l
"How to Import Actions to a Script" on page 265
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Solution>
Container for scripts.
l
Default solution name is Untitled.
Context menu options
l
Add New Script
For details, see "Create a New Script Dialog Box" on page 170.
l
Add Existing Script
l
Save All Scripts
l
Close Solution
l
Save Solution As...
HP LoadRunner (12.00)
Page 120 of 1743
LoadRunner User Guide
VuGen Concepts
<Script>
Container for script assets including scripts actions, extra files, run-time settings
and parameters.
Context menu options
l
Save Script
Select to save script
l
Save Script As...
Save script with new name or to a new location, such as ALM.
l
Export to Template....
You can save scripts as templates. For details, see "How to Create and Open
Vuser Script Templates" on page 173.
l
Remove Script
Enables you to delete a script from the solution or select check box to delete
from file directory.
l
Select file to compare
You can compare one asset to another. This option selects the highlighted
asset as the primary asset.
l
Compare to <filename>
Compares between the selected asset and the primary asset.
l
Compare to external file...
You can compare an asset to a file outside of the solution. This option sets the
highlighted asset as the primary asset and opens Windows Explorer to enable
you to select the secondary asset.
l
Select Folder to Compare
You can compare one folder to another. This option selects the highlighted
folder as the primary folder.
l
Compare to External Folder...
Compares between the selected folder and the primary folder.
l
Open Script Folder
While you record, VuGen creates a series of configuration, data, and source
code files. These files contain Vuser run-time and setup information. VuGen
HP LoadRunner (12.00)
Page 121 of 1743
LoadRunner User Guide
VuGen Concepts
saves these files together with the script.
You can open the folder on the local disk where the script is saved. For scripts
that are saved on a different storage location (such as ALM), this option opens
the temporary folder on the local disk.
<Actions>
Container for individual actions including the default actions:
l
vuser_init
l
action
l
vuser_end
Context menu options
l
Create New Action
Enables you to add a new script action block to your script.
l
Import Action
Enables you to import an action from an existing script.
HP LoadRunner (12.00)
Page 122 of 1743
LoadRunner User Guide
VuGen Concepts
Extra Files
Container for extra files associated with your script. You can access these extra
files directly from VuGen.
Context menu options
l
Create New File
Enables you to create a new file, and then adds the new file to the Extra Files
node of your script.
l
Add Files to Script
Enables you to add files to the Extra Files node of your script. The files that you
add must already exist.
l
Add Files Downloaded from HPLN
Enables you to add files to the Extra Files node of your script. The files that you
add must have been previously downloaded from HPLN.
l
Add Files from Folders and Sub-folders
Enables you to add the contents of folders and sub-folders to the Extra Files
node of your script.
For details on extra files, see "Solution Explorer - Overview" on page 80.
Run-Time
Setting
Opens the run-time settings dialog box.
For details, see Run-Time Settings Overview.
Parameters Enables you to create, edit, and list parameters associated with your script. For
details, see "Parameters" on page 408.
Context menu options
l
Parameters list
l
Create new parameter
l
Edit parameter
l
Configure parameter delimiter
HP LoadRunner (12.00)
Page 123 of 1743
LoadRunner User Guide
VuGen Concepts
Replay
Runs
Enables you to display the Replay Summary report.
Context menu options
l
Open Replay Summary
Enables you to open the Replay Summary in the Editor for selected iteration.
l
Open Test Results
Enables you to open the Test Results in the Editor for selected iteration.
Output Pane
The Output pane displays messages that were generated during the recording, compilation, and
replay of your script.
To access
Select View > Output, or click the Show Output Pane button
on the VuGen toolbar.
Important information
l
You can move this pane to different areas of the Main User
Interface. For details, see "VuGen Layouts - Overview" on
page 79.
l
When you open an existing script, the items displayed in the
Output Pane are from the latest replay or compilation.
Relevant tasks
How to Customize the VuGen Layout
See also
"VuGen User Interface - Overview" on page 75
User interface elements are described below:
HP LoadRunner (12.00)
Page 124 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
The type of output to display. The following types are
available:
l
Replay. Displays the messages generated by the script
replay.
Note: If you double-click an entry in the Replay log,
VuGen moves the cursor to the corresponding line in
the Editor.
l
Compilation. Displays the compilation messages.
l
Code Generation. Displays the code generated during
the recording.
l
Recording. Displays the messages generated during
the recording.
l
Recorded Events. Displays events that occurred during
recording.
Clears all of the messages from the message list.
Toggle Line Wrap. When selected, wraps the text of each
message onto the next line - as required.
Jumps to the location in the source document relevant to the
selected output message.
<Find box>. The text string that you want to find. You can
refine your search by selecting one of the Options
described below.
Press ENTER to begin the search.
Find Previous / Find Next. Highlights the next or previous
string that matches the text you entered in the Find box.
These buttons are available only after you enter text in the
Find box.
HP LoadRunner (12.00)
Page 125 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Enables you to refine your search with the following options:
l
Match Case. Distinguishes between upper-case and
lower-case characters in the search.
l
Match Whole Word. Searches for occurrences that are
only whole words and not part of longer words.
l
Use Regular Expression. Treats the specified text
string as a regular expression.
Note: Extended regular expressions and multi-line searches
are not supported.
Opens the Save As dialog box, enabling you to save the
contents of the message list as a text file.
View Summary
[Available in the Replay log only]
Opens the Replay Summary tab. For details, see "Replay
Summary Tab" on page 140.
Snapshot Pane
To access
Important
information
See also
Select View > Snapshot, or click the Show Snapshot Pane button
VuGen toolbar.
on the
l
The appearance and functionality of the Snapshot pane vary depending on the
protocol of the current Vuser script. In addition to the standard controls, the
Snapshot pane may display controls that are specific to the current Vuser
protocol.
l
The new Web snapshot model is backward compatible with previous versions
of LoadRunner, however some snapshot data may be missing. If this occurs,
regenerate the script.
l
When using Windows 2008 R2 and opening a snapshot from the step navigator
in SAP GUI and Web protocols, the snapshots might not open automatically.
Workaround: Internet Explorer Enhanced Security Configuration must be
disabled to view help content. It is enabled by default. (Control Panel >
Administrative tools > Server manager > Configure IE ESC).
l
You can move this pane to different areas of the Main User Interface. For
details see, "VuGen Layouts - Overview" on page 79.
"Snapshot Pane - Overview" on page 85
"How to Work with Snapshots" on page 88
HP LoadRunner (12.00)
Page 126 of 1743
LoadRunner User Guide
VuGen Concepts
Standard Snapshot pane controls
The Snapshot pane displays the following standard controls:
UI Element
Description
Shows a single snapshot in the Snapshot pane.
Splits the Snapshot pane to show two snapshots.
Displays two snapshots in the Snapshot pane - one to the side of the other.
Displays two snapshots in the Snapshot pane - one above the other.
Shows the record snapshot in the Snapshot pane.
Shows the replay snapshot in the Snapshot pane.
Select the iteration number of the replay snapshot to display.
Synchronizes the display of the two snapshots if the Snapshot pane is split.
Note that snapshot synchronization is available for only specific Vuser
protocols, and for only specific views within the protocols.
Compares the two snapshots that are currently displayed in the Snapshot
pane. To enable the Compare functionality, you must first split the Snapshot
pane to show two snapshots. By default, VuGen uses the WDiff utility to
compare snapshots. You can specify an alternative comparison tool as
described in "Scripting Options" on page 103.
Note that the snapshot comparison functionality is available for only the
Web HTTP/HTML and Web Services protocols.
Citrix, RDP, and SAP protocols
User interface elements are described below:
UI
Description
Element
Displays the next record snapshot that was appended during script replay.
Displays the previous record snapshot that was appended during script replay.
Image
Displays a graphical representation of the snapshot. You can synchronize the display
of two snapshots in the Snapshot pane. Snapshots display faster when the Image
view is used than when the Full view is used.
HP LoadRunner (12.00)
Page 127 of 1743
LoadRunner User Guide
VuGen Concepts
Full
Displays a graphical representation of the snapshot. You cannot synchronize the
display of two snapshots in the Snapshot pane. Snapshots display slower when the
Full view is used than when the Image view is used.
Windows Sockets protocol
User interface elements are described below:
UI
Element
Description
Hex
Displays the buffer data in hexadecimal.
Text
Displays the buffer data as text.
Go To
Open the Go To Offset dialog box that enables you to navigate within the data
buffer.
Ajax (Click & Script) and Web (Click & Script) protocols
User interface elements are described below:
UI Element
Description
Page View
Displays a graphic view of the Web page.
Page Source
Displays the HTTP source code of the Web page.
Web (HTTP/HTML) protocol
User interface elements are described below:
UI
Element
Description
Displays step data in HTML format.
Displays step data in HTTP format. This enables you to view in-depth information
about the step, including request data, response data, cookies, and headers. For
more information, see "Web Snapshots - Overview" on page 823.
(HTTP Data view only) Displays the HTTP flow data in a list format.
(HTTP Data view only) Displays the HTTP flow data in a tree structure.
Protocols with an XML request/response (such as Web Services)
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 128 of 1743
LoadRunner User Guide
VuGen Concepts
Displays an XML view of the server response.
Displays an XML view of the request.
Opens the XPath search dialog box, allowing you to search the XML code
using a standard XPath expression.
HP LoadRunner (12.00)
Page 129 of 1743
LoadRunner User Guide
VuGen Concepts
<shortcut
menu>
l
Copy Selection. Copies the text that is selected in the text view to the
clipboard.
l
Search Community. Performs a community search using the text that is
selected in the text view as the search string. For details about performing a
community search, see "Editor - Overview" on page 82.
l
Copy XPath. In the tree view, copies the XPath of the selected node to the
clipboard. In the text view, copies the XPath of the XML element in which
the cursor is located to the clipboard.
l
Copy full value. In the tree view, copies the full XML code of the selected
node to the clipboard. In the text view, copies the full XML code of the XML
element in which the cursor is located.
l
Insert XML Check. Opens the Insert XML Check dialog box that enables
you to insert an XML Find step into the Vuser script.
This option is available in the Response view only.
This option is available for attribute and value nodes only.
l
Save value in parameter. Opens the Save Value as Parameter dialog box
that enables you to save the selected value to a simple parameter.
This option is available in the Response view only.
This option is available for attribute
and value
nodes only.
l
Save XML in parameter. Opens the Save Value as Parameter dialog box
that enables you to save the selected value to an XML parameter.
This option is available in the Response view only.
l
Create Correlation. Opens the Correlation tab in the Design Studio. The
text selected in the Snapshot pane appears as a manual correlation entry in
the Design Studio. For details, see "How To Manually Correlate Scripts" on
page 282.
This option is available in the Response view only.
This option is available for attribute
and value
nodes in the tree
view, and when text is selected in the text view.
l
HP LoadRunner (12.00)
Create Correlation Rule. Opens the Add as Rule dialog box that enables
you to add the selected text as part of a correlation rule. For details, see
"Correlation Tab [Design Studio] Overview" on page 275.
Page 130 of 1743
LoadRunner User Guide
VuGen Concepts
This option is available in the Response view only.
This option is available for attribute
and value
nodes in the tree
view, and when text is selected in the text view.
Database Protocols
User interface elements are described below:
UI Element
Description
Shows the record snapshot in the Snapshot pane.
Displays data in a data grid.
Bookmarks Pane
The Bookmarks pane displays a list of the bookmarks in your Vuser script. You can navigate
between the bookmarks to help analyze and debug your code.
To access
VuGen > View > Bookmarks
Important
information
l
All bookmarks added to a Vuser script are maintained after you close and
reopen the Bookmarks pane.
l
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
Relevant
tasks
"How to Use Bookmarks" on page 385
See also
"VuGen User Interface - Overview" on page 75
How to Customize the VuGen Layout
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Bookmarks Displays a list of all bookmarks that are defined in the Vuser script. You can
list>
double-click any bookmark line to navigate directly to the relevant line in the
Vuser script.
Toggles the status of the selected bookmark.
Navigates to previous bookmark in the pane.
Navigates to next bookmark in the pane.
HP LoadRunner (12.00)
Page 131 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
Deletes the selected bookmark.
Deletes all bookmarks.
Step Navigator Pane
The Step Navigator pane enables you to navigate to a selected step in your script. If your script
contains many steps, you can use the search box to search for matching text in the different parts
of the steps.
To access
VuGen > View > Steps
Important
information
l
You can search within an action or script but not across multiple scripts in a
solution.
l
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
l
You may experience a degradation in performance during replay when the Step
Navigator pane is visible.
Workaround: Close the Step Navigator pane when replaying a script. You can
also set your Replay layout to exclude the Step Navigator pane.
User interface elements are described below:
UI
Element
Description
HP LoadRunner (12.00)
Page 132 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
Search
box
You can search different parts of the steps for matching text. The following parts of
the steps can be searched:
l
l
l
l
All. (Default) All parts of the step (name, step, arguments).
Name. The name of the step.
Step. The description of the step (for example, web_url, web_custom_request)
Arguments. The arguments for the step.
Enter the text you want to search for in your steps, in the search edit box and select
the part of the steps you want to search. The Steps pane displays only those steps
that match your search criteria.
Line
The number of the step in the script.
Name
A step name.
Step
The step type.
/
Action
File parser indicator. A green symbol indicates that parsing succeeded and a red
symbol indicates that parsing failed.
The action into which the step was created.
# steps
Displays the total number of steps in the script or in the action.
displayed
Errors Pane
The Errors pane lists the replay and syntax errors found in your script, and enables you to locate
each error so that you can resolve it.
To access
VuGen > View > Errors
Important information
l
You can move this pane to different areas of the Main
User Interface. For details, see "VuGen Layouts Overview" on page 79.
l
When you open an existing script, the items displayed in
the Error Pane are from the latest replay or compilation.
Relevant tasks
How to Customize the VuGen Layout
See also
"VuGen User Interface - Overview" on page 75
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
HP LoadRunner (12.00)
Description
Page 133 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
<Define Available Categories>
Filters the error list by the source of the error.
Shows or hides syntax errors.
Shows or hides warnings detected during the run.
Shows or hides informational messages detected during the
run.
Jumps to the line in the Editor that contains the error.
! <Exclamation Point>
Message type:
l
Error
l
Warning
l
Informational message
Line
The line containing the error.
Description
Description of the error, warning or message and advice on
how to fix the problem. For example, a syntax error is
displayed if you opened a conditional block with an If
statement but did not close it with an End If statement, the
description is Expected Expression. Note: If the description
does not fit within the Description column, a tooltip displays
the full description when you hover the cursor over the
column. In certain cases, VuGen is unable to identify the
exact error and displays a number of possible error
conditions, for example: Expected 'End Sub', or 'End
Function', or 'End Property'. Check the statement at the
specified line to clarify which error is relevant in your case.
File
The name of the file that contains the problematic
statement.
Path
The full path of the file that generated the error.
Testing Project
The name of the relevant script.
Task Pane
This pane enables you to add, edit and track tasks associated with an individual script or the overall
goals of the project.
To access
VuGen > View > Task Pane
HP LoadRunner (12.00)
Page 134 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
Important
information
You can move this pane to different areas of the Main User Interface. For details
see, "VuGen Layouts - Overview" on page 79.
Relevant
tasks
How to Customize the VuGen Layout
See also
"VuGen User Interface - Overview" on page 75
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI
Element
Description
Comments Comment tasks are added directly into your script using the comment syntax of
tab
your scripting language and include a keyword such as TODO or FIXME. For
example, in C a comment script would look like this:
//TODO Add Parameter
The Task Pane displays the following information about each task:
User tab
<Task
Filter>
l
!: Task Type
l
Line: What line the task is located. Double-clicking the task jumps to that
location in the script.
l
Description: The Keyword and the task contents.
l
File: Action
l
Path: File location of the action.
You can add, edit, delete user tasks:
Click
to add a task .
Click
to edit a task .
Click
to delete a task.
You can filter tasks associated with a particular script or see all the tasks
associated with the solution.
Breakpoints Pane
The Breakpoints pane enables you to set and manage breakpoints to help analyze the effects of the
script on your application at pre-determined points during script execution.
HP LoadRunner (12.00)
Page 135 of 1743
LoadRunner User Guide
VuGen Concepts
To access
VuGen > View > Debug > Breakpoints
Important
information
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
Relevant
tasks
"How to Debug Scripts with Breakpoints" on page 394
Breakpoints Pane
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Removes the selected breakpoint.
Removes all breakpoints.
Locates the cursor in the Vuser script at the line that contains the selected
breakpoint.
Disables the selected breakpoint if it is enabled, and enables the selected
breakpoint if it is disabled.
Allows you to enter conditions for the selected breakpoint. See "Breakpoint
Condition Dialog Box" on the next page for more details.
<Breakpoints A list of the breakpoints and their locations in the script. To enable a breakpoint,
Grid>
select the Enable check box next to that breakpoint. To disable a breakpoint,
clear the Enable check box.
Enabled
A check box that specifies whether the breakpoint is enabled or disabled, and
enables you to enable or disable the adjacent breakpoint.
Name
The name of the file that contains the breakpoint, and the line number within the
file that contains the breakpoint.
Script
The name of the Vuser script that contains the breakpoint.
HP LoadRunner (12.00)
Page 136 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
Condition
The condition that applies to this breakpoint. If there is no condition, the replay
will always stop at the breakpoint.
Function
Name
The name of the function within the Vuser script that contains the breakpoint.
Breakpoint Condition Dialog Box
The Breakpoint Condition dialog box enables you to condition breakpoints by the iteration number,
the value of one or more parameters, or a combination of both parameter values and iteration
number.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Break when
iteration number
is
A check box that enables you to specify a breakpoint dependant on the
iteration number.
<Operand>
Choose one of the following operands:
l
= (equal)
l
<= (less than or equal to)
l
=> (equal to or greater than)
l
< (less than)
l
> (greater than)
to
Enter an iteration number.
Break when
Parameter
A check box that enables you to specify a breakpoint dependant on the
value of a parameter.
HP LoadRunner (12.00)
Page 137 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
<Parameter
Name>
Choose a parameter from the drop-down list
Value is
Enter the parameter value for which you want a breakpoint.
OK
Apply the conditions to the selected breakpoint. All future replays will only
stop at this breakpoint if these conditions are met.
Watch Pane
The Watch pane enables you to monitor variables while a script runs.
To access
VuGen > View > Debug > Watch
Important
information
l
This pane is relevant only when a run session is paused.
l
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
User interface elements are described below:
UI Element
Description
Enables you to add a variable to the watch list.
Enables you to edit the selected variable in the watch list.
Deletes the selected variable from the watch list.
Deletes all the variables from the watch list.
Expression The variable whose value you want to watch.
Value
The current value of the variable. The evaluated value is displayed only when a run
session is paused.
Type name
The type of the variable's value after it is evaluated (for example, Integer or Char).
If an variable cannot be evaluated in the current context, the type displayed is
Incorrect expression.
Run Time Data Pane
The Run Time Data pane displays information about the current script execution.
To access
VuGen > View > Debug > Run Time Data
HP LoadRunner (12.00)
Page 138 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
Important
information
l
The Run Time Data pane is accessible during script replay only.
l
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
Relevant
tasks
How to Customize the VuGen Layout
See also
"VuGen User Interface - Overview" on page 75
"How to Replay a Vuser Script" on page 316
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Iteration
Displays the current iteration number.
Action
Displays the Action name of the currently replayed step.
Line Number
Displays the line number of the currently replayed step.
Elapsed time
Displays the time that has elapsed since the start of the replay.
<Parameters> Displays all parameters defined, together with the script and their substitution
values based on the selected update method (sequential, unique, etc.). VuGen
shows this information even if the parameter is not used in the script.
Call Stack Pane
This debug pane enables you to view information about the functions that are currently on the call
stack of your script.
To access
VuGen > View > Debug> Call Stack
Important
information
l
This pane is relevant only when a run session is paused.
l
You can double-click any element in the Call Stack pane to navigate to the
beginning of the relevant function/action.
l
This pane is read-only.
l
You can move this pane to different areas of the Main User Interface. For
details, see "VuGen Layouts - Overview" on page 79.
Relevant
tasks
How to Customize the VuGen Layout
See also
"VuGen User Interface - Overview" on page 75
User interface elements are described below:
HP LoadRunner (12.00)
Page 139 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Function name
The name of the function currently called.
File name
The name of the file containing the called function.
Line #
The line number on which the function definition begins.
Replay Summary Tab
This tab provides summarized replay results and links to script replay details.
To access
Important
information
Use one of the following:
l
Solution Explorer > Right click Replay Runs > Select Open Replay
Summary Tab
l
Select View Summary link on the Output Pane
To enable transaction breakdown data, select Options > Scripting >
Replay > Collect replay statistics
Caution: Enabling the Collect replay statistics option will affect replay
performance.
See Also
HP LoadRunner (12.00)
l
"Output Pane" on page 124
l
"How to Replay a Vuser Script" on page 316
Page 140 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Results
Dashboard
Displays basic script information including:
l
Script name
l
Replay Status
Displays a replay status of the script as either Pass or Fail.
l
Elapsed time
Total time passed duration script replay.
l
Start time
Starting time of the script replay
l
End time
Ending time of the script replay
l
Think time
Total duration of Think time1 passed during script replay.
l
Wasted time
Total duration of Wasted time2 passed during script replay.
l
Select result scope
Enables you to select a specific iteration result set from a drop-down or an
average of all iterations.
1Span of time inserted into a script to simulate a user's pausing before moving on to the next step in
a business process.
2Time spent on activities whose purpose is to support test analysis, but would never be performed
by a browser user.
HP LoadRunner (12.00)
Page 141 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Script
Transactions
Displays a list of all transactions in your script with the following statistics:
l
Duration:
When the scope is a single iteration, the time displayed is the duration of the
transaction.
When the scope is an average, the time displayed is the average duration of
all iterations.
l
Trend:
Sparkline representation of values over all iterations.
l
Status
When the scope is a single iteration, the status displayed is either Passed
orFailed.
When the scope is an average, the status displayed is the number of
transactions with a status of Passed/Total iterations.
l
Size
When the scope is a single iteration, the size displayed is the size of the
data returned to the client.
When the scope is an average, the size displayed is the average size of the
data returned to the client.
HP LoadRunner (12.00)
Page 142 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Connections
per domain
Displays statistics by domain per transaction.
Note: Statistic available for Web HTTP/HTML protocol scripts only
l
Domain name
Name of the domain or the IP address of the domain if the name is not
found.
l
Count
When the scope is a single iteration, the count displayed is the number of
connections to the server per domain.
When the scope is an average, the count displayed is an average of
connection to the server per domain.
l
Count %
When the scope is a single iteration, the count % represents the percentage
of connections to the server per domain.
When the scope is an average, the count % represents the average
percentage of connections to the server per domain.
l
Hit count
When the scope is a single iteration, the hit count displayed is the number of
files requested from the server.
When the scope is an average, the hit count displayed is the average
number of files requested from the server.
l
Size
When the scope is a single iteration, size displayed is the size of the data
returned from the server per domain.
When the scope is an average, size displayed is the average size of the
data returned from the server per domain .
l
Size %
When the scope is a single iteration, size % represents the percentage of
data returned from the server per domain from the total returned data.
When the scope is an average, size % represents the average percentage
of data returned from the server per domain from the total returned data
l
Trend
Sparkline representation of values over all iterations.
HP LoadRunner (12.00)
Page 143 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
l
DNS time
When the scope is a single iteration, DNS time displayed is the amount of
time it takes the web browser to translate a hostname to its corresponding
IP address.
When the scope is an average, DNS time displayed is the average amount
of time it takes the web browser to translate a hostname to its
corresponding IP address.
HP LoadRunner (12.00)
Page 144 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Connections
per content
type
Displays statistics by content type per transaction.
Note: Statistic available for Web HTTP/HTML protocol scripts only
l
Content type
List of the content type returned from the server, for example, an image, a
JavaScript, a CSS.
l
Count
When the scope is a single iteration, the count is displayed is the number of
connections per content type.
When the scope is an average, the count is displayed is the average number
of connections per content type.
l
Count %
When the scope is a single iteration, the count % represents the percentage
of connections to the server content type.
When the scope is an average, the status displayed is the average
percentage of connections to the server content type from the total number
of connections.
l
Size
When the scope is a single iteration, size displayed is the size of the data
returned from the server for each content type.
When the scope is an average, size displayed is the average size of the
data returned from the server for each content type.
l
Size %
When the scope is a single iteration, size % represents the percentage of
data returned from the server for each content type from the total returned
data.
When the scope is an average, size % represents the average percentage
of data returned from the server for each content type from the total returned
data.
l
Trend
Sparkline representation of values over all iterations.
HP LoadRunner (12.00)
Page 145 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Connections
per HTTP
Status
Displays statistics by HTTP Status per transaction.
Note: Statistic available for Web HTTP/HTML protocol scripts only
l
Status
List of the HTTP status codes returned by the transaction.
l
Count
When the scope is a single iteration, the count displayed is the number of
connections HTTP status code per transaction.
When the scope is an average, the count displayed is the average number
of connections per HTTP status code per transaction.
l
Count %
When the scope is a single iteration, the count is displayed is the
percentage of connections per HTTP status code per transaction.
When the scope is an average, the count is displayed is the average
percentage of connections per HTTP status code per transaction.
l
Trend
Sparkline representation of values over all iterations.
Replay
Statistics
Summary
A list of script statistics and their values after replay.
More
information is
available in:
l
Test Results
For details, see "Test Results Window" on page 482.
l
Replay Log
<Modify RunTime
Settings>
Enables you to access Run-Time Settings for your active script.
<Modify
Content
Check Rules>
VuGen's ContentCheck mechanism enables you to detect all types of errors
sent by the web server.
For details, see "Internet Protocol > ContentCheck Node" on page 351.
VuGen - Troubleshooting and Limitations
This section describes troubleshooting and limitations for the VuGen.
Troubleshooting Snapshots
If you encounter a step without a snapshot, follow these guidelines to determine why it is not
HP LoadRunner (12.00)
Page 146 of 1743
LoadRunner User Guide
VuGen Concepts
available. Note that not all steps are associated with snapshots—only steps with screen operations
or for Web, showing browser window content, have snapshots.
Several protocols allow you to disable the capturing of snapshots during recording using the
Recording options.
If there is no Record snapshot displayed for the selected step, it may be due to one of the following
reasons:
l
The script was recorded with a VuGen version 6.02 or earlier.
l
Snapshots are not generated for certain types of steps.
l
The imported actions do not contain snapshots.
If there is no Replay snapshot displayed for the selected step, it may be due to one of the following
reasons:
l
The script was recorded with VuGen version 6.02 or earlier.
l
The imported actions do not contain snapshots.
l
The Vuser files are stored in a read-only folder, and VuGen could not save the replay snapshots.
l
The step represents navigation to a resource.
Internet Explorer and Windows Server Machines
When using Internet Explorer on Windows server machines such as Windows Server 2008 and
2012, the browser’s enhanced security (ESC) blocks certain actions and issues the following
message: "Content from the Web site listed below is being blocked by the Internet Explorer
Enhanced Security Configuration." This prevents the automatic download of files that are
necessary for your workflow.
Workaround: Add an entry "about:internet" to the Trusted Sites in Internet Explorer.
Memory Issues
If the script is extremely large in size, you may encounter problems opening the script if the memory
on the machine in insufficient. To reduce VuGen memory usage, select Tools > Options and clear
the Enable C language parser check box to disable the C Parser. Note that this will affect some
of the graphic-related features, such as Step Navigation and Thumbnails.
Protocol Advisor - Overview
You use the Protocol Advisor to help you determine an appropriate protocol for recording a Vuser
script. The Protocol Advisor scans your application for elements of different protocols and displays
a list of the detected protocols. These protocols should be used as guidelines and as a starting point
for finding the optimal protocol for your application.
In most cases, the Protocol Advisor suggests more than one protocol, along with combinations of
protocols. For guidelines on how to use the list of suggested protocols, see "How to use the
Protocol Advisor" on the next page.
HP LoadRunner (12.00)
Page 147 of 1743
LoadRunner User Guide
VuGen Concepts
How to use the Protocol Advisor
This task describes a typical workflow for finding the optimal protocol to record your application
using the Protocol Advisor.
1.
Start the Protocol Advisor
In VuGen, select Record > Protocol Advisor > Analyze Application.
If you are analyzing a web application, you will need to specify:
n
Program to analyze
n
URL Address
n
Working Directory
If you are analyzing a Windows application, you will need to specify:
n
Program to analyze
n
Program arguments, if any
n
Working Directory
For details, see "Protocol Advisor Dialog Box" on page 150.
2.
Perform typical business processes
Perform typical business processes in your application. Try to walk through a variety of
business processes to make sure that your results are comprehensive. Click Stop Analyzing
to end the analysis and display the results.
3.
Save the results
Select Record > Protocol Advisor > Save Results or click Save Results from the toolbar at
the top of the report. Enter a name and select the folder.
To display a previous report, select Record > Protocol Advisor > Recent reports. VuGen
will maintain a history of the last sixteen Protocol Advisor reports generated. To clear the
history, select Record > Protocol Advisor > Clear Recent Reports.
4.
Select a protocol and create a new Vuser script
Select one of the protocols using the following order of priority and create a Vuser script using
that protocol:
n
Multi/Combination protocol
n
The highest level application protocol
HP LoadRunner (12.00)
Page 148 of 1743
LoadRunner User Guide
VuGen Concepts
n
5.
The first protocol on the list
Enhance, debug, and verify replay
Enhance and debug your script until you can replay it successfully. If, after enhancing and
debugging the Vuser script, you cannot replay it successfully, proceed to the next step.
6.
If the replay is unsuccessful, select a different protocol and repeat
n
For all non Web-based protocols: Return to the Protocol Advisor Results page and
select the next protocol on the list and repeat previous steps. If there are no more protocols
listed, contact HP Customer Support.
n
For Web-based protocols: The following diagram illustrates several Web-based protocols
arranged according to their application level. The arrows indicate the order in which you
should attempt a new protocol. For example, if the first protocol you used was Oracle Web
Applications 11i and it failed to successfully replay, you would then try the Oracle NCA
protocol.
HP LoadRunner (12.00)
Page 149 of 1743
LoadRunner User Guide
VuGen Concepts
Protocol Advisor Dialog Box
This dialog box enables you to analyze your application to determine the appropriate VuGen
protocols to use for recording.
To access
Important
information
HP LoadRunner (12.00)
Do one of the following:
l
VuGen > Record > Protocol Advisor > Analyze Application
l
VuGen > File > New Script and Solution > Protocol Advisor
l
The options in this dialog box change according to the selection you
make for Application type.
Page 150 of 1743
LoadRunner User Guide
VuGen Concepts
, continued
Relevant tasks
"How to use the Protocol Advisor" on page 148
User interface elements are described below:
UI Element
Description
Application
type
Windows or Web application.
Program
arguments
(Win32
Applications
only)
Specify command line arguments for the executable specified above. For
example, if you specify plus32.exe with the command line options
peter@neptune, it connects the user Peter to the server Neptune when starting
plus32.exe. This option is displayed only for Windows applications.
Program to
analyze
Select the browser, Web application, or Windows application to analyze.
URL
The starting URL address. This option is displayed only for Web applications.
Address
(Internet
Applications
only)
Working
directory
The working directory for your application, if needed.
Protocol Advisor - Troubleshooting and Limitations
This section describes troubleshooting and limitations for the Protocol Advisor.
l
This feature will only detect protocols supported by LoadRunner.
l
Some Web protocols are detected based on the URL. For example, the URL may contain
keywords such as SAP. Therefore, if you use a different URL or a different application with the
same URL, the results may differ.
l
The following protocols are frequently detected but are not always appropriate for use. You
should only use them if there are no other detected protocols.
n
COM/DCOM
n
Java
n
.NET
n
WinSock
n
LDAP
HP LoadRunner (12.00)
Page 151 of 1743
LoadRunner User Guide
VuGen Concepts
If you terminated the Protocol Advisor immediately after the detection process started, the
Protocol Advisor may leave a hanging process of the detected application, causing all
recordings and detection sessions that follow to fail.
l
Workaround: Manually terminate the hanging process.
HP Live Network (HPLN) Integration
HP Live Network (HPLN) provides you with additional software content and information about your
HP Software products. The LoadRunner HPLN Integration feature enables you to download and
upload content that can then be shared by other LoadRunner users.
You can download and upload the following content types to and from HPLN:
Action/Function files with .c, .java, .js, and .cs extensions.
l
Note: For security reasons, .js files must be zipped before uploading to HPLN, and
unzipped after downloading from HPLN.
l
Correlation files with the .cor extension
l
Data Format Extension (DFE) files with the .vucsx extension
l
VuGen add-in files with a .zip extension
For more information on how to use HPLN, use the following table:
How to ...
UI Descriptions
l
"How to Download Content from HP Live Network
(HPLN) to LoadRunner" below
l
"HP Live Network Connection
Dialog Box" on page 157
l
"How to Upload Content from LoadRunner to HP
Live Network (HPLN)" on page 154
l
"Download from HP Live Network
Dialog Box" on page 158
How to Download Content from HP Live Network
(HPLN) to LoadRunner
The following task describes how to download content from HPLN and import it into your
LoadRunner project.
The flow for downloading content to LoadRunner is as follows:
HP LoadRunner (12.00)
Page 152 of 1743
LoadRunner User Guide
VuGen Concepts
1. On the VuGen main Toolbar, click
, and log in to HPLN.
If you are already logged on, you will be automatically directed to the HPLN download page.
Note: The first time you log in to HPLN in a VuGen session may take several minutes
whilst the dynamic content page is created. The subsequent loading of the content page is
much quicker.
For more information on logging in to HPLN, see "HP Live Network Connection Dialog Box" on
page 157.
2. On the Download from HP Live Network screen, select the relevant HPLN Content type,
and on the relevant content, click Download to download the content.
When you click Download, the status Downloading appears, and when the selected file has
been downloaded the status changes to Downloaded.
Note: Downloaded content is saved in the relevant sub-folder of
%programdata%\Hewlett-Packard\LoadRunner\HPLN.
For more information on downloading content, see "Download from HP Live Network
Dialog Box" on page 158.
3. To use the content in LoadRunner, depending on the type of content you downloaded, perform
the following steps:
HP LoadRunner (12.00)
Page 153 of 1743
LoadRunner User Guide
VuGen Concepts
a.
Actions/Functions content
i. If you downloaded a .zip file containing a.js file, you must unzip the .js file before you
can add the file as an extra file.
ii. In Solution Explorer, for the script you are developing, right-click Extra Files and
select Add Files Downloaded from HPLN.
iii. Then in the %programdata%\Hewlett-Packard\LoadRunner\HPLN\function folder,
select the relevant function file, and click Open.
b.
Correlation content
i. On the VuGen main menu, select Record > Recording Options > Correlations Rules, and click Import.
ii. In the %programdata%\Hewlett-Packard\LoadRunner\HPLN\cor folder select the
correlation file, and click Open.
c.
DFE content
i. On the VuGen main menu, select Record > Recording Options > Data Format
Extension - Code Generation.
ii. Select Enable data format extension and click Import.
If you are prompted with a message "This operation will overwrite the current
settings", and you wish to overwrite the current settings, click Yes.
iii. In the %programdata%\Hewlett-Packard\LoadRunner\HPLN\dfe folder, select the
DFE file, and click Open.
How to Upload Content from LoadRunner to HP Live
Network (HPLN)
The following task describes how to upload content from LoadRunner to HPLN.
The flow for uploading content from LoadRunner to HPLN is as follows:
HP LoadRunner (12.00)
Page 154 of 1743
LoadRunner User Guide
VuGen Concepts
1. Export the content you want to upload to a file as follows:
Actions/Functions content
Locate the action or function file in preparation for uploading to HPLN.
Note: If you are uploading a .js file, for security reasons you must zip the .js file and
upload the zip file.
Correlation content
a. On the VuGen main menu, select Record > Recording Options > Correlations - Rules
b. Click Export, select an Application to Export, and then click Export
c. Enter a filename and location, and then click Save.
Note: The file is saved by default in the %programdata%\HewlettPackard\LoadRunner\HPLN\cor folder.
DFE content
a. On the VuGen main menu, select Record > Recording Options > Data Format
Extension - Code Generation
b. Select Enable data format extension, and then click Export.
c. Enter a filename and location, and then click Save.
HP LoadRunner (12.00)
Page 155 of 1743
LoadRunner User Guide
VuGen Concepts
Note: The file is saved by default in the %programdata%\HewlettPackard\LoadRunner\HPLN\dfe folder.
2.
Log in to HPLN
On the VuGen main Toolbar, click
, and log in to HPLN.
Note: The first time you log in to HPLN in a VuGen session may take several minutes
whilst the dynamic content page is created. The subsequent loading of the content page is
much quicker.
Note: If you are already logged in, you will be automatically directed to the HPLN
download page.
3. On the Download from HP Live Network screen, click Upload Content to HPLN
.
4. In the main HPLN screen, Click the Content tab, and click Add Content.
5.
Start the upload procedure
Enter the following information:
a. The name and description for the content.
Note: The name and description content are used when searching the content in the
Download from HP Live Network screen.
b. The supported product versions.
Note: When the system prepares the content list for the Download from HP Live
Network screen, it displays content that is relevant to the version of VuGen you are
using.
c. The version
Enter a version number. A version number is automatically generated the first time you add
content. The version number for content is unique per update.If you in the future update the
specific content, you must enter a different version number.
d. The content type
Select the relevant content type.
HP LoadRunner (12.00)
Page 156 of 1743
LoadRunner User Guide
VuGen Concepts
Note: The content is delivered and selected according to the content type. lr_cr for
correlation content, lr_dfe for DFE content and lr_ff for Action/Function content.
6.
Attach the content
Click Add Content Attachment.
On the Create Content Attachment screen:
a. Enter the name and version, and then click the File attachments tab.
b. Click Choose file, select the content file you want to upload, and then click Finish.
7. After reviewing the summary, click Publish, and on the You are about to Publish screen,
click Submit.
HP Live Network Connection Dialog Box
This dialog box enables you to log in to HP Live Network (HPLN), and gives you access to the
HPLN content files.
HP LoadRunner (12.00)
Page 157 of 1743
LoadRunner User Guide
VuGen Concepts
To
access
Use one of the following:
l
From the main VuGen toolbar, click
.
l
On the main VuGen menu, select Tools > Reset Credentials
Importa If you select Remember my credentials, this HP Live Network Connection dialog
nt
box appears only when you choose to Reset Credentials.
informat
ion
Note: When you access HPLN for the first time in a session, the feature may
take several minutes to populate the Download from HPLN window.
Relevan
t tasks
"How to Download Content from HP Live Network (HPLN) to LoadRunner" on page
152
"How to Upload Content from LoadRunner to HP Live Network (HPLN)" on page 154
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
User Id
Enter your Passport ID.
Password
Enter your Passport ID password.
Proxy Setting
If you access the Internet via a proxy and your proxy settings are not
automatically configured on your machine, enter the following proxy details:
Proxy URL. The URL of your proxy server.
Proxy username. Your proxy user name.
Proxy password. Your proxy password.
<Remember
my
credentials>
When selected, your previous credentials are used to log in to HPLN.
Login
Click to log in to HPLN.
Note: To log in as a different user, on the main VuGen menu, select
Tools > Reset Credentials.
Download from HP Live Network Dialog Box
This dialog box enables you to download content files from HPLN.
HP LoadRunner (12.00)
Page 158 of 1743
LoadRunner User Guide
VuGen Concepts
To
access
Importa
nt
informat
ion
Use one of the following:
l
From the main VuGen toolbar, click
.
l
On the main VuGen menu, select Tools > HPLN
l
If you are not logged on to HPLN, you will be directed to the HP Live Network
Connection dialog box.
l
If you are already logged on to HPLN, the Download from HPLN Dialog box
appears.
Note: When you access HPLN for the first time in a session, the feature may
take several minutes to populate the Download from HPLN window.
Relevan
t tasks
l
The Close button, closes the dialog box, and completes the downloading of
content currently selected for download.
l
You can only use one HPLN session at any time on a server. If you have more
than one VuGen open, you cannot access HPLN from both sessions
simultaneously.
"How to Download Content from HP Live Network (HPLN) to LoadRunner" on page
152
"How to Upload Content from LoadRunner to HP Live Network (HPLN)" on page 154
User interface elements are described below (unlabeled elements are shown in angle brackets):
HP LoadRunner (12.00)
Page 159 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
Refresh Content. Repopulates the HPLN list of content available for
download.
Open Content Folder. Opens the folder where the content was downloaded
to.
Note: Because the filename is not displayed on screen, you can use this
option to see the name of the downloaded content file.
Upload Content to HPLN. Directs you to the HPLN upload site. You can
share content with other LoadRunner users by uploading content to this
location.
Note: You require content contributor permissions to upload content to
HPLN.These can be provided by the community owner.
Pauses all pending downloads.
Cancels all pending downloads.
<HPLN
Content>
Lists the content types that you can download.
<Search>
Enter a string of text, and the displayed list of content automatically updates to
reflect the search text entered. All the text entered when the asset is created
on HPLN is included in the text search.
The content types are: Actions/Functions, Correlation Rules, and DFE files.
<Asset
The following actions/statuses can be displayed for a content item:
Action/Status>
l Download. Click to download a content file. Once the content has been
successfully downloaded, the Re-Download button appears.
The number of content files being downloaded is displayed on the bottom of
the Download from HP Live Network window.
If you to download several content files simultaneously, the first is
downloaded and the other content files are put in a state of Pending. When
the first download is complete, the downloading of the next content file
begins.
HP LoadRunner (12.00)
l
Re-Download. Click to re-download a content file.
l
Paused. Displayed when the download of a content file is paused by
clicking the Pause button. Click Download to re-initiate the download of
the content file.
Page 160 of 1743
LoadRunner User Guide
VuGen Concepts
UI Element
Description
<Progress
Bar>
Displays the progress of the download. If you download several content files,
the number of downloads will be displayed in the format "Downloading item x
of y from HPLN".
Closes the dialog, but completes in the background the downloading of
selected content.
HP LoadRunner (12.00)
Page 161 of 1743
LoadRunner User Guide
Script Workflow
Script Workflow
The Script Workflow section provides detailed information about the workflow to be followed to
develop a Vuser script.
How to Create or Open a Vuser Script
This section describes how to create new Vuser scripts, and open existing Vuser scripts.
Creating Vuser Scripts - Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
first step, creating a Vuser script.
The first step in developing a Vuser script is to create a blank script. For details on how to create a
blank Vuser script, see "How to Create and Open Vuser Scripts" on the next page. The contents
and structure of the blank Vuser script vary slightly based on the protocol of the script. Therefore,
before you create a blank Vuser script, you must know the protocol to use for the script. You can
use the Protocol Advisor to help you to select a protocol. The Protocol Advisor scans your
application for elements of different protocols and displays a list of the protocols that it detects. For
details, see Protocol Advisor. After you create a blank Vuser script, you are ready to perform the
next step in the script creation workflow - recording user actions into the script. For details, see
"Recording a Vuser Script" on page 174.
When you create a Vuser script, VuGen creates a series of configuration files, data files, and
source code files that comprise the Vuser script. These files contain Vuser run-time and setup
information. For details on the files that comprise a Vuser script, see "Script Directory Files" on
page 170.
VuGen enables you to:
l
Create or open a script from a template. For task details, see "How to Create and Open Vuser
Script Templates" on page 173.
l
Open or work with a .zip script. You can unzip or work with a script in .zip format. For task
details, see "How to Work with .zip Files" on page 172.
l
Open a script stored in Application Lifecycle Management. For more information, see "Working
with Application Lifecycle Management" on the next page.
l
Use HP Application Lifecycle Management (ALM) to store and retrieve Vuser scripts, scenarios,
and analysis results. You can store scripts in an ALM project and organize the scripts into
unique groups. For more information, see "Managing Scripts Using ALM - Overview" on page
164.
HP LoadRunner (12.00)
Page 162 of 1743
LoadRunner User Guide
Script Workflow
How to Create and Open Vuser Scripts
This task describes various ways to create a new Vuser script or to open an existing Vuser script.
Create a new Vuser script
1. Open VuGen and select File > New Script and Solution.
2. In the Create a New Script dialog box, select Single Protocol or Multiple Protocols from
the Category list.
3. Select a protocol from the Protocols list.
4. In the Script Name box, enter a name for the script.
Note: Do not name scripts init, run or end, since these names are used internally by
VuGen.
5. Click Create to create the Vuser script.
For user interface details, see "Create a New Script Dialog Box" on page 170.
After you create a new Vuser script, you can record user activity into the script. For details, see
"How to Record a Vuser Script" on page 175.
Create or open a script from a template
For task details, see "How to Create and Open Vuser Script Templates" on page 173.
Open an existing script
To open an existing script that is saved on your local machine or on a network drive, select File >
Open > Script/Solution.
Open or work with a .zip script
You can unzip or work with a script in .zip format. For task details, see "How to Work with .zip
Files" on page 172.
Open a script stored in Application Lifecycle Management
You can store scripts on HP ALM and modify them in VuGen. For more information, see "Working
with Application Lifecycle Management" below.
Working with Application Lifecycle Management
The Working with Application Lifecycle Management section describes who to manage your
Vuser scripts by integrating with Application Life Cycle Management.
HP LoadRunner (12.00)
Page 163 of 1743
LoadRunner User Guide
Script Workflow
Managing Scripts Using ALM - Overview
VuGen works together with HP Application Lifecycle Management (ALM). ALM provides efficient
functionality for storing and retrieving Vuser scripts, scenarios, and analysis results. You can store
scripts in an ALM project and organize the scripts into unique groups.
In order for VuGen to access an ALM project, you must connect VuGen to the Web server on which
the ALM project is located. You can connect to either a local or remote Web server.
For more information on working with ALM, see the HP Application Lifecycle Management User
Guide.
ALM Version Control - Overview
VuGen supports version control features in Vuser scripts saved in ALM projects that use version
control.
The version control features change the process of opening and saving a script. Scripts with
version control are either in a state of checked-in or checked-out. When you are working with a
script in a checked-out state, any changes you make will not be saved on the ALM server until you
check in the script. If you save the script from within VuGen, a temporary file is saved on your
machine that protects your changes in case your computer crashes.
If you are working with a script in a checked-in state, the script is read-only and you cannot make
any changes until you check out the script.
If a particular script is being saved to ALM for the first time, and the project uses version control, the
script automatically starts in a checked-out state.
How to Work with Scripts in ALM Projects
The following steps describe the workflow of how to work with Vuser scripts that are saved in an
ALM project.
Note: To work with scripts in ALM projects with version control, see "How to Work with
Version Controlled Scripts in ALM Projects" on the next page.
1.
Connect to ALM
Open a connection to the ALM server and project that contains the script. For task details, see
"How to Connect to ALM" on the next page.
2.
Open the script
Select File > Open > Script/Solution. In the Open VuGen Script or Solution dialog box,
select the script to open and then click Open.
3.
Save the script
HP LoadRunner (12.00)
Page 164 of 1743
LoadRunner User Guide
Script Workflow
Select File > Save Script. If the script is in a project that uses version control and is not
checked out, the script is saved as a temporary file on your local machine.
How to Connect to ALM
To store and retrieve scripts from ALM, you need to connect to an ALM project. You can connect or
disconnect from an ALM project at any time during the testing process.
You can connect to one version of HP ALM from VuGen and a different version from your browser.
For more information, see the Important Information section in "HP ALM Connection Dialog Box
[VuGen]" on page 167.
Connect to a project in ALM
1. Determine the type of authentication required for the ALM server: User name/password or
CAC (Common Access Card). For CAC mode, enable CAC authentication in VuGen's
General options. For details, see "General Options" on page 95.
2. Select ALM > ALM Connection. The HP ALM Connection dialog box opens.
3. In the Step 1: Connect to server section, enter a user name and password (not relevant for
CAC authentication) and click Connect. VuGen connects to the ALM server.
To disconnect from ALM, click Disconnect.
4. In the Step 2: Login to project section,enter the domain and project details, and then click
Login. VuGen logs in to the specified project.
To log out of the project, click Logout.
5. Click Close to close the HP ALM Connection dialog box.
How to Work with Version Controlled Scripts in ALM
Projects
The following steps describe the workflow of how to work with scripts saved in ALM projects that
use version control.
Note: This procedure is relevant only for scripts in ALM projects that support version control
and have the Performance Center addition installed. If these two conditions are not met, see
"How to Work with Scripts in ALM Projects" on the previous page.
1.
Connect to ALM
Open a connection to the ALM server and project that contains the script. For task details, see
"How to Connect to ALM" above.
HP LoadRunner (12.00)
Page 165 of 1743
LoadRunner User Guide
Script Workflow
2.
Open the script
Select File > Open > Script/Solution. In the Open VuGen Script or Solution dialog box,
select the script to open and then click Open.
3.
Check in/out the script
If the ALM project has version control, each script is always defined as being either checked-in
or checked-out. For more details, see "ALM Version Control - Overview" on page 164. To
check in and check out scripts, select ALM > Check In/Check Out.
Note: If the ALM project has version control, the file is locked when it is checked out.
If the ALM project is not version controlled, the file is not locked when checked out of the
project.
4.
Cancel a check out (optional)
If you checked out a script and do not want to save the changes, you can return the status of
the script to checked-in without saving by selecting ALM > Undo Check Out.
5.
Save the script
Select File > Save Script. If the script is in a project that uses version control and is not
checked out, the script is saved as a temporary file on your local machine.
How to Save VuGen Vuser Scripts to ALM Projects
The following steps describe how to save a Vuser script to an ALM project.
1.
Open or create the Vuser script
Create or open the desired script in VuGen.
2.
Connect to ALM
Open a connection to the ALM server and project in which you want to store the script. For task
details, see "How to Connect to ALM" on the previous page.
3.
Save the script to ALM
a. Select File > Save Script as. The Save Script As dialog box opens.
b. Click ALM Test Plan, and then specify the name and location for the script.
c. Click Save. After a short time, the Working Mode dialog box opens.
HP LoadRunner (12.00)
Page 166 of 1743
LoadRunner User Guide
Script Workflow
d. Select one of the following options:
Runtime Mode. Copies only the files needed to replay the script. This option does not
copy recording snapshot files and other unnecessary files. This results in a shorter transfer
time.
All Files Mode. Copies all of the files associated with this script. This results in a longer
transfer time.
How to Compare Previous Versions of a Script
If your Vuser script is saved in an ALM project that uses version control, you can compare previous
versions of the script. The following steps describe how to do this.
1.
Connect to ALM
Open a connection to the ALM server and project that contains the script that you want to view
or modify. For task details, see "How to Connect to ALM" on page 165.
2.
Open the script
Select File > Open > Script/Solution. In the Open VuGen Script or Solution dialog box,
select the script to open and then click Open.
3.
Compare previous versions of the script
a. Select ALM > Version History. The Version History dialog box opens.
b. Select two previous versions of the script and then click Compare Versions. WDiff opens
and displays the two versions of the script.
HP ALM Connection Dialog Box [VuGen]
This dialog box enables you to connect to an HP ALM project from within VuGen.
HP LoadRunner (12.00)
Page 167 of 1743
LoadRunner User Guide
Script Workflow
To access
ALM > ALM Connection
Important
information
l
You can connect to one version of HP ALM from VuGen and a different version
of HP ALM from your browser.
l
You can connect to different versions of HP ALM only if one of the versions is
HP ALM 11.00 or higher.
Note: Before you connect to results stored on ALM through the this dialog box,
it is recommended that you first connect to the HP ALM server through your
browser.This automatically downloads the ALM client files to your computer.
You can configure more advanced settings, such as a proxy setting, by using
the Webgate Customization tool (webgatecustomization.exe) and then sign
into ALM using the HP ALM Connection Dialog Box. The Webgate
Customization tool can be found on your ALM server at the following
address: http://<ALM Server>/qcbin/Apps/.
l
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 168 of 1743
LoadRunner User Guide
Script Workflow
Step 1:
Connect to
Server
l
Server URL. The URL of the server on which ALM is installed.
l
User name. Your ALM project user name (not relevant for CAC
authentication).
l
Password. Your ALM project password (not relevant for CAC
authentication).
l
l
Step 2: Login
to Project
. Disconnects from the current ALM server.
l
Domain. The domain that contains the ALM project. Only those domains
containing projects to which you have permission to connect to are
displayed.
l
Project. Enter the ALM project name or select a project from the list. The
list includes only those projects to which you have permission to connect.
l
l
Restore
connection on
startup
. Connects to the server specified in the Server URL box.
. Logs into the ALM project.
. Logs out of the current ALM project.
Automatically reconnect to the ALM server the next time you start VuGen,
using the same credentials.
Multiple Protocol Scripts
When you record a single protocol, VuGen records only the specified protocol. When you record in
multi-protocol mode, VuGen records the actions in several protocols. Multi-protocol scripts are
supported for the following protocols: COM, FTP, IMAP, Oracle NCA, POP3, Window Sockets
(raw), SMTP, and Web.
Another variation between Vuser types is multiple-action support. Most protocols support more than
one action section. Currently, the following protocols support multi-actions: Oracle NCA, Web,
RTE, General (C Vusers), WAP, and VoiceXML.
For most Vuser types, you create a new Vuser script each time you record—you cannot record into
an existing script. However, when recording a Java, Web, WAP, Oracle NCA, or RTE Vuser script,
you can also record within an existing script. Since VuGen supports a large variety of protocols, some of the recording steps that follow apply
only to specific protocols.
For all Java language Vusers see "Java Protocols" on page 650.
HP LoadRunner (12.00)
Page 169 of 1743
LoadRunner User Guide
Script Workflow
Script Directory Files
While you create a Vuser script, VuGen creates a series of configuration files, data files, and
source code files that comprise the Vuser script. These files contain Vuser run-time and setup
information. VuGen saves these files together with the script, in the script folder. To access the
files in the script folder, right click on the script name in the Solution Explorer and select Open
Script Folder.
For details on the files that are included in the script folder, see "Files Generated During Recording"
on page 271.
Create a New Script Dialog Box
This dialog box enables you to create a new Vuser script.
To access
Relevant tasks
HP LoadRunner (12.00)
Do one of the following:
l
VuGen > File > New Script and Solution
l
VuGen > File > Add > New Script
l
Click the
l
"How to Create or Open a Vuser Script" on page 162
l
"How to Record a Vuser Script" on page 175
button on the VuGen toolbar.
Page 170 of 1743
LoadRunner User Guide
Script Workflow
User interface elements are described below:
UI
Element
Description
Category
The category identifies the type of script you would like to create:
Multiple Protocols. Create a script using multiple protocols.
Single Protocol. Create a script using the selected protocol. Single Protocol is the
default category.
Protocol
The Protocol list displays protocols based on the category you select.
Category
Protocol List displays...
Multiple
Protocols
A list of protocols with a check box to the left of each protocol.
Single Protocol
A list of protocols.
Select a check box to include the protocol in the Vuser script.
You can select one protocol.
Mobile
Protocols that record mobile applications.
Popular
The most popular protocols in use in the LoadRunner user
community.
Recent
The protocols you have most recently used.
Filter
Enables you to filter the Protocol list by entering text. For example, if you type
"Java" into the Filter box, the Protocol list will display only those protocols that
include the word Java.
Script
Name
Enables you to specify the name of your script.
If you create a single protocol script,the default name is <protocol name>x where x
represents the numerical sequence of the script created. For example, the name of
the third script created for the Web- HTTP/HTML protocol would be WebHttpHtml3.
If you create a multi-protocol script, the default name is <protocol name_multi>x
where protocol name is the first protocol you selected from the list and x represents
the numerical sequence of the script created.
Location
Enables you specify the file location of your script. You can use the browse button to
navigate to a location on your file system.
Tools > General > Projects and Solutions enables you to specify a default
location.
Solution
Name
This option is displayed only when a solution is not open in the Solution Explorer.
You can specify a name for the solution. If you leave it blank, the default name is
'Untitled'.
HP LoadRunner (12.00)
Page 171 of 1743
LoadRunner User Guide
Script Workflow
, continued
Create a
folder for
this
solution
Enables you to create a folder for your solution.
Solution
Target
Displays the file path of the solution.
Protocol
Advisor
Enables you to access the Protocol Advisor dialog box. For details, see "Protocol
Advisor Dialog Box" on page 150
Displays the protocols in list view.
Displays the protocols in icon view.
How to Work with .zip Files
VuGen allows you to work with .zip file in several ways. The advantages of working with .zip files is
that you conserve disk space, and it allows your scripts to be portable. Instead of copying many
files from machine to machine, you need to copy only one .zip file.
Import from a Zip File
To open a script stored in a .zip file, select File > Manage Zip Files > Import from Zip File. After
you select a .zip file, VuGen prompts you for a location in which to store the unzipped files.
Export to a Zip File
To save the entire script folder as a .zip file, select File > Manage Zip Files > Export to Zip File.
You can indicate whether to save all the files or only the runtime files.
Zip and Email
To create a .zip file and send it as an email attachment, select File > Manage Zip Files > Zip and
Email. When you click OK in the Zip and Email dialog box, VuGen compresses the file according
to your settings and opens an email compose form with the .zip file as an attachment.
Edit Script in Zip File
To work from a .zip file, while not expanding or saving the script files, select File > Manage Zip
Files > Edit Script in Zip File. When you modify the script and save it, the changes are stored
directly in the .zip file.
Vuser Script Templates
The User-Defined Template enables you to save a script with a specific configuration as a
template. You can then use this template as a basis for creating future scripts.
The template supports the following files and data:
HP LoadRunner (12.00)
Page 172 of 1743
LoadRunner User Guide
Script Workflow
l
Run-time settings
l
Parameters
l
Extra files
l
Actions
l
Snapshots
Recording options and General options are not supported as they are generic settings and are not
relevant to a specific script.
Notes and Limitations
l
Once you have configured a script for a specific protocol and then save the script as a template,
further scripts based on that template will only work with that same protocol.
l
Once you have created your template, you cannot edit it directly in VuGen. To make any
changes, you open the template and save it again with another name or overwrite the existing
template.
l
If you regenerate an original script from a template, you will lose all of your manual changes.
How to Create and Open Vuser Script Templates
This task describes how to create, create from, and rename Vuser script templates.
Create a Vuser Script Template
1. Open a script in VuGen.
2. Select File > User-Defined Templates > Export to Template.
3. Enter a name and location for the template.
4. Click OK to create the template.
Create a Vuser Script From a Template
Select File > New Script and Solution > VuGen > User Templates and select the template file.
Rename a Vuser Script Template
1. Select File > User-Defined Templates > Manage from Explorer
2. In the Explorer dialog box:
HP LoadRunner (12.00)
Page 173 of 1743
LoadRunner User Guide
Script Workflow
a. Rename the content file (.zip)
b. Rename the description file (.xpt)
3. Using a text editor, modify the following tags in the .xpt file:
a. Name tag: <Name>NewName </Name>
b. File tag src property: <File name="template_temp.zip" src="NewName.zip"
binary="True" />
Notes and Limitations
l
Once you have configured a script for a specific protocol and then saved the script as a
template, further scripts based on that template will only work with that same protocol.
l
Once you have created your template, you cannot edit it directly in VuGen. To make any
changes, you open the template and save it again with another name or overwrite the existing
template.
Recording a Vuser Script
The Recording a Vuser Script section describes script sections, script recording, working with
templates, and other recording tools.
Recording - Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
second step, recording a Vuser script.
After you create an empty Vuser script, you are ready to use VuGen to record typical user-actions
into the script. While you record the script, VuGen's floating Recording toolbar gives you access to
the main recording functionality, such as pausing and stopping the recording, and inserting
transactions and rendezvous points. For details on how to record a Vuser script, see "How to
Record a Vuser Script" on the next page.
Each Vuser script contains at least three sections: vuser_init, one or more action sections, and
vuser_end. When you run multiple iterations of a Vuser script, only the Actions sections of the
script are repeated—the vuser_init and vuser_end sections are not repeated. Before you record,
and during recording, you can select the section of the script into which VuGen will insert the
recorded functions. For details on the script sections, see "Vuser Script Sections" on page 255.
Before you start recording, make sure that the recording options are set correctly for the script. For
more information about the recording options, see "Recording Options" on page 176.
HP LoadRunner (12.00)
Page 174 of 1743
LoadRunner User Guide
Script Workflow
When you have finished recording the user actions, VuGen generates the Vuser script and performs
various other post-recording operations. You can replay the script to make sure that it functions
correctly. For details, see "Replaying a Vuser Script" on page 316.
To resolve situations where you cannot install VuGen on the client machine, VuGen allows you to
record scripts using a LoadRunner proxy. Proxy recording may be required with certain Linux
machines, Mac OS machines, and mobile devices. For details, see "Recording via a ProxyOverview" on page 260
After you have successfully recorded a Vuser script, you can replay the script. For details, see
"Replaying - Overview" on page 316.
How to Record a Vuser Script
This task describes how to record a Vuser script.
1. Create a new script or open an existing script
For details, see "How to Create or Open a Vuser Script" on page 162.
2. Modify the Windows DEP settings - recommended
a. Open Start > Control Panel > System.
b. In the Advanced tab, click Performance settings.
c. In the Performance Options Data Execution Prevention tab, select the first option, DEP for
essential services only.
If you cannot change this option, click Add. Browse to the client program, for example
IEXPLORE.EXE.
d. If neither of these options are possible, try to disable DEP completely.
i. Open a command prompt.
ii. Run the following command: bcdedit.exe /set {current} nx AlwaysOff
iii. Reboot the machine
iv. Verify that the settings took effect by running the following at the command line:
BCDEdit /enum
v. Verify that the last line shows nx AlwaysOff.
3. Close all instances of the browser - for Web HTTP/HTML recording of Chrome or Firefox
This applies only when recording in Chrome or Firefox. You should also verify that there are no
Chrome or Firefox processes running in the Task Manager.
4.
Configure the recording options - optional
HP LoadRunner (12.00)
Page 175 of 1743
LoadRunner User Guide
Script Workflow
The recording options contain options that affect the way that a Vuser script is generated after
recording or regenerating the script. For concept and user interface details, see "Recording
Options" below.
Tip: If the business process you want to record contains asynchronous push
communication, select Recording Options > HTTP > Advanced Node and check the
Use streaming mode when recording with the LoadRunner Proxy option.
If you are not able to successfully record a script with VuGen, select Recording Options
> HTTP > Advanced Node and check the Use LR Proxy to record a local application
option. Then rerecord your business process.
5.
Start the recording session
To start recording, click the Record button on the VuGen toolbar, make the relevant
selections in the Start Recording dialog box, and click Start Recording. VuGen's floating
toolbar appears, VuGen opens your application and begins recording your actions.
- For user interface details, see "Start Recording Dialog Box" on page 266.
- For details on the script sections into which you can record, see "Vuser Script Sections" on
page 255.
6.
Perform a business processes on your application
Perform the desired business processes that you wish to record. The floating toolbar allows
you to insert transactions, rendezvous points, and comments. You can also use the floating
toolbar to specify into which section of the script to record. For user interface details, see
"Floating Recording Toolbar" on page 269.
Click the Stop button
on the floating toolbar when you are finished recording.
Note: If you want to cancel the recording session, click the Cancel Recording button
on the floating toolbar. When you cancel a recording, VuGen removes all the code that
was added to the script during the current recording session, thereby restoring the script to
its status before the current recording session. For details on how to enable or disable the
Cancel Recording button, see "Scripting Options" on page 103.
Recording Options
The Recording Options sections describes the many different options that affect your Vuser
script during the recording and generation stages of creating a script.
HP LoadRunner (12.00)
Page 176 of 1743
LoadRunner User Guide
Script Workflow
Citrix > Configuration Node
Enables you to set the window properties and encryption settings for the Citrix client during the
recording session.
To access
VuGen > Record > Recording Options > Citrix > Configuration
Important
information
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility
Table" on page 246.
User interface elements are described below:
UI
Element
Description
Encryption The level of encryption for the ICA connection: Basic, 128 bit for login only, 40
Level
bit, 56 bit, 128 bit, or Use Server Default to use the machine's default.
Window
Size
The size of the client window.
Default value: 800 x 600.
Citrix > Code Generation
Enables you to configure the way VuGen captures information during recording.
To access
VuGen > Record > Recording Options > Citrix > Code Generation
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
l
Text synchronization steps that you add manually during the recording are not
affected by the above settings—they appear in the script even if you disable
the above options.
l
The synchronization options also work for regenerating a script. For example, if
you originally recorded a script with Add text synchronization calls disabled,
you can regenerate after to recording to include text synchronization.
User interface elements are described below:
HP LoadRunner (12.00)
Page 177 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Use Citrix Agent input
in Code Generation
Use the Citrix Agent input to generate a more descriptive script with
additional synchronization functions.
Default value: enabled.
l
Automatically generate text synchronization calls. Adds text
synchronization Sync on Text steps before each mouse click.
Default value: disabled.
Citrix > Login Node
Enables you to you set the connection and login information for the recording session.
To access
VuGen > Record > Recording Options > Citrix > Login
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
l
If you do not provide login information, you are prompted for the information
when the client locates the specified server.
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 178 of 1743
LoadRunner User Guide
Script Workflow
Connection
l
Network Protocol. The preferred protocols are TCP/IP and TCP/IP+HTTP.
Most Citrix Servers support TCP/IP, however Citrix Clients starting with 11.2
do not. Certain servers, however, are configured by the administrators to allow
only TCP/IP with specific HTTP headers. If you encounter a communication
problem, select the TCP/IP+HTTP option.
l
Server. The Citrix server name. To add a new server to the list, click Add, and
enter the server name (and its port for TCP/IP + HTTP).
Note: Multiple servers apply only when you specify a Published
Application. If you are connecting to the desktop without a specific
application, then list only one server.
l
Published Application. The name of the Published Application as it is
recognized on Citrix server. The drop-down menu contains a list of the
available applications. If you do not specify a published application, VuGen
uses the server's desktop. If you added or renamed a published application,
close the Recording options and reopen them to view the new list. Additionally,
you can also enter the name of a published application manually if you know it
exists (useful in cases where the drop-down list is inaccurate).
To change the name of the published application on the Citrix client, you must
make the change on the Citrix Server machine. Select Manage Console >
Application and create a new application or rename an existing one.
Note: If you do not specify a published application, Citrix load balancing
will not work. To use load balancing when accessing the server's desktop,
register the desktop as a published application on the server machine, and
select this name from the Published Application drop-down list.
Define
connection
parameters
Allows you to manually define the logon and connection details.
Logon
Specify the User Name, Password, and Domain of the citrix user. Optionally,
Information you can also specify the Client Name by which the MetaFrame server identifies
the client.
Use ICA
file for
connection
parameters
Specify an ICA file with the log configuration information.
Citrix > Recorder Node
Enables you to specify how to generate window names where the window titles change during
recording. You can also specify whether to save snapshots of the screens together with the script
HP LoadRunner (12.00)
Page 179 of 1743
LoadRunner User Guide
Script Workflow
files and whether to generate text synchronization functions.
To access
VuGen > Record > Recording Options > Citrix > Recorder
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Element
Description
Save
Saves a snapshot of the Citrix client window for each script step, when relevant.
snapshots We recommend that you enable this option to provide you with a better
understanding of the recorded actions. Saving snapshots, however, uses more disk
space and slows down the recording session.
Window
name
In some applications, the active window name changes while you are recording. If
you try to replay the script as is, the Vuser uses the original window name and the
replay may fail. You can specify a naming convention for the windows in which
VuGen uses a common prefix or common suffix to identify the windows as follows:
l
Use new window name as is. Set the window name as it appears in the
window title. (default)
l
Use common prefix for new window names. Use the common string from
the beginning of the window titles as a window name.
l
Use common suffix for new window names. Use the common string from
the end of the window titles as a name.
Alternatively, you can modify the window names in the actual script after recording.
In the Script view, locate the window name, and replace the beginning or end of the
window name with the "*" wildcard notation.
Example: ctrx_sync_on_window ("My Application*", ACTIVATE, ...CTRX_LAST);
COM/DCOM > Filter Node
Enables you to define which COM/DCOM objects to record.
To access
Use one of the following:
l
VuGen > Record > Recording Options > COM/DCOM > Filter
l
VuGen > Replay > Recording Options > COM/DCOM > Filter
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 180 of 1743
LoadRunner User Guide
Script Workflow
DCOM
Profile
Specify one of the following filter types:
l
Default Filter. The filter to be used as the default when recording a COM
Vuser script.
l
New Filter. A clean filter based on the default environment settings. Note that
you must specify a name for this filter before you can record with its settings.
You can also save the current settings and delete a filter using the Save As and
Delete buttons.
DCOM
Listener
Settings
List
Displays a tree hierarchy of type libraries. You can expand the tree to show all of
the available classes in the type library. You can expand the class tree to show all
of the interfaces supported by that class.
To exclude a type library, clear the check box next to the library name. This
excludes all of its classes in that type library. By expanding the tree, you can
exclude individual classes or interfaces by clearing the check box next to the
item.
An interface can be implemented differently by various classes. When you
exclude an interface that is implemented by other classes that have not been
excluded, a dialog box opens asking you if you also want to exclude the interface
in all classes that implement it this interface.
Note that when you clear the check box adjacent to an interface, it is equivalent
to selecting it in the Excluded Interfaces dialog box.
l
Environment. The environments to record: ADO objects, RDS Objects, and
Remote Objects. Clear the objects you do not want to record.
l
Type Libraries. A type library .tlb or .dll file, that represents the COM object
to record. All COM objects have a type library that represents them. You can
select a type library from the Registry, Microsoft Transaction Server, or file
system.
Type Libraries. In the lower section of the dialog box, VuGen displays the
following information for each type library.
l
TypLib. The name of the type library (tlb file).
l
Path. The path of the type library.
l
Guid. The Global Unique Identifier of the type library.
HP LoadRunner (12.00)
Page 181 of 1743
LoadRunner User Guide
Script Workflow
Adds another COM type library.
l
Browse Registry. Displays a list of type libraries found in the registry of the
local computer. Select the check box next to the desired library or libraries and
click OK.
l
Browse file system. Allows you to select type libraries from your local file
system.
l
Browse MTS. add a component from a Microsoft Transaction Server. The
MTS Components dialog box prompts you to enter the name of the MTS
server.
Type the name of the MTS server and click Connect. Remember that to record
MTS components you need an MTS client installed on your machine.
Select one or more packages of MTS components from the list of available
packages and click Add. Once the package appears in the list of Type Libraries,
you can select specific components from the package.
Removes a COM type library.
Excludes interfaces in the filter through the Excluded Interfaces dialog box.
In this dialog box, the checked interface listings are the ones that are excluded.
You can also add interfaces that are not listed. Click Add Interface... in the
Excluded Interfaces dialog box and enter the GUID number (interface ID) and
name of the interface. You can copy the GUID from the interfaces.h file created
by VuGen and listed in the selection tree in the left-hand column of the VuGen
screen. Use the Add Interface... feature to exclude interfaces that are called
needlessly by the script, but are not listed anywhere in the filter.
An interface can be implemented differently by various classes. When you
exclude an interface that is implemented by other classes that have not been
excluded, VuGen displays the a warning. If you check Don't ask me again and
close the dialog box, then the status of all instances of the interface in all other
classes will be changed automatically for this filter, whenever you change the
status of the interface in one object. Click Yes to all to change the status of all
instances of this interface for all other classes, click No to all to leave the status
of all other instances unchanged. Click Next Instance to view the next class that
uses this interface.
COM/DCOM > Options Node
Enables you to set additional options for your COM recording session, relating to the handling of
objects, generation of logs, and VARIANT definitions.
The DCOM scripting options apply to all programming languages. These settings let you configure
the scripting options for DCOM methods and interface handling.
To access
VuGen > Record > Recording Options > COM/DCOM > Options
User interface elements are described below:
HP LoadRunner (12.00)
Page 182 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
ADO Recordset filtering
Condense multiple recordset operations into a single-line fetch
statement (enabled by default).
Declare Temporary
VARIANTs as Globals
Define temporary VARIANT types as Globals, not as local
variables (enabled by default).
Fill array in separate
scopes
Fill in each array in a separate scope (enabled by default).
Fill structure in separate
scopes
Fill in each structure in a separate scope (enabled by default).
Generate COM exceptions
Generate COM functions and methods that raised exceptions
during recording (disabled by default).
Generate COM statistics
Generate recording time performance statistics and summary
information (disabled by default).
Limit size of SafeArray log
Limit the number of elements printed in the safearray log per
COM call, to 16 (enabled by default).
Release COM Objects
Record the releasing of COM objects when they are no longer in
use (enabled by default).
Save Recordset content
Stores Recordset content as grids, to allow viewing of recordset
in VuGen (enabled by default).
Trap binded moniker
objects
Trap all of the bound moniker objects (disabled by default).
HP LoadRunner (12.00)
Page 183 of 1743
LoadRunner User Guide
Script Workflow
Correlations > Configuration
This pane enables you to configure settings for the Correlation tab.
UI example
To access
VuGen > Recording Options > Correlations > Configuration
Important
information
l
l
l
"Correlation Tab [Design Studio] Overview" on page 275
"Correlations > Rules" on page 186
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
HP LoadRunner (12.00)
Page 184 of 1743
LoadRunner User Guide
Script Workflow
Relevant
tasks
"How to Correlate Scripts Using Design Studio" on page 280
User interface elements are described below:
UI Element
Description
Scan for correlations applying:
Rules Scan
Apply correlation rules when performing correlation scan.
For details, see "Correlations > Rules" on the next page.
Automatically correlate
values found
Design Studio will automatically correlate dynamic values found
using the rules scan.
Record Scan
Scan for correlations with the record based engine.
Replay Scan
Scan for correlations with the replay based engine.
Record and Replay scan configuration
API used for
correlations
Select the API function to be used for correlation:
Boundary based: web_reg_save_param_ex
Regular Expression: web_reg_save_param_regexp
Note: If you change the API function, the changes will only take
effect after a new scan.
Exclude strings
Enables you to enter strings that should be ignored by the record and
replay scan.
For details, see "How to Exclude Strings from the Correlation Scan"
on page 308
Ignore values shorter
than [ ]
Enables you to define how short a dynamic value can be before it is
ignored by the record or replay scan.
Default length is 4 characters.
Ignore values longer
than [ ]
Enables you to define how long a dynamic value can be before it is
ignored by the record or replay scan.
Default length is 400 characters.
Warm me if the
dynamic string size is
greater than 10 KB
Issues a warning if you try to correlate a string whose size is 10 KB
or larger.
Ignore case when
searching for
correlation values
Disable case sensitivity during correlation scan.
HP LoadRunner (12.00)
Page 185 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Record scan configuration
Heuristic level
Enables you to set the filter level that controls the amount of
correlation results that are returned. The higher the filter level, the
shorter the scan will take to run.
High. Design Studio performs a detailed scan returning a highly
refined result set.
Medium. Design Studio performs a less detailed scan returning
more results. This is the default setting.
Low. Design Studio performs a more detailed scan returning the
most results. This setting may produce many unwanted results.
Replay scan configuration
Scan for differences
between snapshots
using
Select a comparison method:
l
HTML Comparison. Display the differences in HTML code only.
l
Text Comparison. Display all text, HTML, and binary
differences.
Correlations > Rules
This dialog box enables you to manage correlation rules that automatically correlate dynamic
values during code generation. You can:
l
Add a new application
l
Add a new rule
l
Delete a rule
l
Export rules
l
Import rules
l
Test a rule
HP LoadRunner (12.00)
Page 186 of 1743
LoadRunner User Guide
Script Workflow
To access
Do one of the following:
l
VuGen > Record > Recording Options > Correlations >
Rules
l
Important information
Studio > Correlations > Rules
"Correlation Overview" on page 274
"Correlation Tab [Design Studio] Overview" on page 275
Relevant tasks
"How to Correlate Scripts Using Design Studio" on page 280
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Application
List >
A list of applications and their rules.
l
Select the check box adjacent to the application to activate it during
recording.
l
Expand the application tree to select the check box adjacent to the rules to
activate them during recording.
Add a new application to <Application List>.
Enter a new rule for the selected application in Correlation Rules.
For details, see "New Rule Pane" below.
Delete the selected application or rule from the list.
Import a file containing correlation rule definitions.
Export a file containing a correlation rule definition.
Test a correlation rule.
For details, see "Token Substitution Testpad Dialog Box" on page 189.
New Rule Pane
Enables you to define a new custom rule.
To access
VuGen > Record > Recording Options > Correlation > Rules > New Rule
Important
This pane is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see the "Protocol Compatibility Table" on page 246.
User interface elements are described below:
HP LoadRunner (12.00)
Page 187 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Opens the "Advanced Correlation Properties Dialog Box" on the next page.
Action
Specify the type of action for the rule from the following options:
l
Search for Parameters in all of the Body Text. Searches the entire
body—not just links, form actions or cookies. It searches the text for a match
using the borders that you specify.
l
Search for parameters inlinks and form actions. Searches within links
and forms' actions for the text to parameterize. This method is for application
servers where you know the context rules. You define a left boundary, a right
boundary, an alternate right boundary, and an instance of the left boundary
within the current link.
l
Search for Parameters from cookie headers. Similar to the previous rule,
except that the value is extracted from cookie text (exactly as it appears in
the recording log) instead of from a link or form action.
l
Parameterize form field value. Saves the named form field value to a
parameter. It creates a parameter and places it in the script before the form's
action step. For this option, you need to specify the field name.
l
Text to enter a web_reg_add_cookie function by method inserts a web_
reg_add_cookie function if it detects a certain string in the buffer. It only
adds the function for those cookies with the specified prefix. For this option,
you need to specify the search text and the cookie prefix.
Scan Type
Specify the scan type either regular expression or boundary based.
RegExp
String
Specify the regular expression. This element only applies to a regular expression
scan type.
Left
boundary
The left-most boundary where the rule will apply. This element only applies to
boundary based scan type.
Match Case
Matches the case when looking for boundaries.
Parameter
prefix
Uses a prefix in all automatically generated parameters based on this rule.
Prefixes prevent you from overwriting existing user parameters. In addition,
prefixes allow you to recognize the parameter in your script. For example, in
Siebel Web, one of the built-in rules searches for the Siebel_row_id prefix.
Right
boundary
The right-most boundary where the rule will apply. Use the drop-down menu to
define this boundary as either the end of a string, a newline character, or a userdefined text. The element only applies to boundary based scan type.
HP LoadRunner (12.00)
Page 188 of 1743
LoadRunner User Guide
Script Workflow
Use '#' for
any digit
Replaces all digits with a hash sign. The hash signs serve as wildcard, allowing
you to find text strings with any digit.
Example: If you enable this option and specify HP### as the left boundary,
HP193 and HP284 will be valid matches.
This element only applies to boundary based scan type.
Advanced Correlation Properties Dialog Box
Enables you to set the advanced options for correlation rules.
To access
VuGen > Record > Recording Options > Correlation > Rules > New Rule >
Advanced
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see the "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Alternate right
boundary
Alternative criteria for the right boundary, if the previously specified
boundary is not found. Select one of the following options: User-defined
Text, Newline Character, End Of Page.
Always create
new parameter
Creates a new parameter for this rule even if the value replaced by the
parameter has not changed from the previous instance.
Left boundary
instance
The number of occurrences of the left boundary in order for it to be
considered a match.
Length
The length of the string, starting with the offset, to save to the parameter. If
this is not specified, the parameter continues until the end of the found
value.
Offset
The offset of the string within the found value.
Replace with
parameter only
for exact matches
Replaces a value with a parameter only when the text exactly matches the
found value.
Reverse search
Performs a backwards search.
Token Substitution Testpad Dialog Box
Enables you to test correlation rules before applying them.
To access
VuGen > Record > Recording Options > Correlations > Rules > Test
HP LoadRunner (12.00)
Page 189 of 1743
LoadRunner User Guide
Script Workflow
User interface elements are described below:
UI Element
Description
Runs the test.
Applied rules
A list of the rules that were applied during the test.
Source string for substitution
Enter the source string for substitution.
Substitution Result
The results of the test.
Database > Database Node
Enables you to set the recording options for database protocols.
To access
VuGen > Record > Recording Options > Database > Database
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Opens the "Database > Advanced Recording Options Dialog Box" below.
Automatic
transactions
Marks every lrd_exec and lrd_fetch function as a transaction. When these
options are enabled, VuGen inserts lr_start_transaction and lr_end_
transaction functions around every lrd_exec or lrd_fetch function. Default
value: Disabled.
Script
options
Generates comments into recorded scripts, describing the lrd_stmt option
values. In addition, you can specify the maximum length of a line in the script.
Default value: 80 characters.
Think time
VuGen automatically records the operator's think time. You can set a threshold
level, below which the recorded think time will be ignored. If the recorded think
time exceeds the threshold level, VuGen places an lr_think_time statement
before LRD functions. If the recorded think time is below the threshold level, an
lr_think_time statement is not generated.
Default value: five seconds.
Database > Advanced Recording Options Dialog Box
Enables you set the advanced recording options for database protocols.
To access
VuGen > Record > Recording Options > Database > Database > Advanced
HP LoadRunner (12.00)
Page 190 of 1743
LoadRunner User Guide
Script Workflow
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Element
Description
Code
Specify in kilobytes the maximum size of the code generation buffer.
generation Default value: 128 kilobytes.
buffer size
CtLib
Function
You can instruct VuGen to generate a send data time stamp or an extended result
set statement.
l
Generate send data time stamp. Generates lrd_send_data statements with
the TotalLen and Log keywords for the mpszReqSpec parameter. The
Advanced Recording Options dialog box lets you instruct VuGen to also
generate the TimeStamp keyword. If you change this setting on an existing
script, you must regenerate the Vuser script by choosing Record >
Regenerate Script. It is not recommended to generate the Timestamp
keyword by default. The timestamp generated during recording is different than
that generated during replay and script execution will fail. You should use this
option only after a failed attempt in running a script, where an lrd_result_set
following an lrd_send_data fails. The generated timestamp can be correlated
with a timestamp generated by an earlier lrd_send_data.
l
Generate extended result set statement. Generates an lrd_result_set
function when preparing the result set. This setting instructs VuGen to generate
the extended form of the lrd_result_set function, lrd_result_set_ext. In
addition to preparing a result set, this function also issues a return code and
type from ct_results.
Recording
engine
You can instruct VuGen to record scripts with the older LRD recording engine for
compatibility with previous versions of VuGen.
Note: This option is available only for single-protocol scripts.
Recording
log
options
You can set the detail level for the trace and ASCII log files. The available levels for
the trace file are Off, Error Trace, Brief Trace, or Full Trace. The error trace only
logs error messages. The Brief Trace logs errors and lists the functions generated
during recording. The Full Trace logs all messages, notifications, and warnings.
You can also instruct VuGen to generate ASCII type logs of the recording session.
The available levels are Off, Brief detail, and Full detail. The Brief detail logs all
of the functions, and the Full detail logs all of the generated functions and
messages in ASCII code.
Data Format Extension > Chain Configuration Node
Enables you to add, delete, and modify chains, and to manage the DFEs that are included in the
chains.
HP LoadRunner (12.00)
Page 191 of 1743
LoadRunner User Guide
Script Workflow
To access
Do one of the following:
l
VuGen > Record > Recording Options > Data Format Extension > Chain
Configuration
l
VuGen > Replay > Run-Time Settings > Data Format Extensions > Code
Generation
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
See also
l
"Data Format Extensions (DFEs) - Overview" on page 831
l
"Data Format Extension List" on page 839
User interface elements are described below:
UI Element
Description
Chains
pane
Displays a list of the DFE chains that are defined for the script.
Add Chain. Enables you to add a new chain.
Edit Chain Name. Enables you to modify the name of the selected chain.
Delete Chain. Deletes the selected chain.
Chain: <chain name> pane
Add DFE. Enables you to add a DFE to the selected chain in the Chains pane.
For more information on Data Format Extensions, see "Data Format Extension
List" on page 839.
Edit DFE. If you selected a Prefix/Postfix Extension, you can edit the details in
the Add Prefix/Postfix to Chain dialog box. For more information on the dialog
box, see " Add Prefix/Postfix to Chain Dialog Box" on the next page.
Delete DFE. Deletes the selected DFE from the chain.
Move Up/Down. Moves the selected Data Format Extension up or down in the
chain. Extensions are run in the order in which they appear in the extensions list.
Name
The display name of the Data Format Extension.
Tag
The unique ID of the extension.
Provider
The creator of the Data Format Extension.
HP LoadRunner (12.00)
Page 192 of 1743
LoadRunner User Guide
Script Workflow
Continue
Determines how the chain behaves after the DFE is applied:
Processing
l True:
The data is passed on to the next DFE in the chain, whether or not the data was
converted.
l
False:
If the DFE converted the data that it received, the chain is terminated - no
further DFEs are applied to the data.
If the DFE did not convert the data that it received, the data is passed on to the
next DFE in the chain.
Note: If the chain contains only a single DFE, the Continue Processing
setting is not significant.
Add Prefix/Postfix to Chain Dialog Box
This dialog enables you to add or edit a prefix/postfix extension to the selected chain.
To
access
1. Go to Record > Recording Options > Data Format Extension > Chain
Configuration node.
2. In the Chain: <Chain name> area, click the
button.
3. Select Prefix Postfix Extensionand click OK.
HP LoadRunner (12.00)
Page 193 of 1743
LoadRunner User Guide
Script Workflow
See also "Data Format Extension > Chain Configuration Node" on page 191
"Data Format Extensions (DFEs) - Overview" on page 831
"Data Format Extension List" on page 839
User interface elements are described below:
UI Element
Description
Case
sensitive
Sets the extension to cut from the defined prefix and postfix of the string only if the
letter cases match.
Display
name
The name of Prefix/Postfix Extension.
Postfix to
cut
The section you want to cut, from the end of the string.
Prefix to
cut
The section you want to cut, from the beginning of the string.
Tag name
The unique ID of the Prefix/Postfix Extension.
Add Data Format Extension
This dialog box enables you to select the data format extension type.
UI example
To access
VuGen > Recording Options > Data Format Extension > Chain
Configuration >
Important
information
Relevant
tasks
Data
Format
Extension
l
"Data Format Extension > Chain Configuration Node" on page 191
l
" Add Prefix/Postfix to Chain Dialog Box" on the previous page
"How to Apply DFE Chains to Sections of the HTTP Message" on page 837
Description
Base64
Extension
Decodes strings that are encoded with a Base64 encoder.
GWT
Extension
Transforms GWT data to XML format.
HP LoadRunner (12.00)
Page 194 of 1743
LoadRunner User Guide
Script Workflow
URL
Encoding
Extension
Decodes strings that are encoded with URL encoding format.
JSON to
XML
Extension
Transforms JSON data to XML format.
XML
Extension
Receives data and checks to see if it conforms with XML syntax. This check
allows VuGen to perform correlations based on XPath and to display snapshot
data in an XML viewer.
Prefix
Postfix
Extension
Enables you to cut data from the beginning and/or end of a string which you do not
want decoded. You can add and customize as many prefix/postfix extensions as
required. Each postfix/prefix extension created should have a unique display
name and tag name.
Binary to
XML
Extension
Transforms Microsoft WCF binary XML into XML format.
Remedy to
XML
Extension
Transforms Remedy request data into XML format.
XSS
Extension
Enables you to test sites that use Cross Site Scripting (XSS) defense code.
Note that this extension does not transform Remedy response data - which is
JavaScript code.
Data Format Extension > Code Generation Node
Enables Data Format Extensions during code generation, and enables you to define chains for each
section of the HTTP message.
To access
VuGen > Record > Recording Options > Data Format Extension > Code
Generation
Important
This node is available for specific protocols only. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
See also
l
"Data Format Extensions (DFEs) - Overview" on page 831
l
"Data Format Extension List" on page 839
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Enable data
format
extension
Enables you to select chains for each message section of the HTTP message.
By default, this option is not selected.
HP LoadRunner (12.00)
Page 195 of 1743
LoadRunner User Guide
Script Workflow
Configuration
Format
Verify
formatted
data
l
Code and snapshots. (default) Enables Data Format Extensions on the
code and snapshot data.
l
Snapshots. Enables Data Format Extensions on snapshot data, but does
not format the data in the script itself.
Checks the results of the formatted data by converting it back to the original
state and verifying that it matches the original data.
Note: Available for Base64 extension only.
Chain Assignment
Imports the Data Format Extensions from a file.
Exports the Data Format Extensions to a file.
<Message
sections
list>
Displays a list of the following sections of the HTTP message included in the
script:
l
Body
l
Headers
l
Cookies
l
Query String
When you select a message section from the list, the title of the section chains
pane (described below) reflects your selection and the pane displays the list of
chains for that section.
<Section Chains>
Add Chain. Adds chain to selected message section.
Note:
l
Enabled for Headers and Cookies sections only. Enables you to add
additional chains to the selected message section.
l
For VuGen to correctly match the chain to the Headers or Cookies section,
the name in the Name column must match the name of the Headers or
Cookies section.
Delete Chain. Removes chain from corresponding message section.
Note: You cannot delete the default options from any of the message sections.
Reset. Clears the selected chain in the Chain column.
HP LoadRunner (12.00)
Page 196 of 1743
LoadRunner User Guide
Script Workflow
Flex > RTMP Node
This node enables you to include the flex_rtmp_recive_stream step in Flex RTMP scripts.
To access
VuGen > Record > Recording Options > Flex > RTMP
Important
This node is available only for specific protocols. For a complete list of protocols
Information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Element
Description
Generate
flex_
rtmp_
receive_
stream
step
Generates a single step when recording a stream. This step does not replay certain
actions, such as pause and seek. If your script requires these actions, clear the
check box to record all receive and send steps. However, in this case, you must
manually modify your script as described in the Readme.
Flex > Configuration Node (Recording)
Enables you to set an external JVM (Java Virtual Machine) path.
To access
VuGen > Record > Recording Options> Flex > Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Use External JVM
Enables you to use an external JVM. If you choose this option, you must
specify the path:
External JVM Path The full path of the external JVM.
VuGen must be restarted for the changes to be applied.
UseGraniteDS
configuration
HP LoadRunner (12.00)
Defines the server side Data Service configuration.
If you select this option, do not select Use Flex LCDS/BlazeDS jars to
serialize the messages. Ensure that the granit-config.xml file matches
the one deployed on the server.
Page 197 of 1743
LoadRunner User Guide
Script Workflow
Maximum
Formatted
Request/Response
size to print
Enables you to specify the maximum character length of a request or
response body to be captured in the log files. The option only affects the
flex_amf_call and flex_remoting_call steps.
For example, if you specify a value of 1048576 characters (1MB), only
responses or requests with a length less than a megabyte will be printed
on the Code Generation or Replay log.
Flex > Externalizable Objects Node (Recording)
This dialog box enables you to configure how LoadRunner handles externalizable objects in Flex
scripts.
To access
VuGen > Record > Recording Options > Flex > Externalizable Objects
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
Relevant
tasks
See also
l
How to Serialize Using External Java Serializer
l
"How to Serialize Flex Scripts " on page 645
l
"Flex Overview" on page 625
l
" Externalizable Objects in Flex Scripts" on page 642
User interface elements are described below:
UI Element
Description
Do not
Generate script using default settings.
serialize
externalizable
objects
HP LoadRunner (12.00)
Page 198 of 1743
LoadRunner User Guide
Script Workflow
Serialize
objects using
Select the appropriate option:
l
Select LoadRunner AMF serializer if you are not using the Adobe
LiveCycle Data Services or Adobe BlazeDS server.
l
Select Custom Java classes and select one or both of the available
options:
n
Select Use Flex LCDS/BlazeDS jars if you are using Flex LCDS or
BlazeDS jars to serialize the messages. If you selected UseGraniteDS
configuration in the Configuration node, do not select Use Flex
LCDS/BlazeDS jars.
n
Select Use additional jars to add additional jars to serialize the
messages. You must copy the jar files from the server and specify their
location in the Classpath Entries list described below. Copy only those
jars that contain the class that is externalizable. Ensure that the files
exist in the same location on all load generator computers. If you add jars
with the same names as the Flex LCDS or Blaze DS jars chosen by
selecting the first check box, these files will be overwritten.
Classpath Entries List
Down Arrow. Moves a classpath entry down the list.
Up Arrow. Moves a classpath entry up the list.
Add Classpath. Adds a new line to the classpath list.
Add Classpath Folder. Adds all files from the folder to the classpath list.
Delete. Permanently removes a classpath.
General > Code Generation
This pane of the Recording Options dialog box enables you to define what tasks VuGen performs
automatically after generating a Vuser script.
To access
VuGen > Record > Recording Options > General > Code Generation
Relevant tasks
"How to Create an Asynchronous Vuser Script" on page 448
"How to Correlate Scripts Using Design Studio" on page 280
User interface elements are described below:
HP LoadRunner (12.00)
Page 199 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Correlations
Scan
Instructs VuGen to analyze the Vuser script to locate dynamic values that may
need to be correlated. This scan is performed after a new script is recorded and
after an existing script is regenerated.
Async Scan Instructs VuGen to analyze the Vuser script to locate asynchronous
communication. This scan is performed after a new script is generated and after
an existing script is regenerated.
Async
Options...
Opens the "Asynchronous Options Dialog Box" on page 473.
General > Protocol Node
Enables you to set the script generation preferences by setting the scripting language and options.
To access
VuGen > Record > Recording Options > General > Protocols
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Element
Description
Active
A list of the protocols which comprise your multiple protocol script. VuGen lets you
Protocols modify the protocol list for which to generate code during the recording session.
List
Select the check boxes adjacent to the protocols you want to record in the next
recording session. Clear the check boxes adjacent to the protocols you do not want
to record in the next recording session.
General > Recording Node
Enables you to specify what information to record and which functions to use when generating a
Vuser script, by selecting a recording level.
To access
VuGen > Record > Recording Options > General > Recording
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
HP LoadRunner (12.00)
Description
Page 200 of 1743
LoadRunner User Guide
Script Workflow
Opens the "Advanced HTML Dialog Box" on the next page.
Opens the "Advanced URL Dialog Box" below.
HTML-based script
This is the default recording level for Web (HTTP/HTML) Vusers. It
instructs VuGen to record HTML actions in the context of the current Web
page. It does not record all resources during the recording session, but
downloads them during replay. This options is recommended for browser
applications with applets and VB script.
URL-based script
Record all requests and resources from the server. It automatically
records every HTTP resource as URL steps (web_url statements), or in
the case of forms, as web_submit_data. It does not generate the web_
link, web_image, and web_submit_form functions, nor does it record
frames. This options is recommended For non-browser applications.
Advanced URL Dialog Box
Enables you to set the advanced options for scripts using the URL recording mode.
To access
VuGen > Record > Recording Options > General > Recording > URL
Advanced
Important
This dialog box is available only for specific protocols. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
246.
User interface elements are described below:
UI Element
Description
Restores the default settings of this dialog box.
Create
concurrent
groups for
resources after
their source
HTML page
Records the resources in a concurrent group (enclosed by web_concurrent_
start and web_concurrent_end statements) after the URL. Resources
include files such as images and js files. If you disable this option, the
resources are listed as separate web_url steps, but not marked as a
concurrent group.
Enable EUCEncoded Web
Pages
(For Japanese windows only) Instructs VuGen to use EUC encoding. For
more information, see "EUC-Encoding (Japanese Windows only)" on page
251.
Use web_
custom_request
only
Records all HTTP requests as custom requests. VuGen generates a web_
custom_request function for all requests, regardless of their content.
Recommended for non-browser applications.
HP LoadRunner (12.00)
Page 201 of 1743
LoadRunner User Guide
Script Workflow
Advanced HTML Dialog Box
Enables you to set the advanced options for HTTP-based scripts.
To access
VuGen > Record > Recording Options > General > Recording > HTML
Advanced
Important
This dialog box is available only for specific protocols. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
246.
User interface elements are described below:
UI Element
Description
Restores the default settings of this dialog box.
Non-HTML
generated
elements
Many Web pages contain non-HTML elements, such as applets, XML, ActiveX
elements, or JavaScript. These non-HTML elements usually contain or retrieve
their own resources. Using the following options, you can control how VuGen
records non HTML-generated elements.
l
Record within the current script step. Does not generate a new function for
each of the non HTML-generated resources. It lists all resources as
arguments of the relevant functions, such as web_url, web_link, and web_
submit_data. The resources, arguments of the Web functions, are indicated
by the EXTRARES flag.
l
Record in separate steps and use concurrent groups. Creates a new
function for each one of the non HTML-generated resources and does not
include them as items in the page's functions (such as web_url and web_
link). All of the web_url functions generated for a resource are placed in a
concurrent group (surrounded by web_concurrent_start and web_
concurrent_end).
l
Do not record. Does not record any non-HTML generated resources.
HP LoadRunner (12.00)
Page 202 of 1743
LoadRunner User Guide
Script Workflow
Script type
l
A script describing user actions. Generates functions that correspond
directly to the action taken. It creates URL (web_url), link (web_link), image
(web_image), and form submission (web_submit_form) functions. The
resulting script is very intuitive and resembles a context sensitive recording.
l
A script containing explicit URL's only. Records all links, images and
URLs as web_url statements, or in the case of forms, as web_submit_data. It
does not generate the web_link, web_image, and web_submit_form
functions. The resulting script is less intuitive. This mode is useful for
instances where many links within your site have the same link text. If you
record the site using the first option, it records an ordinal (instance) for the link,
but if you record using the second option, each link is listed by its URL. This
facilitates parameterization and correlation for that step.
General > Script Node
Enables you to set the script generation preferences by setting the scripting language and options.
To access
VuGen > Record > Recording Options > General > Script
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Add a
comment for
each action
Insert informative logging messages before each message invocation (non-C
only).
Default value: enabled.
Close all
AUT
processes
when
recording
stops
Automatically closes all of the AUT's (Application Under Test) processes when
VuGen stops recording.
Default value: disabled.
Correlate
arrays
Tracks and correlates arrays of all data types, such as string, structures,
numbers, and so on.
Default value: enabled.
Correlate
large
numbers
Correlates long data types such as integers, long integers, 64-bit characters,
float, and double.
Default value: disabled.
Correlate
simple
strings
Correlates simple, non-array strings and phrases.
Default value: disabled.
HP LoadRunner (12.00)
Page 203 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Correlate
small
numbers
Correlates short data types such as bytes, characters, and short integers.
Default value: disabled.
Correlate
structures
Tracks and correlates complex structures.
Default value: enabled.
Declare
Declares primitive value variables as local variables rather than class variables
primitives as (C, C#, and .NET only).
Default value: enabled.
locals
Explicit
variant
declaration
Declares variant types explicitly in order to handle ByRef variants (Visual Basic
for Applications only).
Default value: enabled.
Generate
fixed think
time after
end
transaction
Adds a fixed think time, in seconds, after the end of each transaction. When you
enable this option, you can specify a value for the think time.
Default value: disabled, 3 seconds when enabled.
Generate
recorded
events log
Generates a log of all events that took place during recording.
Default value: disabled.
Generate
think time
greater than
threshold
Uses a threshold value for think time. If the recorded think time is less than the
threshold, VuGen does not generate a think time statement. You also specify the
threshold value. The default values is 3—if the think time is less than 3 seconds,
VuGen does not generate think time statements. If you disable this option,
VuGen will not generate any think times.
Default value: enabled, 3 seconds.
Insert output
parameters
values
Inserts output parameter values after each call (C, C#, and .NET only).
Default value: disabled.
Insert postinvocation
info
Insert informative logging messages after each message invocation (non-C
only).
Default value: enabled.
Maximum
number of
lines in
action file
Create a new file if the number of lines in the action exceeds the specified
threshold. The default threshold is 60000 lines (C, C#, and .NET only).
Default value: disabled.
HP LoadRunner (12.00)
Page 204 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Replace
long strings
with
parameter
Save strings exceeding the maximum length to a parameter. This option has an
initial maximum length of 100 characters. The parameters and the complete
strings are stored in the lr_strings.h file in the script's folder in the following
format:
const char <paramName_uniqueID> ="string".
This option allows you to have a more readable script. It does not effect the
performance of the script.
Default value: enabled.
Reuse
variables for
primitive
return
values
Reuse the same variables for primitives received from method calls. This
overrides the Declare primitives as locals setting.
Default value: enabled.
Track
processes
created as
COM local
servers
Track the activity of the recorded application if one of its sub-processes was
created as a COM local server (C and COM only).
Default value: enabled.
Use full type
names
Use the full type name when declaring a new variable (C# and .NET only).
Default value: disabled.
Use helpers
for arrays
Use helper functions to extract components in variant arrays (Java and VB
Scripting only).
Default value: disabled.
Use helpers
for objects
Use helper functions to extract object references from variants when passed as
function arguments (Java and VB Scripting only).
Default value: disabled.
Use
protected
application
recording
Use this option if VuGen is unable to record your application. Your application
may block access to VuGen, and recording with this option selected may enable
access.
Default value: disabled.
Warn me if
the
application
being
recorded
encounters
an error
Selecting this option enables VuGen to prompt you to cancel the recording if the
recorded application crashes or if no events are recorded for 3 minutes. If you
choose to cancel the recording, no script is generated.
Default value: enabled.
Note: This option is available for Web (HTTP/HTML) Vuser scripts only.
GUI Properties > Web Event Configuration Node
Enables you to set the level of detail recorded in a script (web event recording).
HP LoadRunner (12.00)
Page 205 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Record > Recording Options > GUI Properties > Web Event
Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Basic Event
Configuration
Level
l
Always records click events on standard Web objects such as images,
buttons, and radio buttons.
l
Always records the submit event within forms.
l
Records click events on other objects with a handler or behavior
connected.
l
Records the mouseover event on images and image maps only if the
event following the mouseover is performed on the same object.
Custom
Settings
Opens the "Custom Web Event Recording Configuration Dialog Box" below,
where you can customize the event recording configuration.
High Event
Configuration
Level
In addition to the objects recorded in the Medium level, it records mouseover,
mousedown, and double-click events on objects with handlers or behaviors
attached.
Medium Event
Configuration
Level
In addition to the objects recorded in the Basic level, it records click events
on the <DIV>, <SPAN>, and <TD> HTML tag objects.
Custom Web Event Recording Configuration Dialog Box
Enables you to customize the level of web event recording.
To access
VuGen > Record > Recording Options > GUI Properties > Web Event
Configuration > Custom Settings
Important
This dialog box is available only for specific protocols. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
246.
User interface elements are described below (unlabeled elements are shown in angle brackets):
HP LoadRunner (12.00)
Page 206 of 1743
LoadRunner User Guide
Script Workflow
UI
Element Description
<Object
List>
A list of the web objects. Each web object can be customized according to the other
settings in this dialog box.
<Object
Menu>
l
Add. Adds a new HTML tag object to the object list. Type in the name of the tag.
l
Delete. Deletes an object from the object list.
l
Add. Adds an event to the Event Name column of this object.
l
Delete. Deletes an event from the Event Name column of this object.
Event
Menu
Event
Name
A list of events associated with the object.
File
Menu
l
Load Configuration. Loads a previously created custom configuration.
l
Save Configuration As. Saves the current configuration.
Listen
The criteria which determines when VuGen listens for an event.
l
Always. Always listen to the event.
l
If Handler. Listens to the event if a handler is attached to it. A handler is code in a
Web page, typically a function or routine written in a scripting language, that
receives control when the corresponding event occurs.
l
If Behavior. Listens to the event if a DHTML behavior is attached to it. A DHTML
behavior encapsulates specific functionality or behavior on a page. When applied
to a standard HTML element on a page, a behavior enhances that element's
default behavior.
l
If Handler or Behavior. Listens to the event if either a handler or a behavior is
attached to it.
l
Never. Never listens to the event.
For more information, see "Tips for Working with Event Listening and Recording" on
page 254.
HP LoadRunner (12.00)
Page 207 of 1743
LoadRunner User Guide
Script Workflow
UI
Element Description
Record
The criteria which determines when VuGen records an event.
l
Enabled. Records the event each time it occurs on the object as long as VuGen
listens to the event on the selected object, or on another object to which the event
bubbles. Bubbling is the process whereby, when an event occurs on a child object,
the event can travel up the chain of hierarchy within the HTML code until it
encounters an event handler to process the event.
l
Disabled. Does not record the specified event and ignores event bubbling where
applicable.
l
Enabled on next event. Same as Enabled, except that it records the event only
if the subsequent event occurs on the same object. For example, suppose a
mouseover behavior modifies an image link. You may not want to record the
mouseover event each time you happen to move the mouse over this image.
Because only the image that is displayed after the mouseover event enables the
link event, however, it is essential that the mouseover event is recorded before a
click event on the same object.
For more information, see "Tips for Working with Event Listening and Recording" on
page 254.
Reset
Resets the custom settings to the settings of your choice: basic, medium, or high.
Settings
HTTP > Advanced Node
Enables you to customize the code generation settings in the area of think time, resetting contexts,
saving snapshots, and the generation of web_reg_find functions.
To access
VuGen > Record > Recording Options > HTTP Properties > Advanced
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
l
Some options within this node are not available in when using a multi-protocol
script.
User interface elements are described below:
UI Element
Description
Opens the "Headers Dialog Box" on page 211.
HP LoadRunner (12.00)
Page 208 of 1743
LoadRunner User Guide
Script Workflow
Opens the "Content Type Filters Dialog Box" on page 212.
Opens the "Non-Resources Dialog Box" on page 212.
Reset context for
each action
Resets all HTTP contexts between actions. Resetting contexts allows
the Vuser to more accurately emulate a new user beginning a browsing
session. This option resets the HTML context, so that a context-less
function is always recorded in the beginning of the action. It also clears
the cache and resets the user names and passwords.
Note: This option is available only for Web and Oracle NCA protocols
Save snapshot
resources locally
Saves a local copy of the snapshot resources during record and replay,
thereby creating snapshots more accurately and displaying them quicker.
Generate web_reg_
find functions for
page titles
Generates web_reg_find functions for all HTML page titles. VuGen adds
the string from the page's title tag and uses it as an argument for web_
reg_find.
l
Generate web_reg_find functions for sub-frames. Generates web_
reg_find functions for page titles in all sub-frames of the recorded
page.
Note: This option is available only for Web and Oracle NCA protocols
Add comment to
script for HTTP
errors while
recording
Adds a comment to the script for each HTTP request error. An error
request is defined as one that generated a server response value of 400 or
greater during recording.
Support charset
l
UTF-8. Enables support for UTF-8 encoding. This instructs VuGen to
convert non-ASCII UTF-8 characters to the encoding of your locale's
machine in order to display them properly in VuGen. You should
enable this option only on non-English UTF-8 encoded pages. The
recorded site's language must match the operating system language.
You cannot record non-English Web pages with different encodings
(for example, UTF-8 together with ISO-8859-1 or shift_jis) within the
same script.
l
EUC-JP. If you are using Japanese Windows, select this option to
enable support for Web sites that use EUC-JP character encoding.
This instructs VuGen to convert EUC-JP strings to the encoding of
your locale's machine in order to display them properly in VuGen.
VuGen converts all EUC-JP (Japanese UNIX) strings to the SJIS
(Japanese Windows) encoding of your locale's machine, and adds a
web_sjis_to_euc_param function to the script. (Kanji only)
HP LoadRunner (12.00)
Page 209 of 1743
LoadRunner User Guide
Script Workflow
Parameterize
server names
VuGen identifies server names and IP addresses when you regenerate a
Vuser script. These server names and IP addresses are contained in
specific arguments associated with specific functions in the Vuser script.
[See the table below for details.] VuGen replaces the identified server
names and IP addresses with parameters. Parameterizing server names
and IP addresses enables you to run the Vuser script in different
environments by simply changing the server and IP address values in the
parameter file. For an introduction to parameters, see "Parameterizing Overview" on page 408.
Note: To identify data for parameterization, VuGen searches the
arguments that are listed for the following functions:
API Function
Arguments
web_url
l
URL
l
Referrer
l
URL
l
Referrer
l
URL
l
Referrer
l
Action
l
URL
l
Referrer
l
Action
l
URL
l
Referrer
web_custom_request
web_image
web_submit_data
web_submit_form
By default, this option is not selected.
Use the LR Proxy
to record a local
application
Provides an alternative way to record if the standard VuGen recording
mechanism is not compatible with your application. This applies when
you have selected to record a Web browser or Windows application.
Note: After recording, clear this option to restore the default mode.
HP LoadRunner (12.00)
Page 210 of 1743
LoadRunner User Guide
Script Workflow
Use streaming
mode when
recording with the
LoadRunner Proxy
Streaming mode enables HTTP data portions received from the server to
be forwarded to the application with buffering. This allows you to record
asynchronous push communication.
Note: If this option is enabled, the remote recording toolbar is
disabled.
Headers Dialog Box
Enables you to automatically send additional HTTP headers with every HTTP request submitted to
the server.
To access
VuGen > Record > Recording Options > HTTP > Advanced > Headers
Important
information
l
This dialog box is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
l
The following standard headers are considered risky: Authorization,
Connection, Content-Length, Cookie, Host, If-Modified-Since, ProxyAuthenticate, Proxy-Authorization, Proxy-Connection, Referer, and WWWAuthenticate. They are not recorded unless selected in the Header list.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Plus. Adds a new entry.
Minus. Deletes an entry.
Restores the current list to the default values and entries.
Restores all lists to the default values and entries.
<Dropdown
menu>
<Header
list>
Controls the options for this dialog box:
l
Do not record headers
l
Record headers in list
l
Record headers not in list
List of headers which may or may not be recorded. The lists vary depending on
which drop-down item is selected. Each item can be selected or deselected using
its individual check box.
HP LoadRunner (12.00)
Page 211 of 1743
LoadRunner User Guide
Script Workflow
Content Type Filters Dialog Box
Enables you to filter content types for your recorded script. You can specify the type of the content
you want to record or exclude from your script.
To access
VuGen > Record > Recording Options > HTTP > Advanced > Content
Types
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Plus. Adds a new entry.
Minus. Deletes an entry.
Restores the current list to the default values and entries.
Restores all lists to the default values and entries.
<Dropdown
menu>
<Header
list>
Controls the options for this dialog box:
l
Do not filter content types.
l
Filter content types in list.
l
Filter content types not in list.
List of content types which may or may not be filtered. The lists vary depending
on which drop-down item is selected. Each item can be selected or deselected
using its individual check box.
Non-Resources Dialog Box
When you record a script, VuGen indicates whether or not it will retrieve the resource during replay
using the Resource attribute in the web_url function. If the Resource attribute is set to 0, the
resource is retrieved during script execution. If the Resource attribute is set to 1, the Vuser skips
the resource type.
You can exclude specific content types from being handled as resources. For example, you can
indicate to VuGen that gif type resources should not be handled as a resource and therefore be
downloaded unconditionally.
HP LoadRunner (12.00)
Page 212 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Record > Recording Options > HTTP > Advanced > NonResources
Important
This dialog box is available only for specific protocols. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
246.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Add. Adds a new entry to the list.
Remove. Deletes an entry from the list.
Restores the default list.
<Non-Resource
Content Type list>
List of items which should not be recorded as resources. Each item can
be selected or deselected using its individual check box.
Flex > Configuration Node (Recording)
Enables you to set an external JVM (Java Virtual Machine) path.
To access
VuGen > Record > Recording Options> Flex > Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Use External JVM
Enables you to use an external JVM. If you choose this option, you must
specify the path:
External JVM Path The full path of the external JVM.
VuGen must be restarted for the changes to be applied.
UseGraniteDS
configuration
HP LoadRunner (12.00)
Defines the server side Data Service configuration.
If you select this option, do not select Use Flex LCDS/BlazeDS jars to
serialize the messages. Ensure that the granit-config.xml file matches
the one deployed on the server.
Page 213 of 1743
LoadRunner User Guide
Script Workflow
Maximum
Formatted
Request/Response
size to print
Enables you to specify the maximum character length of a request or
response body to be captured in the log files. The option only affects the
flex_amf_call and flex_remoting_call steps.
For example, if you specify a value of 1048576 characters (1MB), only
responses or requests with a length less than a megabyte will be printed
on the Code Generation or Replay log.
Flex > Externalizable Objects Node (Recording)
This dialog box enables you to configure how LoadRunner handles externalizable objects in Flex
scripts.
To access
VuGen > Record > Recording Options > Flex > Externalizable Objects
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
Relevant
tasks
See also
l
How to Serialize Using External Java Serializer
l
"How to Serialize Flex Scripts " on page 645
l
"Flex Overview" on page 625
l
" Externalizable Objects in Flex Scripts" on page 642
User interface elements are described below:
UI Element
Description
Do not
Generate script using default settings.
serialize
externalizable
objects
HP LoadRunner (12.00)
Page 214 of 1743
LoadRunner User Guide
Script Workflow
Serialize
objects using
Select the appropriate option:
l
Select LoadRunner AMF serializer if you are not using the Adobe
LiveCycle Data Services or Adobe BlazeDS server.
l
Select Custom Java classes and select one or both of the available
options:
n
Select Use Flex LCDS/BlazeDS jars if you are using Flex LCDS or
BlazeDS jars to serialize the messages. If you selected UseGraniteDS
configuration in the Configuration node, do not select Use Flex
LCDS/BlazeDS jars.
n
Select Use additional jars to add additional jars to serialize the
messages. You must copy the jar files from the server and specify their
location in the Classpath Entries list described below. Copy only those
jars that contain the class that is externalizable. Ensure that the files
exist in the same location on all load generator computers. If you add jars
with the same names as the Flex LCDS or Blaze DS jars chosen by
selecting the first check box, these files will be overwritten.
Classpath Entries List
Down Arrow. Moves a classpath entry down the list.
Up Arrow. Moves a classpath entry up the list.
Add Classpath. Adds a new line to the classpath list.
Add Classpath Folder. Adds all files from the folder to the classpath list.
Delete. Permanently removes a classpath.
.NET > Filters Node
Enables you to set the recording options for .NET Vuser scripts.
To access
VuGen > Record > Recording Options > Microsoft .NET > Filters
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
See also
l
".NET Filters Overview" on page 727
l
".NET Filters - Advanced" on page 728
l
"Guidelines for Setting .NET Filters" on page 729
User interface elements are described below:
HP LoadRunner (12.00)
Page 215 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Opens the Create a New Filter dialog box, enabling you to create a
new filter. For more details, see "Create a New Filter Dialog Box
[.NET Protocol]" below.
Opens the Filter Manager, allowing you to view and modify all
Microsoft .NET protocol filters. For details, see "Filter Manager
[.NET Protocol]" below.
Custom Filter
Shows the filters that you created earlier on the current machine.
Environment Filter
Lists the available environment filters: .NET Remoting, ADO.NET,
Enterprise Services, and WCF (Windows Communication
Foundation of Framework 3.0).
New Filter
Indicates that you want to create a new filter.
Create a New Filter Dialog Box [.NET Protocol]
This dialog box enables you to create a new filter for .NET Vuser scripts.
To
access
VuGen > Record > Recording Options > Microsoft .NET > Filters > New Filter
> Create
User interface elements are described below:
UI Element
Description
Based on a
custom filter
Create a new filter based on a custom filter. Use the drop-down menu to select
the custom filter.
Based on an
environment
filter
Create a new filter based on an environment filter. Use the check boxes next to
the environment filters to indicate which environment filters to base the filter
on.
Start with an
empty filter
Create a new filter that is not based on a pre-existing filter.
Filter Manager [.NET Protocol]
This dialog box enables you to create and edit .NET filters.
To
VuGen > Record > Recording Options > Microsoft .NET > Filters >
access Environment / Custom Filter > Filter Manager
See
also
".NET Filters Overview" on page 727
".NET Filters - Advanced" on page 728
"Guidelines for Setting .NET Filters" on page 729
HP LoadRunner (12.00)
Page 216 of 1743
LoadRunner User Guide
Script Workflow
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI
Element
Description
Includes the selected element. If you manually include a parent node, the Filter
Manager includes the child elements below it, provided that no other rule exists. For
example, if you include a class, it will include all its methods unless you specifically
excluded a method.
Excludes the selected element. The child elements are also excluded unless they
were included by another rule. By default, when you exclude a class, the Filter
Manager applies the Exclude attribute to the class, but it allows the recording
engine to record activity within the methods of the excluded class. When you
exclude a method, however, the Filter Manager applies Totally Exclude, preventing
the recording engine from recording any activity within the methods of the excluded
class. Advanced users can modify these setting in the filter file.
Removes the manual inclusion or exclusion rule. In this case, the element may be
impacted by other parent elements.
The inclusion and exclusion rules have the following properties:
l
The rules are hierarchical—if you add an include or exclude rule to a class, then
the derived classes will follow the same rule unless otherwise specified.
l
A rule on a class only affects its public methods, derived classes, and inner
classes.
l
A rule on a namespace affects all the classes and their public methods.
l
Note that adding or removing assemblies does not necessarily affect the
classes that they contain—you can remove an assembly, yet its methods may
be recorded due to the hierarchical nature of the filter.
l
As part of the filter design, several methods, such as .cctor() and Dispose
(bool), do not follow the standard hierarchal rules.
Note: The resetting of a parent node does not override a manual inclusion or
exclusion applied to a child node. For example, if you manually exclude a method,
and then reset its class, which by default included all sub-nodes, your method will
remain excluded.
Properties and events are view-only and cannot be included or excluded through the
Filter Manager. In addition, several system related elements are protected and may
not be altered.
For tips about including and excluding elements in the filter, see "Guidelines for
Setting .NET Filters" on page 729.
Navigates to the previous or next tree node visited by the user.
HP LoadRunner (12.00)
Page 217 of 1743
LoadRunner User Guide
Script Workflow
Show non-public items. By default, the filter manager shows only public classes
and class members. By clicking the
button, non-public items will be displayed
in the tree view.
If you include a class which contains non-public items, they will not be added to the
filter automatically. You must explicitly include each non-public item to the filter.
Impact
Log
The Impact Log indicates what your last changes were and how they affected your
filter. The user actions are listed in descending order, with the latest changes at the
top.
For each element affected by your manual inclusion or exclusion, the log indicates
how it affected the element. It also provides a link to that element in the Filter
Manager.
To view the Impact Log, click the Impact Log button on the Filter Manager's toolbar
or select Actions > View Impact Log in the Filter Manager window.
<Filter
Manager
Tree>
The Filter Manager tree uses symbols to illustrate the elements and their status. For
details about each of the icons, see the table below.
l
Element icons represent the type of element—assembly, namespace, class,
method, structure, property, events, or interfaces.
l
A check mark or X adjacent to the element icon, indicates whether or not the
element is included or excluded.
l
A bold element indicates that it was explicitly included or excluded. This may be
a result of being manually included or excluded by the user or by a pre-defined
rule in the environment filter. If you reset a bold node, it returns to its original,
non-bold state.
Add
Opens the Add Reference dialog box with a list of .NET Framework components or
Reference assemblies in the Public Assemblies folder. For more information, see "Add
Reference Dialog Box [.NET Protocol]" on the next page.
Delete
Deletes the selected custom filter. The Filter Manager prompts you for a
confirmation.
New
Opens the Create a New Filter dialog box, in which you create an empty filter or a
new filter based on an existing one. For more information, see "Create a New Filter
Dialog Box [.NET Protocol]" on page 216.
Remove
Removes the assembly that is selected in the Filter Manager and all of the elements
Reference associated with it. The Filter Manager prompts you for a confirmation.
Save
Saves the changes you made to filter.
View
Impact
Log
Opens the Impact log for the selected filter. The Impact log shows which nodes in
the tree were affected by recent actions.
The following table shows the Filter Manager Tree icons that represent the various elements:
HP LoadRunner (12.00)
Page 218 of 1743
LoadRunner User Guide
Script Workflow
Icon
Description
Icon
Description
assembly
interface
assembly that couldn't be loaded
method
assembly that was partially loaded
static method
class
namespace
constructor
property
static constructor
static
property
event
structure
static event
Add Reference Dialog Box [.NET Protocol]
This dialog box enables you to add references to .NET filters.
To
VuGen > Record > Recording Options > Microsoft .NET > Filters >
access Environment / Custom Filter > Filter Manager > Add Reference
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Component A list of .NET Framework components or assemblies in the Public Assemblies
List>
folder.
<Selected
Component
List>
l
To add one of the listed items, select it and click Select. You can select
multiple components using ctrl-click. The bottom pane shows the selected
references.
l
To add an assembly that is not in the list, click Browse and locate the
reference on your file system or network.
The list of selected components. The Type column indicates .NET for a
component from the Public Assemblies folder and File for a component that was
added by selecting Browse.
l
To clear an item from the list, select it in the bottom pane and click Remove.
GUI Properties > Advanced Node
Enables you to set advanced recording options for Click & Script Vusers.
HP LoadRunner (12.00)
Page 219 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Record > Recording Options > GUI Properties > Advanced
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
Recording Settings Properties
UI Element
Description
Record
renderingrelated
property
values
Records the values of the rendering-related properties of DOM objects (for
example, offsetTop), so that they can be used during replay. Note that this may
significantly decrease the replay speed.
Default value: disabled.
Record
'click' by
mouse
events
Records mouse clicks by capturing mouse events instead of capturing the click
() method. Enable when the recorded application uses the DOM click() method,
to prevent the generation of multiple functions for the same user action.
Default value: enabled.
Record
socket level
data
Enables the recording of socket level data. If you disable this option you will
need to manually add the starting URL before recording. In addition, you will be
unable to regenerate the script on an HTML level.
Default value: enabled.
Generate
snapshots
for Ajax
steps
Enables generation of snapshots for Ajax steps. Enabling this option can result
in errors during recording.
Default value: disabled.
Code Generation Settings Properties
UI Element
Description
Enable
generation of
out-of-context
steps
Creates a URL-based script for ActiveX controls and Java applets, so that they
will be replayed. Since these functions are not part of the native recording, they
are referred to as out-of-context recording.
Default value: disabled.
Enable
automatic
browser title
verification
Enables automatic browser title verification.
Default value: disabled.
HP LoadRunner (12.00)
Page 220 of 1743
LoadRunner User Guide
Script Workflow
, continued
Perform a
title
verification
for
l
each navigation. Performs a title verification only after a navigation. When
a user performs several operations on the same page, such as filling out a
multi-field form, the title remains the same and verification is not required.
l
each step. Performs a title verification for each step to make sure that no
step modified the browser title. A modified browser title may cause the
script to fail.
l
Perform a title verification using the URL if the title is missing. For
browser windows without a title, perform a title verification for each step
using its URL.
.NET > Recording - Recording Node
This screen enables you to set the recording options for .NET Vuser scripts.
To access
VuGen > Record > Recording Options > Microsoft .NET > Recording
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Code
Generation
Allow you to indicate whether to show warnings, a stack trace, or all event
subscriptions during code generation.
l
Show Warnings. Shows warning messages that are issued during the code
generation process.
l
Show Stack Trace. Shows the recorded stack trace if it is available.
l
Show All Event Subscriptions. Generates code for all event subscriptions
that were recorded. If this option is disabled, VuGen will only generate code
for events in which both the publisher (the object which invokes the event)
and the subscriber (the object informed of the event) are included in the filter.
Default value: disabled.
HP LoadRunner (12.00)
Page 221 of 1743
LoadRunner User Guide
Script Workflow
Debug
Options
Enables you to trace the stack and specify its size.
Stack Trace. Traces the contents of the stack for each invocation within the
script. It allows you to determine which classes and methods were used by
your application. This can be useful in determining which references,
namespaces, classes, or methods to include in your filter. Enabling the trace
may affect your application's performance during recording.
l
l
Default value: disabled.
Stack Trace Limit. The maximum number of calls to be stored in the stack. If
the number of calls exceeds the limit, VuGen truncates it.
Default value: 20 calls.
Filters
l
Ignore all assemblies by default. Ignores all assemblies that are not
explicitly included by the selected filter. If you disable this option, VuGen
looks for a matching filter rule for all assemblies loaded during the recording.
Logging
The Logging options let you set the level of detail that is recorded in the recording
log file.
l
Log severity. Sets the level of logging to Errors Only (default), or Debug.
The severity setting applies for all the logs that you enable below. You should
always use the Errors Only log unless specifically instructed to do otherwise
by HP support, since detailed logging may significantly increase the recording
time.
l
Instrumentation Log. Logs messages related to the instrumentation
process.
l
l
Default value: enabled.
Recording Log. Logs messages issued during recording.
Default value: enabled.
Code Generation Log. Logs messages issued during the code generation
stage.
Default value: enabled.
Remote
Objects
For information about this property, see Remote Objects Property.
HP LoadRunner (12.00)
Page 222 of 1743
LoadRunner User Guide
Script Workflow
Serialization
l
Serialization format. The format of the serialization file that VuGen creates
while recording a class that supports serialization: Binary, XML, or Both.
The advantage of the binary format is that since it is more compressed, it is
quicker. The disadvantage of the binary format is that you do not have the
ability to manipulate the data as you do with XML.
l
Serialize long arrays. For long arrays containing serializable objects (for
example, an array of primitives), use VuGen's serialization mechanism.
Enabling this option generates LrReplayUtils.GetSerializedObject calls if
the array size is equal to or larger than the threshold value.
l
Threshold value for long array size. The threshold size for an array to be
considered a long array.If the array size is equal to or larger than this size,
VuGen serializes it when detecting serializable objects.
Tip: For XML serialization, you can view the content of the XML file. To view the
file, select View XML from the right-click menu.
Remote Objects Property
User interface elements are described below:
UI Element
Description
Record inprocess
objects
Records activity between the client and server when the server is hosted in the
same process as the client. Since the actions are not true client/server traffic,
it is usually not of interest. When in-process methods are relevant, for
example, in certain Enterprise Service applications, you can enable this option
to capture them.
Default value: disabled.
Asynchronous Specifies how VuGen should handle asynchronous calls on remote objects
calls
and their callback methods
l
Call original callbacks by default. Uses the recorded application's
original callback when generating and replaying the script. If the callback
method is explicitly excluded by a filter, the callback will be excluded even
if you enable this option.
l
Generate asynchronous callbacks. This option defines how VuGen will
handle callbacks when the original callbacks are not recorded.
For more information, see "Asynchronous Calls" on page 724.
HP LoadRunner (12.00)
Page 223 of 1743
LoadRunner User Guide
Script Workflow
WCF duplex
binding
Generate dummy callback handler. Replaces the original callback in
duplex communication with a dummy callback, performing the following
actions:
l
l
n
Store arguments. When the server calls the handler during replay, it
saves the method arguments to a key-value in memory map.
n
Synchronize replay. It stops the script execution until the next response
arrives. VuGen places the synchronization at the point that the callback
occurred during recording. This is represented in the script by a warning:
Generate unique client base address. If your application employs dual
HTTP Binding, since HTTP is inherently not a duplex protocol, the
framework uses a standard port to receive response data being passed to
the callback. When you attempt to run multiple instances of your
application, you may be unable to do so using the same port number. This
option replaces the original client base address's port number with a unique
port.
For background information about WCF duplex binding, see "Recording WCF
Duplex Communication" on page 720.
.NET > Shared DLLs
This dialog box enables you to specify the list of shared DLLs before you record a Vuser script. If a
DLL is included in the list of shared DLLs, when the Vuser script is run and requires a particular
DLL, the Vuser will access the DLL in its shared location – the DLL will not be copied to the load
generator. Adding a DLL to the list of shared DLLs therefore saves hard-drive space on the load
generator when a Vuser is run.
Note: The location that you specify for a shared DLL must be accessible to all load generators
on which the Vuser will run.
After you record a Vuser script, the list of shared DLLs is copied from the Recording Options to the
Run-Time Settings. For details on how to view and modify the run-time settings, see ".NET >
Shared DLLs" on page 370.
To access
VuGen > Record > Recording Options > Microsoft .NET > Shared DLLs
See also
".NET > Shared DLLs" on page 370
User interface elements are described below:
UI
Element
Description
HP LoadRunner (12.00)
Page 224 of 1743
LoadRunner User Guide
Script Workflow
DLL
Entries
The list of shared DLLs that VuGen will access while the Vuser script is being
recorded. The order in which the DLLs appear in the list is significant. When a
specific DLL is required, VuGen will access the first instance of that DLL in the list.
If a specific DLL is not currently available, clear the check box to the left of the DLL
entry. The DLL will remain in the list of shared DLLs. To enable the DLL, select the
check box to the left of the DLL entry.
Down Arrow. Moves the selected DLL entry down the list.
Up Arrow. Moves the selected DLL entry up the list.
Add DLL. Enables you to add a DLL to the list of shared DLLs.
Add DLL Folder. This option is always disabled.
Delete. Removes the selected DLL from the list of shared DLLs.
Mobile TruClient Properties > Mobile Device Node
This pane enables you to select a mobile device properties when recording a TruClient Ajax - Mobile
script.
To access
Relevant
tasks
l
VuGen > Recording Options > TruClient Ajax - MobileProperties >
Mobile Device
l
Select Mobile Device button from the Main VuGen Toolbar
"How to Add, Remove, and Import Mobile Device Settings for Mobile TruClient"
on page 716
"How to Record a Script with Mobile TruClient" on page 715
User interface elements are described below:
UI
Element
Description
Mobile
Device
Select the mobile device type you want to test.
HP LoadRunner (12.00)
Page 225 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Description
User
Agent
Specify the header string that is sent to server to identify your mobile device. Once
you have a selected a device, the default header value will appear. However, this
header string can be modified.
Display
Specify the height and width of your mobile device screen. Mobile TruClient will open
browser window according to the display settings.
Network > Port Mapping Node
Enables you to set the port mapping recording options.
To access
VuGen > Record > Recording Options > Network > Port Mapping
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Opens the Server Entry dialog box, allowing you to add a new mapping. For
user interface details, see "Server Entry Dialog Box" on the next page.
Opens the Server Entry dialog box, allowing you to edit the selected entry.
For user interface details, see "Server Entry Dialog Box" on the next page.
Opens the Advanced Settings dialog box to enable auto-detection of the
communication protocol and SSL level. For user interface details, see
"Advanced Port Mapping Settings Dialog Box" on page 229.
<Port Mapping
list>
HP LoadRunner (12.00)
A list of the port mappings. You can temporarily disable any entry by
clearing the check box adjacent to it. When you disable an entry, VuGen
ignores all traffic to that server:port combination. You should disable the
port entry when the data is irrelevant or if the protocol is not supported.
Page 226 of 1743
LoadRunner User Guide
Script Workflow
Capture level
The level of data to capture (relevant only for HTTP based protocols):
Network-level
server address
mappings for
l
Socket level data. Capture data using trapping on the socket level only.
Port mappings apply in this case (default).
l
WinINet level data. Capture data using hooks on the WinINet.dll API
used by certain HTTP applications. The most common application that
uses these hooks is Internet Explorer. Port mappings are not relevant for
this level.
l
Socket level and WinINet level data. Captures data using both
mechanisms. WinINet level sends information for applications that use
WinINet.dll. Socket level sends data only if it determines that it did not
originate from WinINet.dll. Port mapping applies to data that did not
originate from WinINet.dll.
Specifies the mappings per protocol. For example, to show only the FTP
mappings, select FTP.
Server Entry Dialog Box
Enables you to define a server from the server list in the network port mapping node.
To access
VuGen > Record > Recording Options > Network > Port Mapping > New
Entry / Edit Entry
Important
This dialog box is available only for specific protocols. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
246.
User interface elements are described below:
Section
UI Element
Description
Socket Service
Target
Server
The IP address or host name of the target server for which
this entry applies.
Default value: All Servers.
Service ID
A protocol or service name used by the recorder to identify
the type of connection (i.e. HTTP, FTP, and so on). You can
also specify a new name. The name may not exceed 8
characters.
Record Type
The type of recording—directly or through a proxy server.
HP LoadRunner (12.00)
Page 227 of 1743
LoadRunner User Guide
Script Workflow
Port
The port of the target server for which this entry applies.
Entering 0 specifies all ports.
If you do not specify all of the port and server names,
VuGen uses the following priorities in assigning data to a
service:
l
Priority 1: port and server specified
l
Priority 2: port not specified, server specified
l
Priority 3: port specified, server not specified
l
Priority 4: port and server not specified
A map entry with a high priority does not get overridden by
an entry with a lower priority. For example, if you specify
that traffic on server twilight using port 25 be handled as
SMTP and then you specify that all servers on port 25 be
handled as HTTP, the data will be treated as SMTP.
l
SSL
Configuration
HP LoadRunner (12.00)
Forced mapping. If you specify a mapping for a port
number, server name, or combination server:port,
VuGen forces the network traffic to use that service. For
example, if you were to specify <Any> server on port 80
to use FTP, VuGen uses the FTP protocol to record that
communication, even though the actual communication
may be HTTP. In this instance, the Vuser script might be
empty.
Service Type
The type of service, currently set to TCP.
Connection
Type
The security level of the connection: Plain (non-secure),
SSL, or Auto. If you select Auto, the recorder checks the
first 4 bytes for an SSL signature. If it detects the SSL
signature, it assumes that SSL is being used.
SSL Version
The preferred SSL version to use when communicating with
the client application and the server.
Default value: SSL 2/3. However some services require
SSL 3.0 only or SSL 2.0 only. Some new wireless
applications require a the Transport Layer Security
algorithm, TLS 1.x.
SSL Cipher
The preferred SSL cipher to use when connecting with a
remote secure server.
Use
specified
client-side
certificate
The default client-side certificate to use when connecting to
a remote server. Specify or browse for a certificate file in
txt, crt, or pem format, and supply a password.
Page 228 of 1743
LoadRunner User Guide
Script Workflow
Use
specified
proxy-server
certificate
The default server certificate to present to client
applications that request a server certificate. Specify or
browse for a certificate file in txt, crt, or pem format, and
supply a password. Click Test SSL to check the
authentication information against the server.
Advanced Port Mapping Settings Dialog Box
Enables you to set the advanced port mapping settings. For more information, see "Port Mapping
Auto Detection" on page 250.
To access
VuGen > Record > Recording Options > Network > Port Mapping >
Options
Important
This dialog box is available only for specific protocols. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
246.
User interface elements are described below:
UI Element
Description
Enable auto
SSL detection
Automatically detects SSL communication. Specify the version and default
cipher that you want to detect. Note that this only applies to port mappings
that were defined as auto in the Connection type box, or not defined at all. If
a server, port, or server:port combination was defined as either Plain or SSL,
then auto SSL detection does not apply.
Enable auto
detection of
SOCKET based
communication
Automatically detects the type of communication. If required, raise the
maximum number of transitions, one at a time until VuGen succeeds in
detecting the protocol. You can also gradually increase the maximum buffer
size by 1024 bytes (1 KB) at a time until VuGen succeeds in detecting the
protocol. This allows VuGen to review a larger amount of data in order to find
a signature.
Log Level
Sets the logging level for the automatic socket detection.
RDP > Code Generation > Advanced Node
Enables you to control the way VuGen creates an RDP script. Only advanced users are advised to
modify these settings.
To access
VuGen > Record > Recording Options > RDP > Code Generation - Adv
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
HP LoadRunner (12.00)
Page 229 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Correlate
clipboard
parameters
Replaces the recorded clipboard text sent by the user with the correlated
parameter containing the same text as received from the server.
Doubleclick
timeout
(msec)
The maximum time (in milliseconds) between two consecutive mouse button
clicks to be considered a double-click.
Default value: 500 milliseconds.
Prefix for
clipboard
parameters
The prefix for clipboard parameters generated in the current script. This is useful
when merging scripts, allowing you to specify a different prefix for each script.
Default value:ClipboardDataParam_.
Prefix for
snapshot
names
The prefix for snapshot file names generated in the current script. This is useful
when merging scripts—you can specify a different prefix for each script.
Default value: snapshot_.
RDP > Code Generation > Agent Node
Enables you to control the way the agent for Microsoft Agent for Terminal Server functions with
VuGen during recording.
To access
VuGen > Record > Recording Options > RDP > Code Generation - Agent
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Description
Element
Use
RDP
agent
Generates script using extended information gathered by the RDP agent. The
LoadRunner RDP agent must be installed on the server. For details, see "How to
Install / Uninstall the RDP Agent" on page 755.
Note: To utilize this feature, you must enable the Replay with RDP agent Run Time
settings. For details, see "RDP > RDP Agent Node" on page 374
HP LoadRunner (12.00)
Page 230 of 1743
LoadRunner User Guide
Script Workflow
Enable
RDP
agent
log
Enables the RDP agent log.
l
RDP agent log detail level. Configures the level of detail generated in the RDP
agent log with Standard being the lowest level of detail and Extended Debug
being the highest level of detail.
l
RDP agent log destination. Configures the destination of the RDP agent log
data. File saves the log messages only on the remote server side. Stream sends
the log messages to the VuGen machine. FileAndStream sends the log
messages to both destinations.
l
RDP agent log folder. The folder path on the remote server that the RDP agent
log file will be generated in.
RDP > Code Generation > Basic Node
Enables you to control the way VuGen creates a script—the level of detail, triggers, and timeouts.
To access
VuGen > Record > Recording Options > RDP > Code Generation - Basic
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Always
generate
connection
name
If selected, function call will contain the ConnectionName parameter. If not
selected, the functions will only contain this parameter if more than a single
rdp_connect_server appears in the script.
Default value: disabled.
Automatic
generation of
synchronization
points
Synchronization points allow the script to pause in the replay while waiting
for a window or dialog to pop-up, or some other control to fulfil a certain
condition. This option automatically generates sync_on_image functions
before mouse clicks and drags (enabled by default). The Sync radius is the
distance from the mouse operation to the sides of the rectangle which
defines the synchronization area. The default is 20 pixels. Select one of the
following options:
HP LoadRunner (12.00)
l
None. No synchronization points are automatically added.
l
Rectangular. Creates synchronization points as rectangular boxes
centered around the click or drag location.
l
Enhanced. Creates synchronization points designed to select only the
desired location (e.g. a button) and to react to changes in the UI (e.g. the
button moves). If a synchronization region is not recognized, the
rectangular synchronization settings are used.
Page 231 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Generate
mouse
movement calls
Generates rdp_mouse_move calls in the script. When enabled, this option
significantly increases the script size.
Default value: disabled.
Generate raw
keyboard calls
Generates rdp_raw_key_up/down calls as if the script level was set to
Raw. Mouse calls will still be generated according to the script level. If
disabled, VuGen generates Keyboard calls according to the script level. If the
script level is set to Raw, this option is ignored.
Default value: disabled.
Generate raw
mouse calls
Generates rdp_mouse_button_up/down calls as if the script level was set
to Raw. Keyboard calls will still be generated according to the script level. If
disabled, VuGen generates Mouse calls according to the script level. If the
script level is set to Raw, this option is ignored.
Default value: disabled.
Script
generation level
The level of the script and the type of API functions to use when generating
the script.
l
High. Generate high level scripts. Keyboard events are translated to rdp_
type calls. Two consecutive mouse clicks with the same coordinates are
translated as a double-click.
l
Low. Generate low level scripts. Key up/down events are translated into
rdp_key events. Modifier keys (Alt, Ctrl, Shift) are used as a
KeyModifier parameter for other functions. Mouse up/down/ move
events are translated to mouse click/drag events.
l
Raw. Generates a script on a raw level, by extracting input events from
network buffers and generating calls in their simplest form: key up/down,
mouse up/down/move. The KeyModifier parameter is not used.
RDP > Client Startup Node
Enables you to set the RDP client startup recording options.
To access
VuGen > Record > Recording Options > RDP > Client Startup
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 232 of 1743
LoadRunner User Guide
Script Workflow
Run RDP
client
application
Connects to the terminal server by running the Terminal Services client.
Use custom
connection
file
Connects to the terminal server by using an existing connection file. The file
should have an *.rdp extension. You can browse for the file on your file system or
network.
Use default
connection
file
Connects to the terminal server by using the Default.rdp file in your document's
folder.
Recording Properties > Corba Options Node
Enables you to set the CORBA specific recording properties and several callback options.
To access
VuGen > Record > Recording Options > Recording Properties > Corba
Options
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Record
CallBack
Connection
Instructs VuGen to generate a connect statement for the connection to the ORB,
for each callback object.
Default value: disabled.
Record DLL
only
Instructs VuGen to record only on a DLL level.
Default value: disabled.
Record
Properties
Instructs VuGen to record system and custom properties related to the protocol.
Default value: enabled.
Resolve
CORBA
Objects
When correlation fails to resolve a CORBA object, recreate it using its binary
data.
Default value: disabled.
Show IDL
Constructs
Displays the IDL construct that is used when passed as a parameter to a
CORBA invocation.
Default value: enabled.
Use local
vendor
classes
Use local vendor classes and add the srv folder to the BOOT classpath. If you
disable this option, VuGen uses network classes and adds the script's classes
to the classpath.
Default value: enabled.
Vendor
The CORBA vendors: Inprise Visibroker, Iona OrbixWeb, or Bea Weblogic.
HP LoadRunner (12.00)
Page 233 of 1743
LoadRunner User Guide
Script Workflow
Recording Properties > Correlation Options Node
Allows you to enable automatic correlation, and control its depth.
To access
VuGen > Record > Recording Options > Recording Properties >
Correlation Options
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Advanced
Enables correlation on complex objects such as arrays and CORBA container
Correlation constructs and arrays. This type of correlation is also known as deep correlation.
Default value: enabled.
Correlate
Collection
Type
Correlates objects from the Collection class for JDK 1.2 and higher.
Default value: disabled.
Correlate
String
Arrays
Correlate strings within string arrays during recording. If disabled, strings within
arrays are not correlated and the actual values are placed in the script.
Default value: enabled.
Correlate
Strings
Correlate strings in script during recording. If disabled, the actual recorded values
are included in the script between quotation marks and all other correlation options
are ignored
Default value: disabled.
Correlation Indicates the level of deep correlation, the number of inner containers to be
Level
scanned.
Default value: 15.
Recording Properties > Log Options Node
Enables you to determine the level of debug information generated during recording.
To access
VuGen > Record > Recording Options > Recording Properties > Log
Options
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
HP LoadRunner (12.00)
Description
Page 234 of 1743
LoadRunner User Guide
Script Workflow
Class Dumping
Dumps all of the loaded classes to the script folder. Default value:
disabled.
Digest
Calculation
Generate a digest of all recorded objects.
Default value: disabled.
l
Exclude from Digest. A list of objects not to be included in the digest
calculation.
Syntax: java.lang.Object class format, delimiter = ","
Log Level
The level of recording log to generate:
Synchronize
Threads
l
None. No log file is created
l
Brief. Generates a standard recording log and output redirection
l
Detailed. Generates a detailed log for methods, arguments, and return
values.
l
Debug. Records hooking and recording debug information, along with all
of the above.
For multi-threaded applications, instructs VuGen to synchronize between
the different threads.
Default value: disabled.
Recording Properties > Recorder Options Node
Enables you to set the Java protocol to record as well as other protocol specific recording options.
To access
VuGen > Record > Recording Options > Recording Properties > Recorder
Options
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Byte Array
Format
The format of byte arrays in a script: Regular, Unfolded Serialized Objects,
or Folded Serialized Objects. Use one of the serialized object options when
recording very long byte arrays.
Default value: Regular.
Bytes as
Characters
Displays readable characters as characters with the necessary casting—
not in byte or hexadecimal form.
Default value: enabled.
HP LoadRunner (12.00)
Page 235 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Comment Lines
Containing
Comment out all lines in the script containing one of the specified strings. To
specify multiple strings, separate the entries with commas.
Default value: Any line with a string containing <undefined> will be
commented out.
Extensions List
A comma separated list of all supported extensions. Each extension has its
own hooks file.
Default value: JNDI.
Insert
Functional
Check
Inserts verification code that compares the return value received during
replay, to the expected return value generated during recording. This option
only applies to primitive return values.
Default value: disabled.
Load Parent
Class Before
Class
Change the loading order so that parent classed are loaded before child
classes. This helps identify hooking for trees with deep inheritance.
Default value: enabled.
Record
LoadRunner
Callback
Records the LoadRunner stub object as a callback. If disabled, VuGen
records the original class as the callback.
Default value: enabled.
Recorded
Protocol
Specifies which protocol to record: RMI, CORBA, JMS, or Jacada.
Default value: RMI.
Remove Lines
Containing
Remove all lines containing one of the specified strings from the script. To
specify multiple strings, separate the entries with commas. This feature is
useful for customizing the script for a specific testing goal.
Unreadable
Strings as Bytes
Represents strings containing unreadable characters as byte arrays. This
option applies to strings that are passed as parameters to invocations.
Default value: enabled.
Use _JAVA_
OPTIONS flag
Forces JVM versions 1.2 and higher to use the _JAVA_OPTION
environment variable which contains the desired JVM parameters.
Default value: disabled.
Use DLL
hooking to
attach
LoadRunner
support
Use DLL hooking to automatically attach LoadRunner support to any JVM.
Recording Properties > Serialization Options Node
Enables you to control how objects are serialized. Serialization is often relevant to displaying
objects in an ASCII representation in order to parameterize their values.
HP LoadRunner (12.00)
Page 236 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Record > Recording Options > Recording Properties >
Serialization Options
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, "Protocol Compatibility Table" on page 246.
See also
"How to Correlate Scripts - Java Scripts - Serialization" on page 296
User interface elements are described below:
UI
Element
Description
Unfold
Expands serialized objects in ASCII representation and allows you to view the
Serialized ASCII values of the objects in order to perform parameterization.
Objects
l Limit Object Size (bytes). Limits serializable objects to the specified value.
Objects whose size exceeds this value, will not be given ASCII representation in
the script.
Default value: 3072 bytes.
Ignore Serialized Objects. Lists the serialized objects not to be unfolded when
encountered in the recorded script. Separate objects with commas.
l
Syntax: java.lang.Object class format, delimiter = ","
l
Serialization Delimiter. Indicates the delimiter separating the elements in the
ASCII representation of objects. VuGen will only parameterize strings contained
within these delimiters. The default delimiter is `#'.
l
Unfold Arrays. Expands array elements of serialized objects in ASCII
representation. If you disable this option and an object contains an array, the
object will not be expanded.
Default value: enabled—all deserialized objects are totally unfolded.
n
Limit Array Entries. Instructs the recorder not to open arrays with more than
the specified number of elements. Default value: 200.
RTE > Configuration Node
Enables you to set the recording options to match the character set used during terminal emulation.
To access
VuGen > Record > Recording Options > RTE > Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
HP LoadRunner (12.00)
Page 237 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Description
Character Match the character set used during terminal emulation. The default character set is
Set
ANSI. For Kanji and other multi-byte platforms, you can specify DBCS (Double-byte
Character Set).
RTE > RTE Node
Enables you to set the general RTE recording options.
To access
VuGen > Record > Recording Options > RTE > RTE
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
Generate
Automatically generates a number of TE-synchronization functions, and
automatic
insert them into the script while you record.
synchronization
l Cursor. Generate a TE_wait_cursor function before each TE_type
commands
function.
l
Prompt. Generate a TE_wait_text function before each TE_type function
(where appropriate).
l
X-System. Generate a TE_wait_sync function each time a new screen is
displayed while recording.
Note: VuGen generates meaningful TE_wait_text functions when
recording VT type terminals only. Do not use automatic TE_wait_text
function generation when recording block-mode (IBM) terminals.
Generate
automatic XSystem
transaction
HP LoadRunner (12.00)
Records the time that the system was in the X SYSTEM mode during a
scenario run. This is accomplished by inserting a TE_wait_sync_
transaction function after each TE_wait_sync function. Each TE_wait_
sync_transaction function creates a transaction with the name default.
Each TE_wait_sync_transaction function records the time that the system
spent in the previous X SYSTEM state.
Page 238 of 1743
LoadRunner User Guide
Script Workflow
Generate screen Generates screen header comments while recording a Vuser script, and
header
inserts the comments into the script. A generated comment contains the text
comments
that appears on the first line of the terminal emulator window.
Note: You can generate comments automatically only when using
block-mode terminal emulators such as the IBM 5250.
Keyboard
record timeout
When you type text into a terminal emulator while recording, VuGen monitors
the text input. After each keystroke, VuGen waits up to a specified amount of
time for the next key stroke. If there is no subsequent keystroke within the
specified time, VuGen assumes that the command is complete.
SAPGUI > Auto Logon Node
Enables you to log on automatically when you begin recording. The logon functions are placed in the
vuser_init section of the script.
To access
VuGen > Record > Recording Options > SAPGUI > Auto Logon
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Element
Description
Enable
Auto
logon
Enables you to log on automatically when you begin recording. Enter the Server
name, User, Password, Client name, and interface Languages for the SAP server.
SAPGUI > Code Generation Node
Enables you to set the code generation settings for the SAPGUI protocol.
To access
VuGen > Record > Recording Options > SAPGUI > Code Generation
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 239 of 1743
LoadRunner User Guide
Script Workflow
Always
generate
Object ID in
header file
Places the Object IDs in a separate header file instead of in the script. When you
disable this option, VuGen generates the IDs according to the specified string
length in the general script setting. This results in a more compact and cleaner
script.
Generate Fill Generates Fill Data steps for table and grid controls—instead of separate steps
Data steps
for each cell.
Generate
Generates a single sapgui_logon method for all of the logon operations. This
logon
helps simplify the code. If you encounter login problems, disable this option.
operation as
a single step
SAPGUI > General Node
Enables you to set the general recording options for the SAPGUI protocol.
To access
VuGen > Record > Recording Options > SAPGUI > General
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
User interface elements are described below:
UI
Element
Description
Capture
Indicates how to save the snapshots of the SAPGUI screens as they appear during
screen
recording: ActiveScreensnapshots, Regular snapshots, or None. ActiveScreen
snapshots snapshots provide more interactivity and screen information after recording, but
they require more resources.
Changing
events
during
recording
Process Context menus by text. Processes context menus by their text,
generating sapgui_toolbar_select_context_menu_item_by_text functions.
When disabled, VuGen processes context menus by their IDs, and generates a
sapgui_toolbar_select_context_menu_item for context menus. This is an
advantage when working with Japanese characters.
Silverlight > Services Node
Enables you to manage WSDL files in Silverlight Protocol scripts.
To access
VuGen > Record > Recording Options > Silverlight > Services
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
Relevant
tasks
"How to Import WSDL Files" on page 801
HP LoadRunner (12.00)
Page 240 of 1743
LoadRunner User Guide
Script Workflow
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Service list>
The list of imported WSDL files and their locations. The toolbar
allows you to add, delete and edit WSDL files. Additionally, select
the Protocol and Security Data button to edit Protocol and Security
Data.
Automatically detect
WSDL files and import
services during code
generation
Automatically attempts to locate and import WSDL files used in
your script.
Do not use WSDL files
Disables WSDL files in your script, generating SOAP requests
instead. This results in a lower level script, however it generally
increases the script performance.
Service Endpoint
The location of the endpoint at which a given WSDL is available.
Use WSDL files
included in the script
Enables WSDL files imported automatically or manually.
WSDL Location
The location of the selected WSDL file.
Add / Edit Services Dialog Box
Enables you to locate and import WSDLs to a Silverlight Protocol script.
To access
VuGen > Record > Recording Options > Silverlight > Services > Add
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
Relevant
tasks
"How to Import WSDL Files" on page 801
User interface elements are described below:
UI Element
Description
Opens the Connection Settings dialog box, enabling you to configure the
proxy and authentication information for the specified WSDL file. For
user interface information, see "Connection Settings Dialog Box" on the
next page.
HP LoadRunner (12.00)
Page 241 of 1743
LoadRunner User Guide
Script Workflow
Select WSDL from
l
URL. Select the WSDL by specifying the URL.
l
File. Select the WSDL by specifying the local path.
l
Previously Imported. Select the WSDL from the WSDL History (list
of previously imported WSDL files).
Service Endpoint
The location of the endpoint at which a given WSDL is available.
WSDL Location
The URL or local path to the WSDL.
Connection Settings Dialog Box
Configures the proxy and authentication information for WSDL files in Silverlight Protocol scripts.
To access
VuGen > Record > Recording Options > Silverlight > Services > Add >
Connection Settings
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
l
These settings are only relevant for importing WSDL files. To configure
authentication and proxy information for WSDL files to be used during replay,
add a web_set_user_step function with the desired values.
Relevant
tasks
"How to Import WSDL Files" on page 801
User interface elements are described below:
UI Element
Description
Authentication Enable the authentication settings by selecting Use Authentication Settings
and entering your user name and password.
Proxy
Enable the proxy settings by selecting Use Proxy Settings and entering your
user name, password, server, and port number.
Protocol and Security Scenario Data Dialog Box
Enables you to configure the protocol and security scenario data settings.
To access
VuGen > Record > Recording Options > Silverlight > Services > Protocol
and Security Data Button
HP LoadRunner (12.00)
Page 242 of 1743
LoadRunner User Guide
Script Workflow
Important
information
Relevant
tasks
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 246.
l
These settings are only relevant for importing WSDL files. To configure
authentication and proxy information for WSDL files to be used during replay,
add a web_set_user_step function with the desired values.
l
The settings in this dialog box are reset during code generation.
"How to Import WSDL Files" on page 801
User interface elements are described below:
UI Element
Description
Port
An individual endpoint for a WSDL binding.
Note:
Transport
The transport layer protocol used by VuGen to send service requests to the
server. You can select HTTP, HTTPS, or LrHTTP.
Note: HTTP is not compatible with UserNameOverTransport security and
HTTPS requires that you select UserNameOverTransport security.
Encoding
The encoding method to be used for service requests sent to the server.
WS
Addressing
version
The WS-Addressing version for the selected WSDL file.
Security
Authentication Enable authentication by selecting UserNameOverTransport mode.
mode
Default mode: None.
Username
When authentication is enabled, a valid username is required.
Password
When authentication is enabled, a valid password is required.
Traffic Analysis > Traffic Filter
This dialog box enables you to filter either incoming or outgoing traffic.
HP LoadRunner (12.00)
Page 243 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Record > Recording Options > Traffic Analysis > Traffic Filters
Important
information
l
For details, see "Analyzing Traffic" on page 698.
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see the "Protocol Compatibility Table"
on page 246.
Relevant
tasks
"How to Create a Script by Analyzing Traffic" on page 704
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
When generating
the script
Include all IP addressing the list. check box to include traffic from
specified IP address.
Exclude all IP address in the list. check box to exclude traffic from
specified IP addresses.
<Incoming Traffic Tab>
Enables you to identify IP addresses for incoming traffic
Add an IP address
Source IP
Specify the IP address of the server.
Delete IP address
<Outgoing Traffic Tab>
Enables you to identify IP addresses for outgoing traffic
Add an IP address
Destination IP
Specify the IP address of the server.
Destination Port
Specify the destination port of the server.
Delete IP address
WinSock Node
Enables you to set the WinSock recording options.
To access
VuGen > Record > Recording Options > WinSock
HP LoadRunner (12.00)
Page 244 of 1743
LoadRunner User Guide
Script Workflow
Important
information
When using translation tables on Solaris machines, you must set the following
environment variables on all machines running scripts:
setenv LRSDRV_SERVER_FORMAT 0025
setenv LRSDRV_CLIENT_FORMAT 04e4
Relevant
tasks
"How to Record a Windows Sockets Script" on page 959
User interface elements are described below:
UI Element
Description
Adds a new entry to the list of excluded sockets.
Removes the selected entry from the list of excluded sockets.
Do not
include
excluded
socket in
log
Excludes the sockets on the list from the log. Clearing this option enables logging
for the excluded sockets. Their actions are preceded by "Exclude" in the log file.
Exclude
Settings/
Socket List
The host and port of the sockets to exclude from the recording or regeneration of
the script. Use the following syntax:
Encoding
Method
l
host:port format excludes a specific port.
l
host format excludes all ports for the specified host.
l
:port format excludes a specific port on the local host.
l
*:port format excludes a specific port on all hosts.
Use OEM encoding. Enable data encoding that supports non-English characters.
Use ASCII encoding. Enable data encoding that is limited to English characters.
Use this option to replicate the LR 9.5x data encoding method.
Think Time During recording, VuGen automatically inserts the think time steps when you
Threshold pause between actions. You can set a threshold level, below which the recorded
think time will be ignored.
Default value: five seconds.
HP LoadRunner (12.00)
Page 245 of 1743
LoadRunner User Guide
Script Workflow
Translation The Translation Table lets you specify the format for recording sessions when
tables
using the WinSock single protocol, and for code generation when using a WinSock
multi protocol. This applies to users running on mainframe machines or AS/400
servers. Both the server and client machines determine the format of the data from
translation tables installed on your system. Select a translation option from the list
box.
The first four digits of the listbox item represent the server format. The last four
digits represent the client format.
The translation tables are located in the ebcdic folder under the VuGen's
installation folder. If your system uses different translation tables, copy them to
the ebcdic folder.
Note: If your data is in ASCII format, it does not require translation. Select the
None option, the default value.
Recording Options - Miscellaneous Topics
This section contains a variety of topics relating to recording options.
Protocol Compatibility Table
The following table lists the Vuser protocols and which recording option nodes are available for each
protocol.
Protocol
Recording Options Nodes
Ajax - Click &
Script
l
General - Script, Recording
l
GUI Properties - Advanced, Web Event Configuration
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
Ajax TruClient
l
None
C Vuser
l
None
Citrix ICA
l
General - Script
l
Citrix - Configuration, Recorder, Code Generation, Login
l
General - Script
l
COM/DCOM - Filter, Options
l
None
COM/DCOM
DNS
HP LoadRunner (12.00)
Page 246 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Recording Options Nodes
FTP
l
General - Script
l
Network - Port Mapping
l
General - Script, Protocols, Recording
l
Flex - RTMP, Configuration, Externalizable Objects, AMF
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
General - Script
l
Network - Port Mapping
l
General - Recording
l
Java Environment Settings - Java VM, Classpath
l
Network - Port Mapping
l
HTTP Properties - Browser, Recording Proxy, Advanced, Correlation
l
Java Environment Settings - Java VM, Classpath
l
Recording Properties - Recorder Options, Serialization Options,
Correlation Options, Log Options, Corba Options
Java Vuser
l
None
LDAP
l
General - Script
MMS (Media
Player)
l
None
Microsoft .NET
l
General - Script
l
.NET - Recording, Filters
l
General - Script
l
RDP - Client Startup, Code Generation (Basic, Advanced, and Agent)
l
Network - Port Mapping
l
None
Flex (AMF/RTMP)
IMAP
Java over HTTP
Java Record
Replay
Microsoft Remote
Desktop Protocol
(RDP)
MAPI (Microsoft
Exchange)
HP LoadRunner (12.00)
Page 247 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Recording Options Nodes
MMS (Multimedia
Messaging
Service)
l
General - Script
ODBC
l
General - Script
l
Database - Database
l
General - Script
l
Database - Database
l
General - Script, Protocols, Recording
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
General - Script, Recording
l
GUI Properties - Advanced, Web Event Configuration
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
General - Script
l
Network - Port Mapping
l
General - Script, Recording
l
GUI Properties - Advanced, Web Event Configuration
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
General - Script, Recording
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
General - Script
l
SAP GUI - General, Code Generation, Auto Logon
Oracle (2-Tier)
Oracle NCA
Oracle Web
Applications 11i
POP3
SAP Click & Script
SAP - Web
SAP GUI
HP LoadRunner (12.00)
Page 248 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Recording Options Nodes
Siebel - Web
l
General - Script, Protocols, Recording
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
General - Script, Protocols, Recording
l
Silverlight - Services
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
Data Format Extensions - Chain Configuration, Code Generation
l
General - Script
l
Network - Port Mapping
l
General - Script, Protocols, Recording
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
Data Format Extension - Chain Configuration, Code Generation
l
General - Script, Protocols, Recording
l
Traffic Analysis - Traffic Filters
l
Network - Port Mapping
l
HTTP Properties - Advanced, Correlation
l
Sockets - Winsock
Silverlight
SMTP
Web (HTTP/HTML)
Web Services
Windows Sockets
Port Mapping Overview
When recording Vuser scripts that record network traffic on a socket level (HTTP, SMTP, POP3,
FTP, IMAP, Oracle NCA and WinSock), you can set the Port Mapping options. Using these
options, you can map the traffic from a specific server:port combination to the desired
communication protocol.
The available communication protocols to which you can map are FTP, HTTP, IMAP, NCA, POP3,
SMTP, and SOCKET. You create a mapping by specifying a server name, port number, or a
complete server:port combination. For example, you can indicate that all traffic from the server
twilight on port 25, should be handled as SMTP. You can also specify that all traffic from the server
HP LoadRunner (12.00)
Page 249 of 1743
LoadRunner User Guide
Script Workflow
called viper, should be mapped to the FTP protocol, regardless of the port. Additionally, you can
map all traffic on port 23 to SMTP, regardless of the server name.
When recording in multi-protocol mode, If at least one of the protocols records on a socket level, the
Port Mapping node will be available. The only exception is when you record HTTP or WinSock as a
single protocol script.
Port Mapping Auto Detection
VuGen's advanced port-mapping options let you configure the auto-detection options. VuGen's
auto-detection analyzes the data that is sent to the server. It checks the data for a signature, a
pattern in the data's content, that identifies the protocol. For the purpose of detecting a signature, all
of the send buffers until the first receive buffer, are combined. All send buffers that were sent until a
receive buffer is returned, are considered a single data transition. By default, no mappings are
defined and VuGen employs auto-detection. In some protocols, VuGen determines the type in a
single transition, (such as HTTP). Other network protocols require several transitions before
determining the type. For this purpose, VuGen creates a temporary buffer for each server-port
combination. If VuGen cannot determine the protocol type by reading the first transition buffers, it
stores the data in a temporary buffer. It continues to read the incoming buffers until it detects a
signature of a specific protocol.
By default, VuGen allows 4 transitions and uses a temporary buffer of 2048 bytes in order to detect
a protocol signature. If VuGen has not yet determined the type after reaching the maximum number
of transitions, or after reaching the maximum buffer size, it assigns the data to the WinSock
protocol. If you did not instruct VuGen to record the WinSock protocol (in the multi-protocol
selection), VuGen discards the data.
You can change the maximum number of buffers you want VuGen to read in order to detect the
protocol type. You can also specify the size of the temporary buffer. In instances where the amount
of data in the first send buffers, is greater than the size of the temporary buffer, VuGen cannot autodetect the protocol type. In this case, you should increase the size of the temporary buffer.
When working with the above network level protocols, we recommend that you allow VuGen to use
auto-detection to determine the protocol type. In most cases, VuGen's recorder is able to recognize
the signatures of these protocols. It then automatically processes them according to the protocol
specifications. In certain instances, however, VuGen may be unable to recognize the protocol. For
example:
l
The protocol signature closely resembles an existing protocol, resulting in erroneous processing.
l
There is no unique signature for the protocol.
l
The protocol uses SSL encryption, and therefore cannot be recognized on a WinSock level.
In all of the above cases, you can supply information to uniquely identify the server and port hosting
the protocol.
HP LoadRunner (12.00)
Page 250 of 1743
LoadRunner User Guide
Script Workflow
EUC-Encoding (Japanese Windows only)
When working with non-Windows standard character sets, you may need to perform a code
conversion. A character set is a mapping from a set of characters to a set of integers. This mapping
forms a unique character-integer combination for a given alphabet. Extended UNIX Code (EUC)
and Shift Japan Industry Standard (SJIS) are non-Windows standard character sets used to display
Japanese characters on Web sites.
Windows uses SJIS encoding, while UNIX uses EUC encoding. When a Web server is running
UNIX and the client is running Windows, the characters in a Web site are not displayed on the client
machine properly due to the difference in the encoding methods. This affects the display of EUCencoded Japanese characters in a Vuser script.
During recording, VuGen detects the encoding of a Web page through its HTTP header. If the
information on the character set is not present in the HTTP header, it checks the HTML meta tag.
If you know in advance that a Web page is encoded in EUC, you can instruct VuGen to use the
correct encoding by using the recording options. To record a page in EUC-encoding, enable the
EUC option in the Recording Options Recording node (only visible for Japanese Windows).
Enabling the EUC option forces VuGen to record a Web page in EUC encoding, even when it is not
EUC-encoded. Therefore, you should only enable this option when VuGen cannot detect the
encoding from the HTTP header or the HTML meta tag or when you know in advance that the page
is EUC-encoded.
During recording, VuGen receives an EUC-encoded string from the Web server and converts it to
SJIS. The SJIS string is saved in the script's Action function. However, for replay to succeed, the
string has to be converted back to EUC before being sent back to the Web server. Therefore,
VuGen adds a web_sjis_to_euc_param function before the Action function, which converts the
SJIS string back to EUC.
In the following example, the user navigates to an EUC-encoded Web page and clicks a link.
VuGen records the Action function and adds the web_sjis_to_euc_param function to the script
before the Action function.
web_sjis_to_euc_param("param_link","Search");
web_link("LinkStep","Text={param_link}");
For more information, see "Advanced URL Dialog Box" on page 201.
Script Generation Preference Overview
Before you record a session, VuGen allows you to specify a language for script generation. The
available languages for script generation vary per protocol. The most common available languages
are C and Java. By default, VuGen generates a script in the most common language for that
protocol, but you can change this through the Script recording options node.
For user interface details, see "General > Script Node" on page 203.
Tip: If you record a script in one language, you can regenerate it in another language after the
HP LoadRunner (12.00)
Page 251 of 1743
LoadRunner User Guide
Script Workflow
recording. For task details, see "How to Regenerate a Vuser Script" on page 266.
After you select a generation language, you can enable language-specific recording options which
instruct the recorder what to include in the script and how to generate it.
If at least one of the protocols you are recording has multi-protocol capabilities, the Script node will
be available except when you record HTTP or WinSock as a single protocol script.
Script Language Options
When you record a session, VuGen creates a script that emulates your actions. The default script
generation language is C. The following list specifies which protocols are appropriate for each
language:
l
C. For recording applications that use complex COM constructs and C++ objects.
l
C #. For recording applications that use complex applications and environments (MS .NET
protocol only).
l
Visual Basic .NET. For VB .NET applications using the full capabilities of VB.
After the recording session, you can modify the script with regular C, C#, or VB .NETcode and
control flow statements.
Recording Levels - Overview
VuGen lets you specify what information to record and which functions to use when generating a
Vuser script by selecting a recording level in the General > Recording node of the Recording
Options dialog box. The recording level you select depends on your needs and environment. The
available levels are HTML-based script and URL-based script. For user interface information,
see "General > Recording Node" on page 200.
The following examples show scripts using the three recording levels:
HTML-based script
Generates a separate step for each HTML user action. The steps are intuitive, but they do not
reflect true emulation of the JavaScript code.
/* HTML-based mode - a script describing user actions*/
...
web_url("WebTours",
"URL=http://localhost/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_link("Click Here For Additional Restrictions",
HP LoadRunner (12.00)
Page 252 of 1743
LoadRunner User Guide
Script Workflow
"Text=Click Here For Additional Restrictions",
"Snapshot=t4.inf",
LAST);
web_image("buttonhelp.gif",
"Src=/images/buttonhelp.gif",
"Snapshot=t5.inf",
LAST);
...
URL-based script
Records all browser requests and resources from the server that were sent due to the user's
actions. Automatically records all HTTP resources as URL steps (web_url statements). For
normal browser recordings, it is not recommended to use the URL-based mode since is more prone
to correlation related issues. However, if you are recording pages such as applets and non-browser
applications, this mode is ideal.
URL-based scripts are not as intuitive as the HTML-based scripts since all actions are recorded as
web_url steps instead of web_link, web_image, and so on.
/* URL-based mode - only web_url functions */
...
web_url("spacer.gif",
"URL=http://graphics.hplab.com/images/spacer.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=",
"Mode=HTTP",
LAST);
web_url("calendar_functions.js",
"URL=http://www.im.hplab.com/travelp/calendar_functions.js",
"Resource=1",
"RecContentType=application/x-javascript",
"Referer=",
"Mode=HTTP",
LAST);
...
You can switch recording levels and advanced recording options while recording, provided that you
are not recording a multi-protocol script. The option of combining recording levels is available to
advanced users for performance testing.
You can also regenerate a script after recording, using a different method than the original recording.
For example, if your record a script on an HTML-based level, you can regenerate it on a URL-based
level. To regenerate a script, select Record > Regenerate Script and click Options to set the
recording options for the regeneration.
Serialization Overview
VuGen uses serialization when it encounters an unknown object during the recording, provided that
the object supports serialization. An unknown object can be an input argument which was not
HP LoadRunner (12.00)
Page 253 of 1743
LoadRunner User Guide
Script Workflow
included by the filter and therefore its construction was not recorded. Serialization helps prevent
compilation errors caused by the passing of an unknown argument to a method. If an object is
serialized, it is often advisable to set a custom filter to record this object. For details, see "How to
Serialize Flex Scripts " on page 645.
Tips for Working with Event Listening and Recording
It can sometimes be difficult to find the ideal listen and recording settings. When defining these
settings, keep in mind the following guidelines:
To record an event on an object, you must instruct VuGen to listen for the event, and to record
the event when it occurs. You can listen for an event on a child object, even if a parent object
contains the handler or behavior, or you can listen for an event on a parent object, even if the
child object contains the handler or behavior.
l
However, you must enable recording for the event on the source object (the one on which the
event actually occurs, regardless of which parent object contains the handler or behavior).
For example, suppose a table cell with an onmouse over event handler contains two images.
When a user touches either of the images with the mouse pointer, the event bubbles up to the cell
and includes information on which image was actually touched. You can record this mouse over
event by:
n
Setting Listen on the WebTable mouse over event to If Handler (so that VuGen "hears" the
event when it occurs), while disabling recording on it, and then setting Listen on the Image
mouse over event to Never, while setting its recording status to Enable (to record the mouse
over event on the image after it is listened to at the WebTable level).
n
Setting Listen on the Image mouse over event to Always (to listen for the mouse over event
even though the image tag does not contain a behavior or handler), and setting the recording
status on the Image object to Enabled (to record the mouse over event on the image).
l
Instructing VuGen to listen for many events on many objects may lower performance, so try to
limit listening settings to the required objects.
l
In rare situations, listening to the object on which the event occurs (the source object) may
interfere with the event.
Example of Click & Script Out of Context Recording
In the following example, a script was regenerated with the out-of-context recording option enabled.
web_image_link("Search Flights Button",
"Snapshot=t5.inf",
DESCRIPTION,
"Alt=Search Flights Button",
"FrameName=navbar",
ACTION,
"ClickCoordinates=58,9",
LAST);
HP LoadRunner (12.00)
Page 254 of 1743
LoadRunner User Guide
Script Workflow
web_add_cookie("MSO=SID=;1141052844; DOMAIN=localhost");
web_add_cookie("MTUserInfo=hash=;47=;firstName=;Joseph=;expDate=;
%0A=;creditCard=;=;address1=;234%20Willow%20Drive=;
lastName=;Marshall%0A=;address2=;San%20Jose%2FCA%2F94085=;
username=;jojo; DOMAIN=localhost");
web_url("FormDateUpdate.class",
"URL=http://localhost:1080/WebTours/FormDateUpdate.class",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"UserAgent=Mozilla/4.0 (Windows 2000 5.0) Java/1.4.2_08",
"Mode=HTTP",
LAST);
...
If you disable this option, VuGen does not generate code for the ActiveX controls and Java applets.
In the following example, VuGen only generated the web_image_link function—not the web_url
functions containing the class files.
web_image_link("Search Flights Button",
"Snapshot=t5.inf",
DESCRIPTION,
"Alt=Search Flights Button",
"FrameName=navbar",
ACTION,
"ClickCoordinates=58,9",
LAST);
For more information, see "GUI Properties > Advanced Node" on page 219.
Vuser Script Sections
Each Vuser script contains at least three sections: vuser_init, one or more Actions, and vuser_end.
Before and during recording, you can select the section of the script into which VuGen will insert the
recorded functions. The following table shows what to record into each section, and when each
section is executed:
Script Section
Used when recording...
Is executed when...
vuser_init
a login to a server
the Vuser is initialized (loaded)
Actions
client activity
the Vuser is in Running status
vuser_end
a logoff procedure
the Vuser finishes or is stopped
When you run multiple iterations of a Vuser script, only the Actions sections of the script are
repeated—the vuser_init and vuser_end sections are not repeated. For more information on the
iteration settings, see "General > Run Logic Node" on page 350.
HP LoadRunner (12.00)
Page 255 of 1743
LoadRunner User Guide
Script Workflow
You use the VuGen script editor to display and edit the contents of each of the script sections. You
can display the contents of only a single section at a time. To display a section in the script editor,
double-click the name of the section in the Solution Explorer.
When working with Vuser scripts that use Java classes, you place all your code in the Actions
class. The Actions class contains three methods: init, action, and end. These methods correspond
to the sections of scripts developed using other protocols—you insert initialization routines into the
init method, client actions into the action method, and log off procedures in the end method.
For more information, see "Java Vuser Protocol - Manually Programming Scripts" on page 667.
public class Actions{
public int init() {
return 0;}
public int action() {
return 0;}
public int end() {
return 0;}
}
Note: Transaction Breakdown for Oracle DB is not available for actions recorded in the vuser_
init section.
Script Section Structure Example
Every Vuser script contains three sections: vuser_init, Run (Actions), and vuser_end. You can
instruct a Vuser to repeat the Run section when you run the script. Each repetition is known as an
iteration.
The vuser_init and vuser_end sections of a Vuser script are not repeated when you run multiple
iterations.
When you run scripts with multiple actions, you can indicate how to execute the actions, and how
the Vuser executes them:
In the following example, Block0 performs a deposit, Block1 performs a transfer, and Block2
submits a balance request. The Login and Logout actions are common to the three blocks.
HP LoadRunner (12.00)
Page 256 of 1743
LoadRunner User Guide
Script Workflow
Sequence. You can set the order of actions within your script. You can also indicate whether to
perform actions sequentially or randomly.
Iterations. In addition to setting the number of iterations for the entire Run section, you can set
iterations for individual actions or action blocks. This is useful, for example, in emulating a
commercial site where you perform many queries to locate a product, but only one purchase.
Weighting. For action blocks running their actions randomly, you can set the weight or percentage
of each action within a block.
In most cases, the name of the header file corresponds to the prefix of the protocol. For example,
Database functions that begin with an lrd prefix, are listed in the lrd.h file.
Header Files
Header files commonly contain forward declarations of classes, subroutines, variables, and other
identifiers. In most cases, the name of the header file corresponds to the prefix of the protocol. For
example, Database functions that begin with an lrd prefix, are listed in the lrd.h file.
The following table lists the header files associated with the most commonly used protocols:
Protocol
File
Ajax (Click & Script)
web_ajax.h
Citrix
ctrxfuncs.h
COM/DCOM
lrc.h
Database
lrd.h
FTP
mic_ftp.h
General C function
lrun.h
HP LoadRunner (12.00)
Page 257 of 1743
LoadRunner User Guide
Script Workflow
Protocol
File
IMAP
mic_imap.h
LDAP
mic_mldap.h
MAPI
mic_mapi.h
Oracle NCA
orafuncs.h
POP3
mic_pop3.h
RDP
lrrdp.h
SAP GUI
as_sapgui.h
SAP (Click & Script)
sap_api.h
Siebel
lrdsiebel.h
SMTP
mic_smtp.h
Terminal Emulator
lrrte.h
WAP
as_wap.h
Web (HTML\HTTP)
as_web.h
Web (Click & Script)
web_api.h
Web Services
wssoap.h
Windows Sockets
lrs.h
Providing Authentication Information
The following section applies only to multi-protocol scripts.
When recording a Web session that uses NTLM authentication, your server may require you to
enter details such as a user name and password.
Initially, IE (Internet Explorer) tries to use the NT authentication information of the current user:
l
If IE succeeds in logging in using this information and you record a script —then, at the end of
the recording VuGen prompts you to enter a password. VuGen retrieves the user name and
domain information automatically. If necessary, you can also edit the user name in the Web
Recorder NTLM authentication dialog box.
HP LoadRunner (12.00)
Page 258 of 1743
LoadRunner User Guide
Script Workflow
l
If IE is unable to log in with the current user's information, it prompts you to enter a user name
and password using the standard browser authentication dialog box.
Generating a web_set_user function
When performing NTLM authentication, VuGen adds a web_set_user function to the script.
l
If the authentication succeeds, VuGen generates a web_set_user function with your user name,
encrypted password, and host.
web_set_user("domain1\\dashwood",
lr_decrypt("4042e3e7c8bbbcfde0f737f91f"),
"sussex:8080");
l
If you cancel the Web Recorder NTLM Authentication dialog box without entering information,
VuGen generates a web_set_user function for you to edit manually.
HP LoadRunner (12.00)
Page 259 of 1743
LoadRunner User Guide
Script Workflow
web_set_user("domain1\\dashwood,
"Enter NTLM Password Here",
"sussex:8080");
Note: If you enter a password manually, it will appear in the script as-is, presenting a security
issue. To encrypt the password, right-click the password and select Encrypt string. VuGen
encrypts the string and generates an lr_decrypt function, used to decode the password during
replay. For more information about encrypting strings, see "Encrypting Text" on page 403.
Recording via a Proxy- Overview
VuGen allows you to record scripts using a LoadRunner proxy to resolve situations where you
cannot install VuGen on the client machine. This may be the case with certain Linux machines,
Mac OS machines, and mobile devices.
When using this option, the VuGen machine acts as a proxy server capturing all the traffic from the
client machine to the target server. After the business process has been recorded VuGen creates a
script.
The following diagram illustrates the basic workflow:
Considerations for Recording via a Proxy:
l
You can only create a Web - HTTP/HTML script when recording via a proxy.
l
The client must allow proxy configurations, meaning, you must be able to specify the port and
the address of the VuGen machine on the client device or machine.
l
The client device or machine and the VuGen machine must be in the same network.
HP LoadRunner (12.00)
Page 260 of 1743
LoadRunner User Guide
Script Workflow
Because VuGen is unable to bypass the browser's cache and history settings on the client
machine, the client machine's browsing history must be deleted prior to recording the business
process. This enables VuGen to accurately record your business process via a proxy.
l
HTTP forwarding to multiple targets
If multiple target machines are present, the VuGen proxy can correctly forward data to the right
target server according to the Host HTTP header.
Forwarding to target server via Internet proxy server
You can configure the VuGen machine to establish a connection with your organization's internet
proxy by selecting the Remote Application via LoadRunner proxy mode in the Start Recording
dialog box.
For details, see "Start Recording Dialog Box" on page 266.
How to Record a Script via a Proxy
This topic describes various methods for recording a script using a proxy server.
Note: In all use cases, the client machine and VuGen machine are in the same network.
Use Case 1: You want to record a business process but you cannot install
VuGen on the client machine or device.
1.
Create a script
Select a New script > Web - HTTP/HTML script.
2.
Start Recording
a. From the Start Recording dialog box, select Recording Mode > Record > Remote
Application via LoadRunner Proxy. For details, see "Start Recording Dialog Box" on
page 266.
b. Specify the port on which the LoadRunner proxy will listen, by default, port 8888.
c. Check the Display recording toolbar on client machine. This allows you to see and
interact with the recording toolbar on the client machine.
d. Click Start Recording.
3. On the client machine, delete browser cache data which includes Temporary Internet Files and
Cookies.
4.
Configure proxy settings on client machine
Configure the proxy settings to specify the VuGen machine as the proxy server. To do this,
specify the machine address and port on which the LoadRunner proxy will listen.
HP LoadRunner (12.00)
Page 261 of 1743
LoadRunner User Guide
Script Workflow
Below are some sample configurations:
If your
browser/OS
is...
Internet
Explorer
The path is...
n
Internet Options > Connections >
LAN Settings > Proxy server
Configuration
a. Select Use a proxy
server for your LAN
b. Specify Port
c. Specify Address
n
FireFox
Control Panel and IE Tools > Options
menu
Tools > Options > Network > Advanced
> Connection > Settings...
a. Select Manual proxy
configuration
b. Specify HTTP Proxy
c. Specify Port
d. Check Use this proxy
server for all protocols
5.
Record the business process
a. Navigate to your application.
b. Perform the steps of your business process you want to record.
6.
Generate the script
a. Select Stop Recording from either the Recording Toolbar on the client machine or the
Floating Recording Toolbar on the VuGen machine.
b. VuGen generates the script.
Use Case 2: You want to record a business process but you cannot install
VuGen on the machine (or device) running the application.The client
machine requires a proxy to access the Internet.
1.
Create a script
Select a New script > Web - HTTP/HTML script.
2.
Start Recording
a. From the Start Recording dialog box, select Recording Mode > Record > Remote
application via LoadRunner Proxy.
HP LoadRunner (12.00)
Page 262 of 1743
LoadRunner User Guide
Script Workflow
b. If necessary, change the port on which the LoadRunner proxy will listen. The default is port
8888.
c. Check Display recording toolbar on client machine. This allows you to see and
interact with the recording toolbar on the client machine.
d. A browser session is not launched on the local machine during a proxy recording.
Therefore, a link is provided on the Start Recording dialog box to allow you to configure a
connection to the internet proxy.
In Internet Explorer, select Tools > Internet Options > Connections. Click LAN
settings and enter the port and address of the client machine's Internet proxy.
Note: The Use automatic configuration script option is not supported.
e. Select Start Recording.
3. On the client machine, delete browser cache data which includes Temporary Internet Files and
Cookies.
4.
Configure proxy settings on the client machine
On your client machine, configure the browser settings to use the VuGen's machine IP and
port. The following table explains how to set the proxy settings.
If your
browser/OS
is...
Internet
Explorer
The path is...
n
Internet Options > Connections >
LAN Settings > Proxy server
Configuration
a. Select Use a proxy
server for your LAN
b. Specify Port
n
FireFox
Control Panel and IE Tools->Options
menu
Tools > Options > Network > Advanced
> Connection > Settings...
c. Specify the VuGen IP in
Address
a. Select Manual proxy
configuration
b. Specify HTTP Proxy
c. Specify Port
d. Check Use this proxy
server for all protocols
HP LoadRunner (12.00)
Page 263 of 1743
LoadRunner User Guide
Script Workflow
5.
Record the business process
a. Navigate to your application.
b. Perform the steps of your business process you want to record.
6.
Generate the script
a. Select Stop Recording from the either the Recording Toolbar on the client machine or
the Floating Recording Toolbar on the VuGen machine.
b. VuGen generates the script.
Use Case 3: Your application communicates using an SSL protocol.
1. You will need to import the LoadRunner SSL certificate to client machine.
Note: As an application developer, you can set certain policies on the server certificate
when using SSL. However, only if the LoadRunner certificate conforms to the policy, can
the client trust the server and the SSL connection be set.
2. To download the certificate, navigate to http://<computer name of VuGen
machine>:port/proxyroot.cer or http://<ip address of VuGen
machine>:port/proxyroot.cer.
Note: If you experience security restrictions, navigate to http://<computer name VuGen
machine>:port/proxyroot.dat or http://<ip address of VuGen
machine>:port/proxyroot.dat. After downloading the certificate, change the .dat
extension back to .cer to import the certificate.
3. Import the SSL certificate. The following table provides examples of the path for various
browsers.
If you browser
is....
The path is...
Internet Explorer
Internet Options > Content > Trusted Root Certificate Authorities >
Import
FireFox
Tool > Options > Advanced > View Certificates > Authorities >
Import
HP LoadRunner (12.00)
Page 264 of 1743
LoadRunner User Guide
Script Workflow
Use Case 4: You want to do a proxy recording of a local application that
uses the system proxy, where VuGen and the client application are on the
same machine.
1. Create a script
Select a New script > Web - HTTP/HTML script.
2. Set the Recording Option.
Open the recording options (Recording > Recording Options) and select the HTTP
Properties > Advanced node. Enable the Use the LoadRunner Proxy to record a local
application.
3. Start Recording
a. Open the Start Recording dialog box (Ctrl +R).
b. In the Recording mode section, select Record: Web Browser.
4. Perform the business process.
VuGen automatically resets the proxy back to its original setting after the recording. If the recording
did not end in the normal way, for example, if your application crashed during recording, you may
need to manually set the proxy back to its original value. Internet Options > Connections > LAN
Settings > Proxy server .
If you are recording a Java application or a browser other than Internet Explorer, if the application is
not using the system proxy settings, you will need to manually set the proxy of the application.
How to Import Actions to a Script
For Vuser types that support multiple actions, you can import actions into your script from another
Vuser script. You can import actions from Vusers of the same type only. Note that any parameters
associated with the imported action will be merged with the script. The following steps describe
how to import actions into the current script.
1. Select Design > Action > Import Action, or right-click the Solution Explorer and select
Import Action from the right-click menu. The Import Action into VuGen Script dialog box
opens.
2. Click Browse to select a Vuser script. A list of the script's actions appears in the Actions to
Import section.
3. Select the actions you want to include and click Import. The imported action(s) are displayed
in the Solution Explorer.
HP LoadRunner (12.00)
Page 265 of 1743
LoadRunner User Guide
Script Workflow
How to Regenerate a Vuser Script
If you need to revert back to the script as it was when you your originally recorded it, you can
regenerate the script. This feature is ideal for debugging, or fixing a corrupted script. When you
regenerate a script, VuGen removes all of the manually added enhancements to the recorded
actions in the script. If you added parameters to your script, VuGen restores the original values. The
parameter list, however, is not deleted; you can reinsert parameters that you created earlier. Note
that regeneration only cleans up the recorded actions, but not those that were manually added.
This task describes how to regenerate a Vuser script.
1.
Initialize the regeneration
Select Record > Regenerate Script. VuGen issues a warning indicating that all manual
changes will be overwritten.
2.
Modify regenerate options - optional
Click Options to open the Regenerate Options dialog box.
In a multiple protocol script, you can use the General > Protocols node to modify which
protocols you want to record when the script is regenerated. For user interface details, see
"General > Protocol Node" on page 200.
To change the Script options, select the General > Script node and select or clear the
appropriate check box. For user interface details, see "General > Script Node" on page 203.
Note: If a Flex, Silverlight, or Java over HTTP Vuser script encounters errors during the code
generation phase, VuGen will show the errors in the Error pane. This Error pane displays
details about each error, as well as recommended actions. Follow the recommended actions
and regenerate the script.
Start Recording Dialog Box
This dialog box enables you to record your business process.
To access
l
VuGen > Record > Record
l
[VuGen] Start Recording button
Important
information
This dialog box is dynamic and changes according to the options you select as
well as the protocol you are using.
Relevant tasks
l
"How to Record a Vuser Script" on page 175
l
"Scripting Options" on page 103
l
"How to Record a Script via a Proxy" on page 261
User interface elements are described below:
HP LoadRunner (12.00)
Page 266 of 1743
LoadRunner User Guide
Script Workflow
All Protocols (except Java)
UI Element
Description
Record
into action
The section into which you want to record.
You can add your own action. Type the action name in the Record into action
field and click Add. The new action is added to the script.
Recording
mode
The mode used to record your business process.
You can record:
l
Web Browser. For example Web and Oracle NCA record web applications.
l
Windows Application.. For example, Windows Socket Vusers records a
windows application.
l
Remote Application via LoadRunner Proxy. To record traffic when VuGen
cannot run on the client machine. For example, Linux machines, Mac OS
machines, and mobile devices. If you choose this mode, you can specify the
following options:
a. LoadRunner proxy listens on port: The port on which the LoadRunner
proxy will listen.
b. Display recording toolbar on client machine. This allows you to interact
with the recording toolbar on the client machine.
Application Select a browser or select a path of the Windows application to record.
The following browsers are supported:
l
Microsoft Internet Explorer
l
Mozilla Firefox
l
Google Chrome
Note: To successfully record in Chrome or FireFox, close all windows and
verify in the Windows Task Manager that there are no running Chrome or
FireFox instances before you begin recording.
URL
address
The starting URL address. This option is displayed for internet applications only .
Program
arguments
(Windows applications only) The command line arguments for the executable
specified in Recorded application. For example, if you specify plus32.exe
(recorded application) with the command line options peter@neptune, it connects
the user Peter to the server Neptune when starting plus32.exe.
HP LoadRunner (12.00)
Page 267 of 1743
LoadRunner User Guide
Script Workflow
, continued
UI Element
Description
Start
Recording
You can record your business process either:
l
Immediately - Recording starts as soon as you click the Start Recording
button.
l
In delayed mode - In the following instances, it may not be advisable to
record immediately:
n
If you are recording multiple actions, in which case you only need to perform
the startup in one action.
n
In cases where you want to navigate to a specific point in the application
before starting to record.
n
If you are recording into an existing script.
Working
directory
For applications that require you to specify a working directory.
Recording
Options
Opens the Recording Options dialog box. For user interface details,see
"Recording Options" on page 176.
Start
Recording
button
Begins to record your business process based on the option selected above:
Immediate or In delayed mode.
HP LoadRunner (12.00)
Page 268 of 1743
LoadRunner User Guide
Script Workflow
Java Protocols
UI Element
Description
Record into
action
The section into which you want to record.
Record:
l
Java applet to record a Java applet through Sun's applet viewer.
l
Java application to record a Java application.
l
Internet Explorer to record an applet within a browser.
l
Executable/Batch to record an applet or application that is launched
from within a batch file or the name of an executable file.
l
Listener to instruct VuGen to wait for the batch file that initializes the
configuration and runs an application before recording. This mode
requires you to define the system variable _JAVA_OPTIONS as -Xrunjdkhook using jdk1.2.x and higher. (For JDK 1..x, define the
environment variable _classload_hook=JDKhook. For JDK 1.6 set _
JAVA_OPTIONS as -agentlib:jdhook.)
URL address
The URL to start recording (for Internet Explorer recordings)
Parameters
Any additional parameters that your application requires.
Main Class
The complete path of the Java class with the main method.
Note: This option is only present for Java Application type applications.
Applet path
This option is only present for Java applets.
Internet Explorer
path
This option is only present for Internet Explorer type applications.
Executable\Batch This option is only present for Executable\Batch type applications.
Working
directory
A working directory is necessary only if your application must know the
location of the working directory (for example, reading property files or
writing log files).
Recording
Options
Opens the Recording Options dialog box. For user interface details, see
"Recording Options" on page 176.
Floating Recording Toolbar
The floating recording toolbar enables you to control the recording of Vuser scripts, and provides
easy access to common script commands.
HP LoadRunner (12.00)
Page 269 of 1743
LoadRunner User Guide
Script Workflow
UI example
To access
The floating recording toolbar appears when script recording begins.
Important
information
l
The floating recording toolbar is dockable. For details, see "VuGen
Layouts - Overview" on page 79.
l
You can pin the toolbar with the
l
You can expand or collapse the toolbar with the
Relevant tasks
button.
and
buttons.
"How to Create or Open a Vuser Script" on page 162
User interface elements are described below:
UI Element
Description
Continue recording the script after recording has been
paused.
Stop recording the script.
Pause recording.
Cancel the recording.
Select an action to record into.
Create a new action to record into.
Insert a Start Transaction step into your script.
For details, see "Transaction Overview" on page 397.
Insert an End Transaction step into your script.
For details, see "Transaction Overview" on page 397.
Insert a Rendezvous point step into your script.
For details, see "Rendezvous Points" on page 400.
Insert a comment into your script.
HP LoadRunner (12.00)
Page 270 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Insert a Text Check step into your script.
For details, see "Text and Image Verification (Web Vuser
Scripts) - Overview" on page 820.
Displays:
l
How many events have been recorded into your script.
l
The time elapsed since recording began, excluding time
the script was paused.
/
Pin or unpin the recording toolbar.
/
Display or hide the toolbar buttons.
Hide the recording toolbar. The toolbar reappears when you
refresh or navigate to the next page. Hiding the toolbar may
be useful if the toolbar covers controls in the application
being operated, thereby preventing access to the controls.
Note: The Hide Toolbar button
recording only.
appears for proxy
Files Generated During Recording
Assuming that the recorded script has been given the name vuser and is stored under c:\tmp, the
following is a list of the more important files that are generated after recording:
File Name
Details
HP LoadRunner (12.00)
Page 271 of 1743
LoadRunner User Guide
Script Workflow
vuser.usr
Contains information about the Vuser type, AUT, action files, and so forth.
Example of vuser.usr file
[General]
Type=Oracle_NCA
DefaultCfg=default.cfg
BuildTarget=
ParamRightBrace=>
ParamLeftBrace=<
NewFunctionHeader=0
MajorVersion=5
MinorVersion=0
ParameterFile=nca_test3.prm
GlobalParameterFile=
[Transactions]
Connect=
[Actions]
vuser_init=init.c
Actions=run.c
vuser_end=end.c
vuser.bak
A copy of Vuser.usr before the last save operation.
default.cfg
Contains a listing of all run-time settings as defined in the VuGen application (think
time, iterations, log, web).
Example of default.cfg file
[General]
XlBridgeTimeout=120
[ThinkTime]
Options=NOTHINK
Factor=1
LimitFlag=0
Limit=1
[Iterations]
NumOfIterations=1
IterationPace=IterationASAP
StartEvery=60
RandomMin=60
RandomMax=90
[Log]
LogOptions=LogBrief
MsgClassData=0
MsgClassParameters=0
MsgClassFull=0
vuser.asc
The original recorded API calls.
HP LoadRunner (12.00)
Page 272 of 1743
LoadRunner User Guide
Script Workflow
vuser.grd
Contains the column headers for grids in database scripts.
default.usp Contains the script's run logic, including how the actions sections run.
init.c
Exact copy of the Vuser_init function as seen in the VuGen main window.
run.c
Exact copy of the Action function as seen in the VuGen main window.
end.c
Exact copy of the Vuser_end function as seen in the VuGen main window.
vdf.h
A header file of C variable definitions used in the script.
\Data
The Data folder stores all of the recorded data used primarily as a backup. Once
the data is in this folder, it is not touched or used. For example, Vuser.c is a copy
of run.c.
Troubleshooting and Limitations - Recording
This section describes troubleshooting and limitations for recording scripts with VuGen.
Troubleshooting Missing Steps
Issue: Your script is missing steps you recorded.
You encounter the following warning in the Output Pane > Code generation tab:
Warning: One or more responses are missing or have missing packets. Therefore, a
step may appear to be missing in the script.
This issue can be caused if the recording was stopped before all the responses w
ere received.
If the script is generated from a .pcap file, check if the file has missing pack
ets.
This can be caused when you click Stop Recording before all the traffic has been received.
Steps to Resolve: Record the script again. Make sure all pages and resources have been
downloaded before clicking the Stop Record button.
Recording on Internet Explorer 10
Issue: When recording on Internet Explorer (IE) 10, the browser uses cached pages, and may not
record all of the steps.
Steps to Resolve: Each time you begin recording, configure IE 10 to always refresh Web pages
from the server. After you begin a recording session, in IE, click F12 to open the Developer Tools
pane. In this pane, usually located at the bottom of the browser window, select Cache > Always
refresh from server.
Certificate warning message
When you open VuGen as a non-administrator user, during the recording process you may see a
certificate pop-up warning message. The message is automatically closed and does not affect the
recording.
HP LoadRunner (12.00)
Page 273 of 1743
LoadRunner User Guide
Script Workflow
McAfee protection software
McAfee protection software (such as Antivirus, especially the Host Intrusion Prevention
component) may interfere with some LoadRunner components and block script recording.
Workaround: Remove the McAfee software. For details see the McAfee Knowledgebase Article:
How to manually remove McAfee Agent 4.x at
https://kc.mcafee.com/corporate/index?page=content&id=KB65863.
Firefox as default browser
If Firefox is set as the default browser, the Obtain the proxy settings from the default browser
option (Run-time Settings > Internet Protocol > Proxy) does not work, and a direct connection is
used.
64-bit Recording
In general, 64-bit applications ported from a 32-bit client version should work identically to the 32-bit
client. There is a small risk that new clients will use the power of native 64-bit applications. For
example, when using 64-bit long types for Identifiers in DB tables, the identifier value will be cut and
the query will fail.
The following guidelines apply:
l
The environment for 64-bit recording must be a Windows 7 x64 or Windows 8 x64 (Windows 8
x64 added in Service Pack 11.52), and a 64-bit Application Under Test (AUT).
l
Recording on 64-bit operating system for 32 and 64-bit applications (running as a 64-bit
application) is supported.
l
You cannot record a page requiring a client certificate with 64-bit version of Internet Explorer.
l
Replay is only supported for 32-bit.
l
For the Java Over HTTP protocol: JVM 32-bit is required for replay.
l
For the .NET protocol: There are two available 64-bit types for .NET applications (AnyCPU and
pure 64-bit). LoadRunner only supports AnyCPU. There is currently no solution for pure 64-bit
applications.
For replay, LoadRunner uses the same AnyCPU dlls that were used for Recording.
n
l
Note: With LoadRunner 11.50 and higher, .NET Framework 4 should be installed. This
package carries both versions of the libraries for 32 and 64-bit systems.
Oracle 2-Tier: Both 32-bit and 64-bit clients need to be installed (the 32-bit client is required for
replay).
Correlation Studio
Correlation Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
third step, correlating a Vuser script.
HP LoadRunner (12.00)
Page 274 of 1743
LoadRunner User Guide
Script Workflow
Correlation is used when a recorded script includes a dynamic value (such as a session ID) and
therefore cannot be successfully replayed. To resolve this, you convert the dynamic value into a
variable—thereby enabling your script to replay successfully.
For example, many applications and Web sites use the current date and time to identify a session.
If you try to replay a script that was recorded on such a site, the script may fail because the current
time is different from the recorded time. Correlating the data enables you to save the dynamic data
and use it throughout the scenario run.
When a correlation is created, VuGen adds a function that extracts the dynamic value to a
parameter. Appropriate occurrences of the original value are replaced with a parameter.
For details, see "Correlation Tab [Design Studio] Overview" below .
Correlation Tab [Design Studio] Overview
The Correlation tab enables you to correlate and manage dynamic values in your web-based Vuser
scripts. To learn more about correlation concepts, see "Correlation Overview" on the previous page.
With the Correlation tab you can:
l
Scan for correlations using rules, record based, and replay based engines
l
Correlate both raw and formatted data
l
Add and edit rules
l
Undo correlations
l
Review details pertaining to a specific dynamic value in a snapshot
When you record a script using a web-based protocol, many of the values change dynamically each
time a request is sent to the server. An example of a dynamic value is a sessionID which may
include a date and time stamp of when the web session was opened. To learn more, see "How to
Correlate Scripts Using Design Studio" on page 280
The following flow chart illustrates the process for correlating values in your script using the
Correlation tab:
HP LoadRunner (12.00)
Page 275 of 1743
LoadRunner User Guide
Script Workflow
As you can see from the flow chart, the Correlation tab scans for dynamic values using different
processes.
Correlation Types
Design Studio uses three processes to automatically find dynamic values that may need to be
correlated.
l
Rules
Design Studio first scans for dynamic values that are defined by rules, if the rules scan has been
enabled. To learn more, see "Correlation Rules" on the next page.
l
Record
Design Studio scans for dynamic values after code generation. This method can find a
significant percentage of dynamic values in your script.
l
Replay
Design Studio scans for dynamic values after replay. This method may need to be repeated
several times.
You can select which scan types the Correlation tab should use by configuring Recording Option
> Correlations > Configuration. In general, it is recommended to enable all scan types.
The following table explains the expected behavior at various script states:
HP LoadRunner (12.00)
Page 276 of 1743
LoadRunner User Guide
Script Workflow
Script State when
opening the
Correlation tab
Script contains
recorded data.
Behavior in the Correlation tab
(All scan types enabled)
When Design Studio is opened, it will scan for rule and record based
correlations.
You can then replay and scan for replay based correlations. Repeat this
process until the Design Studio no longer finds new correlations.
Script contains
recorded data and has
been replayed.
When the Correlation tab is opened, it will scan for all correlation types.
You can then replay and scan for additional replay based correlations.
Repeat this process until Design Studio no longer finds new
correlations.
Correlation Rules
If you know the dynamic values that need to be correlated before recording, you can create
correlation rules that will automatically identify those values while you record. If "Automatically
apply correlation rules" is selected in the Recording Options > Correlations > Configuration
node, values found based on rules will automatically be correlated. Additionally, there are some
correlation rules that come pre-defined in VuGen for supported application servers. You can enable
or disable rules in "Correlations > Rules" on page 186.
Snapshot Details and Occurrences
Design Studio provides details on each snapshot step that contains dynamic values. These details
can help you determine which values to correlate in your script. In addition to the snapshot details,
the Correlation tab, displays all occurrences of the dynamic value in your script. You can select
specific occurrences to correlate or correlate all. For details, see "Design Studio [Correlation Tab]
Dialog Box" on page 312.
Determining Which Values to Correlate
Once you generate a list of differences, you need to determine which ones to correlate. If you
mistakenly correlate a difference that did not require correlation, your replay may be adversely
affected.
The following strings most probably require correlation:
l
Login string. A login string with dynamic data such as a session ID or a timestamp.
l
Date/Time Stamp. Any string using a date or time stamp, or other user credentials.
l
Common Prefix. A common prefix, such as SessionID or CustomerID, followed by a string of
characters.
If you are in doubt whether a difference should be correlated, correlate only that difference and then
run your script. Check the Replay log to see if the issue was resolved.
HP LoadRunner (12.00)
Page 277 of 1743
LoadRunner User Guide
Script Workflow
You should also correlate differences in which some of the recorded and replayed strings are
identical, but others differ. For example, SessionID strings with identical prefixes and suffixes, but
different characters in between, should be correlated.
Modifying Saved Parameters
After you save a value to a parameter, you may need to modify it before using it in your script. If you
need to perform arithmetical operations on a parameter, you must change it from a string to an
integer using the atoi or atol C functions. After you modify the value as an integer, you must
convert it back to a string to use the new variable in your script.
In the following WinSock example, the data at offset 67 was saved to the parameter, param1.
Using atol, VuGen converted the string to a long integer. After increasing the value of param1 by
one, VuGen converted it back to a string using sprintf and saved it as a new string, new_param1.
The value of the parameter is displayed using lr_output_message. This new value may be used at
a later point in the script.
lrs_receive("socket2", "buf47", LrsLastArg);lrs_save_param("socket2",
NULL, "param1", 67, 5);
lr_output_message ("param1: %s", lr_eval_string("<param1>"));
sprintf(new_param1, "value=%ld", atol(lr_eval_string("<param1>")) + 1);
lr_output_message("ID Number:"%s" lr_eval_string("new_param1"));
Correlation vs. Parameterization
Parameterization is used when you want to take a value and turn it into a variable in order to make
your script more realistic. For example, if you are filling out a form on a website, you may want to
vary the value entered for a particular field.
Correlation is used when a recorded script includes a dynamic value (such as a session ID) and
cannot replay. To resolve this, you make the dynamic value into a variable thereby enabling your
script to replay successfully.
Wdiff Correlation Utility
The Wdiff Utility lets you compare recorded Vuser scripts and replay results to determine which
values need to be correlated.
To use WDiff effectively, you record the identical operation twice, and compare the scripts (or data
files for WinSock). WDiff displays differences in yellow. Note that not all differences indicate a
value to correlate. For example, certain receive buffers that indicate the time of execution do not
require correlation.
For task details, see "How to Search for Values that Need Correlation" on page 302.
Correlating Java Scripts
VuGen's Java recorder attempts to automatically correlate statements in the generated script. It
only performs correlation on Java objects. When it encounters a Java primitive (byte, character,
boolean, integer, float, double, short, and long) during recording, the argument values appear in the
HP LoadRunner (12.00)
Page 278 of 1743
LoadRunner User Guide
Script Workflow
script without association to variables. VuGen automatically correlates all objects, arrays of
objects, and arrays of primitives. Note that Java arrays and strings are also considered objects.
VuGen employs several levels of correlation: Standard, Enhanced, Strings. You enable or disable
correlation from the Recording options. An additional method of Serialization can be used to handle
scripts where none of the former methods can be applied.
Standard Correlation
Standard correlation refers to the automatic correlation performed during recording for simple
objects, excluding object arrays, vectors, and container constructs.
When the recorded application invokes a method that returns an object, VuGen's correlation
mechanism records these objects. When you run the script, VuGen compares the generated
objects to the recorded objects. If the objects match, the same object is used. The following
example shows two CORBA objects my_bank and my_account. The first object, my_bank, is
invoked; the second object, my_account, is correlated and passed as a parameter in final line of the
segment:
public class Actions {
// Public function: init
public int init() throws Throwable {
Bank my_bank = bankHelper.bind("bank", "shunra");
Account my_account = accountHelper.bind("account","shunra");
my_bank.remove_account(my_account);
}
:
}
Advanced Correlation
Advanced or deep correlation refers to the automatic correlation performed during recording for
complex objects, such as object arrays and CORBA container constructs.
The deep correlation mechanism handles CORBA constructs (structures, unions, sequences,
arrays, holders, `any's) as containers. This allows it to reference inner members of containers,
additional objects, or different containers. Whenever an object is invoked or passed as a parameter,
it is also compared against the inner members of the containers.
In the following example, VuGen performs deep correlation by referencing an element of an array.
The remove_account object receives an account object as a parameter. During recording, the
correlation mechanism searches the returned array my_accounts and determines that its sixth
element should be passed as a parameter.
public class Actions {
// Public function: init
public int init() throws Throwable {
my_banks[] = bankHelper.bind("banks", "shunra");
my_accounts[] = accountHelper.bind("accounts","shunra");
my_banks[2].remove_account(my_accounts[6]);
}
:
}
HP LoadRunner (12.00)
Page 279 of 1743
LoadRunner User Guide
Script Workflow
The following segment further illustrates enhanced correlation. The script invokes the send_letter
object that received an address type argument. The correlation mechanism retrieves the inner
member, address, in the sixth element of the my_accounts array.
public class Actions {
// Public function: init
public int init() throws Throwable {
my_banks = bankHelper.bind("bank", "shunra");
my_accounts = accountHelper.bind("account", "shunra");
my_banks[2].send_letter(my_accounts[6].address);
}
:
}
String Correlation
String correlation refers to the representation of a recorded value as an actual string or a variable.
When you disable string correlation (the default setting), the actual recorded value of the string is
indicated explicitly within the script. When you enable string correlation, it creates a variable for
each string, allowing you to use it at a later point in the script.
In the following segment, string correlation is enabled—you store the value returned from the get_id
method in a string type variable for use later on in the script.
public class Actions {
// Public function: init
public int init() throws Throwable {
my_bank = bankHelper.bind("bank", "shunra");
my_account1 = accountHelper.bind("account1", "shunra");
my_account2 = accountHelper.bind("account2", "shunra");
string = my_account1.get_id();
string2 = my_account2.get_id();
my_bank.transfer_money(string, string2);
}
:
}
How to Correlate Scripts Using Design Studio
This topic describes how to use the Correlation tab to correlate Vuser scripts.
Prerequisites
1. Record a script using one of the following protocols:
n Web HTTP/HTML
n
Flex
n
RTMP/RTMPT
n
Citrix
HP LoadRunner (12.00)
Page 280 of 1743
LoadRunner User Guide
Script Workflow
n
SAP Web
n
Oracle NCA
Note: You can only correlate the Web HTTP/HTML steps within your Oracle NCA
script and the Web HTTP/HTML protocol must be active. To activate, select
Recording Options > Protocol > Active Protocols > Web HTTP/HTML.
For additional information on manual correlation, see "How to Correlate Scripts - Oracle
NCA" on page 292
2. Verify that Record > Recording Options > Correlations > Configuration has all scan
types enabled.
Using the Correlation tab
1. Initial Scan: Click the Design Studio button. This will open the Design Studio dialog box
which will scan for response (or record based) correlations and apply correlation rules. The
progress bar in the dialog box indicates if the initial scan was successful.
For details on the Correlation tab, see "Correlation Tab [Design Studio] Overview" on page
275.
2. You can select which values you would like to correlate by highlighting the value in the grid and
clicking the Correlate button.
When a value is correlated, VuGen adds a web_reg_save_param_* function, and saves the
original value in a comment in the script.
You can examine the details of the correlation by expanding the Details Chevron in the dialog
box. For details, see "Design Studio [Correlation Tab] Dialog Box" on page 312.
For details on the Correlation tab, see "Correlation Tab [Design Studio] Overview" on page
275.
3. You can click the Add as Rule button to add a rule type . In addition, you can click the Edit
rule button to view and edit the corresponding rule if the dynamic value was correlated by a
rule. For details, see Recording Options > Correlation > Rules.
HP LoadRunner (12.00)
Page 281 of 1743
LoadRunner User Guide
Script Workflow
4. Replay and Scan: After you have correlated the values, click the Replay and Scan button.
The Correlation tab progress bar indicates if additional correlations have been found. Again,
you can select which values you would like to correlate by highlighting the value in the grid and
clicking the Correlate button. You may need to repeat this step several times.
5. Design Studio Scan Complete: When Design Studio no longer finds new correlations, the
progress bar will display "Design Studio Scan Complete".
Tip: If Design Studio does not resolve all correlation-based errors, try to resolve them
using manual correlation. For details, see "How To Manually Correlate Scripts" below.
How To Manually Correlate Scripts
If the scan for correlation did not resolve all correlation-based errors in your script, you can attempt
to manually correlate your script as follows:
1. Search for values that need correlation manually. There are a number of ways to manually
search for values that need correlation. For details, see "How to Search for Values that Need
Correlation" on page 302.
2. Correlate the value.
Select one of the following methods:
n
Correlate from snapshots. Highlight the value to correlate, right-click, and select Create
Correlation.
When a value is correlated, VuGen adds the correlation parameter and saves the original
value in a comment in the script.
n
Manually add correlation functions. Manually insert the relevant correlation functions into
your script. For details, see "How to Correlate Scripts - Web (Manually)" on page 286.
How to Correlate Scripts From a Snapshot
The following steps describe how to correlate scripts from a snapshot.
This task applies to the following protocols:
HP LoadRunner (12.00)
Page 282 of 1743
LoadRunner User Guide
Script Workflow
l
Database Protocols
l
RTMP
l
COM Protocols
1. Open the Output Pane
Select View > Output to display the output tabs at the bottom of the window. Check for errors in
the Replay tab. Often, these errors can be corrected by correlation.
2. Select the relevant step in the Step Navigator, and view the step in the Snaphot pane. Right
click the value in the snapshot and select Create correlation. This will open the Design
Studio window.
3. You can select the value you would like to correlate by highlighting it in the grid and clicking the
Correlate button.
4. When a value is correlated, VuGen adds the correlation parameter, and saves the original value
in a comment in the script.
Correlating Winsock Scripts
VuGen's Design Studio provides a user interface for correlating Vuser scripts. Correlation is
required when working with dynamic data. A common issue with Winsock Vuser scripts is dynamic
ports—ports whose numbers are assigned dynamically. While certain applications always use the
same port, others use the next available port. If you try to replay a script and the recorded port is no
HP LoadRunner (12.00)
Page 283 of 1743
LoadRunner User Guide
Script Workflow
longer available, your script will fail to replay. To overcome this issue, you must perform
correlation—save the actual run-time values and use them within the script.
VuGen uses lrs_save_param and lrs_save_searched_string functions correlate Winsock scripts.
This means that it stores the data that is received for use in a later point within the script. Since
correlation stores the received data, it applies only to Receive buffers and not to Send buffers. The
recommended procedure is to select a string of dynamic data within the Receive buffer that you
want to correlate. Use that same parameter in a subsequent Send buffer.
Correlating a Winsock script
You use the Snapshot pane to begin correlating Winsock Vuser scripts. Both the Text and the Hex
tabs in the Snapshot pane have the correlating functionality.
1. In the Snapshot pane, select the data that you want to correlate.
2. Right-click in the selection, and select Create Correlation or Create Boundary Correlation.
The Design Studio opens and displays the Correlation tab.
Note that you can click the number of occurrences in the Replace/Found column to enable
you to choose the exact occurrences that you want to correlate.
3. Click the Details bar to display details about the correlation.
4. Make sure that the Original Snapshot Step tab is visible. Notice that the type is either Data
Range or Boundary Based.
5. Click Correlate to perform the correlation of the Vuser script.
6. Click Close to close the Design Studio. Notice that VuGen has inserted the appropriate
correlation functions and comments into the script.
For further details on how to use the Design Studio, see "Correlation Tab [Design Studio]
Overview" on page 275.
Parameterization vs Correlation
This type of correlation should not be confused with simple parameterization. Simple
parameterization (Design > Parameters > Create New Parameter) applies only to data within
Send buffers. You set up a parameter and assign it several values. VuGen uses the different values
in each of the script runs or iterations. For further details, see "Correlation vs. Parameterization" on
page 278.
For details on how to manually correlate a Winsock Vuser script, see "How to Correlate Scripts Winsock (Manually)" below.
How to Correlate Scripts - Winsock (Manually)
This topic describes how to use the Editor to manually correlate a Winsock Vuser script.
1. Insert the lrs_save_param_ex statement into your script at the point where you want to save
HP LoadRunner (12.00)
Page 284 of 1743
LoadRunner User Guide
Script Workflow
the buffer contents. You can save user, static, or received type buffers.
lrs_save_param_ex (socket, type, buffer, offset, length, encoding, paramete
r);
2. View the buffer contents by selecting data.ws in the Action Pane of the main VuGen window
(displayed by default in the Editor). Locate the data that you want to replace with the contents
of the saved buffer. Replace all instances of the value with the parameter name in parameter
braces. The default parameter braces are brackets (< > or ()). You can modify the parameter
braces in the Tools > Options > Scripting > Parameters tab.
In the following example, a user performed a telnet session. The user used a ps command to
determine the process ID (PID), and killed an application based on that PID.
frodo:/u/jay>ps
PID TTY
TIME CMD
14602 pts/18
0:00 clock
14569 pts/18
0:03 tcsh
frodo:/u/jay>kill 14602
[3]
Exit 1
frodo:/u/jay>
clock
During execution, the PID of the procedure is different (Linux assigns unique PIDs for every
execution), so killing the recorded PID will be ineffective. To overcome this problem, use lrs_
save_param_ex to save the current PID to a parameter. Replace the constant with the
parameter.
3. In the data.ws file, determine the buffer in which the data was received, buf47.
recv buf47 98
"\r"
"\x00"
"\r\n"
"
PID TTY
" 14602 pts/18
" 14569 pts/18
"frodo:/u/jay>"
.
.
.
send buf58
"kill 14602"
TIME CMD\r\n"
0:00 clock\r\n"
0:02 tcsh\r\n"
4. In the Actions section, determine the socket used by buf47. In this example it is socket1.
lrs_receive("socket1", "buf47", LrsLastArg);
5. Determine the offset and length of the data string to save. The offset of the PID is 11 and its
length is 5 bytes. For additional information about displaying the data, see "Data Buffers" on
page 963.
HP LoadRunner (12.00)
Page 285 of 1743
LoadRunner User Guide
Script Workflow
6. Insert an lrs_save_param_ex function in the Action section, after the lrs_receive for the
relevant buffer. In this instance, the buffer is buf47. The PID is saved to a parameter called
param1. Print the parameter to the output using lr_output_message.
lrs_receive("socket1", "buf79", LrsLastArg);
lrs_save_param("socket1", "user", buf47, 11, 5, ascii, param1);
lr_output_message ("param1: %s", lr_eval_string("<param1>"));
lr_think_time(10);
lrs_send("socket1", "buf80", LrsLastArg);
7. In the data file, data.ws, determine the data that needs to be replaced with a parameter, the
PID.
send buf58
"kill 14602"
8. Replace the value with the parameter, enclosed in angle brackets.
send buf58
"kill <param1>"
How to Correlate Scripts - Web (Manually)
This task describes how to correlate web scripts manually by modifying the code.
1.
Locate the string and its details
Identify the statement that contains dynamic data and the patterns that characterize the
locations of the data. These patterns may be boundaries or xpaths.
a. Identify Patterns using Boundaries
Use these guidelines to determine and set the boundaries of the dynamic data:
o
Analyze the location of the dynamic data within the HTTP response.
o
Identify the string that is immediately to the left of the dynamic data. This string defines
the left boundary of the dynamic data.
o
Identify the string that is immediately to the right of the dynamic data. This string defines
the right boundary of the dynamic data.
o
The right and left boundaries should be as unique as possible to better locate the strings.
o
web_reg_save_param_ex looks for the characters between (but not including) the
specified boundaries and saves the information beginning one byte after the left
boundary and ending one byte before the right boundary. web_reg_save_param_ex
does not support embedded boundary characters.
For example, if the input buffer is {a{b{c} and "{" is specified as a left boundary, and "}"
HP LoadRunner (12.00)
Page 286 of 1743
LoadRunner User Guide
Script Workflow
as a right boundary, the first instance is c and there are no further instances—it found
the right and left boundaries but it does not allow embedded boundaries, so "c" is the
only valid match.
By default, the maximum length of any boundary string is 256 characters. Include a web_
set_max_html_param_len function in your script to increase the maximum permitted
length. For example, the following function increases the maximum length to 1024
characters:
These length restrictions do not apply where either the left or right boundaries are blank.
b. Identify Patterns using Xpaths
Use the snapshot pane to manually search for the xpath of the desired string.
By default, the maximum length of any boundary string is 256 characters Include a web_
set_max_html_param_len function in your script to increase the maximum permitted
length. For example, the following function increases the maximum length to 1024
characters:
These length restrictions do not apply where either the left or right boundaries are blank.
2.
Add web_reg_save_param_* function
Add a web_reg_save_param_ex or web_reg_save_param_xpath function into the script
before the statement that contains the dynamic data.
a. web_reg_save_param_ex
This function searches server responses in web steps for the left boundary following by the
string and the right boundary and saves the string to a parameter named in the function's
argument. After finding the specified number of occurrences, web_reg_save_param_ex
does not search any more responses. For more information, see the Function Reference
(Help > Function Reference).
b. web_reg_save_param_xpath
This function searches server responses in web steps for a specified xpath. The string
located in specified xpath is saved to a parameter named in the function's argument. For
more information, see the Function Reference (Help > Function Reference).
3.
Replace data with parameter
Select Edit > Replace from the VuGen main window to display the Search and Replace dialog
box. Search the entire script for the dynamic data and replace it with a parameter. Give the
parameter any name and enclose it with braces: {param_name}. You can include a maximum
of 64 parameters per script.
How to Correlate Scripts - Siebel Protocol
The following steps describe how to correlate Siebel Web Vuser scripts.
HP LoadRunner (12.00)
Page 287 of 1743
LoadRunner User Guide
Script Workflow
Correlation Library
To assist you with correlation, Siebel has released a correlation library file as part of the Siebel
Application Server version 7.7. This library is available only through Siebel. The library file,
ssdtcorr.dll, is located under the siebsrvr\bin folder for Windows and under siebsrvr/lib for Linux
installations.
The library file, ssdtcorr.dll, must be available to all machines where a Load Generator or
Controller reside. Support for this library requires VuGen 8.0 and higher. The following steps
describe how to enable correlation with this library.
1. Copy the DLL file into the bin folder of the product installation.
2. Open a multi-protocol script using the Siebel-Web Vuser type.
3. Enable UTF-8 support in the Recording Options > HTTP Properties > Advanced node.
4. Open the recording option's Correlation node and click Import. Import the rules file,
WebSiebel77Correlation.cor, from the \dat\webrulesdefaultsetting folder. If you are
prompted with warnings, click Override.
To revert to the default correlation, delete all of the Siebel rules and click Use Defaults.
When using the Siebel correlation library, verify that the SWE count rules (where the left
boundary contains the SWEC string) are not disabled.
Correlation Rules
VuGen's native built-in rules for the Siebel server detect the Siebel server variables and strings,
automatically saving them for use at a later point within the script. The rules list the boundary
criteria that are unique for Siebel server strings.
When VuGen detects a match using the boundary criteria, it saves the value between the
boundaries to a parameter. The value can be a simple variable or a public function.
In normal situations, you do not need to disable any rules. In some cases, however, you may want
to disable rules that do not apply. For example, disable Japanese content check rules when testing
English-only applications.
Another reason to disable a rule is if the Controller explicitly requires an error condition to be
generated. View the rule properties in the recording options and determine the conditions necessary
for your application.
Simple Variable Correlation
In the following example, the left boundary criteria is _sn=. For every instance of _sn= in the left
boundary and ; in the right, VuGen creates a parameter with the Siebel_sn_cookie prefix.
HP LoadRunner (12.00)
Page 288 of 1743
LoadRunner User Guide
Script Workflow
In the following example, VuGen detected the _sn boundary. It saved the parameter to Siebel_sn_
cookie6 and used it in the web_url function.
/* Registering parameter(s) from source
web_reg_save_param("Siebel_sn_cookie6",
"LB/IC=_sn=",
"RB/IC=;",
"Ord=1",
"Search=headers",
"RelFrameId=1",
LAST);
...
web_url("start.swe_3",
"URL=http://cannon.hplab.com/callcenter_enu/start.swe?SWECmd=GotoPostedAction=;S
WEDIC=true=;_sn={Siebel_sn_cookie6}=;SWEC={Siebel_SWECount}=;SWEFrame=top._swecl
ient=;SWECS=true",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://cannon.hplab.com/callcenter_enu/start.swe?SWECmd=GetCachedFrame
=;_sn={Siebel_sn_cookie6}=;SWEC={Siebel_SWECount}=;SWEFrame=top._swe",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
Function Correlation
In certain instances, the boundary match is a function. Functions generally use an array to store the
run-time values. In order to correlate these values, VuGen parses the array and saves each
argument to a separate parameter using the following format:
<parameter_name> = <recorded_value> (display_name)
The display name is the text that appears next to the value, in the Siebel Application.
VuGen inserts a comment block with all of the parameter definitions.
HP LoadRunner (12.00)
Page 289 of 1743
LoadRunner User Guide
Script Workflow
/* Registering parameter(s) from source task id 159
// {Siebel_Star_Array_Op33_7} = ""
// {Siebel_Star_Array_Op33_6} = "1-231"
// {Siebel_Star_Array_Op33_2} = ""
// {Siebel_Star_Array_Op33_8} = "Opportunity"
// {Siebel_Star_Array_Op33_5} = "06/26/2003 19:55:23"
// {Siebel_Star_Array_Op33_4} = "06/26/2003 19:55:23"
// {Siebel_Star_Array_Op33_3} = ""
// {Siebel_Star_Array_Op33_1} = "test camp"
// {Siebel_Star_Array_Op33_9} = ""
// {Siebel_Star_Array_Op33_rowid} = "1-6F"
// */
In addition, when encountering a function, VuGen generates a new parameter for web_reg_save_
param, AutoCorrelationFunction. VuGen also determines the prefix of the parameters and uses
it as the parameter name. In the following example, the prefix is Siebel_Star_Array_Op33.
web_reg_save_param("Siebel_Star_Array_Op33",
"LB/IC=`v`",
"RB/IC=`",
"Ord=1",
"Search=Body",
"RelFrameId=1",
"AutoCorrelationFunction=flCorrelationCallbackParseStarArray",
LAST);
VuGen uses the parameters at a later point within the script. In the following example, the
parameter is called in web_submit_data.
web_submit_data("start.swe_14", "Action=http://cannon.hplab.com/callcenter_enu/start.swe",
"Method=POST", "RecContentType=text/html", "Referer=", "Snapshot=t15.inf", "Mode=HTML",
ITEMDATA, "Name=SWECLK", "Value=1", ENDITEM, "Name=SWEField", "Value=s_2_1_13_
0", ENDITEM, "Name=SWER", "Value=0", ENDITEM, "Name=SWESP", "Value=false",
ENDITEM, "Name=s_2_2_29_0", "Value={Siebel_Star_Array_Op33_1}", ENDITEM, "Name=s_
2_2_30_0", "Value={Siebel_Star_Array_Op33_2}", ENDITEM, "Name=s_2_2_36_0", "Value=
{Siebel_Star_Array_Op33_3}", ENDITEM, ...
During replay, Vusers do a callback to the public function, using the array elements that were saved
as parameters.
Note: Correlation for the SWEC parameter is not done through the correlation rules. VuGen
handles it automatically with a built-in detection mechanism. For more information, see SWEC
Correlation.
SWEC Correlation
SWEC is a parameter used by Siebel servers representing the number of user clicks. The SWEC
parameter usually appears as an argument of a URL or a POST statement. For example:
GET /callcenter_enu/start.swe?SWECmd=GetCachedFrame=;_sn=2-mOTFXHWBAAGb5Xzv9Ls2Z
45QvxGQnOnPVtX6vnfUU_=;SWEC=1=;SWEFrame=top._swe._sweapp HTTP/1.1
HP LoadRunner (12.00)
Page 290 of 1743
LoadRunner User Guide
Script Workflow
or
POST /callcenter_enu/start.swe HTTP/1.1
...
\r\n\r\n
SWERPC=1=;SWEC=0=;_sn=2-mOTFXHWBAAGb5Xzv9Ls2Z45QvxGQnOnPVtX6vnfUU_=;SWECmd=Invok
eMethod...
VuGen handles the changes of the SWEC by incrementing a counter before each relevant step.
VuGen stores the current value of the SWEC in a separate variable (Siebel_SWECount_var).
Before each step, VuGen saves the counter's value to a VuGen parameter (Siebel_SWECount).
In the following example, web_submit_data uses the dynamic value of the SWEC parameter,
Siebel_SWECount.
Siebel_SWECount_var += 1;
lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");
web_submit_data("start.swe_8",
"Action=http://cannon.hplab.com/callcenter_enu/start.swe",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=",
"Snapshot=t9.inf",
"Mode=HTML",
"EncodeAtSign=YES",
ITEMDATA,
"Name=SWERPC", "Value=1", ENDITEM,
"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM,
"Name=SWECmd", "Value=InvokeMethod", ENDITEM,
"Name=SWEService", "Value=SWE Command Manager", ENDITEM,
"Name=SWEMethod", "Value=BatchCanInvoke", ENDITEM,
"Name=SWEIPS",...
LAST);
Note that the SWEC parameter may also appear in the referrer URL. However, its value in the
referrer URL usually differs from its value in the requested URL. VuGen handles this automatically.
Correlate SWECount Parameters
The SWECount parameter value is usually a small number consisting of one or two digits. It is often
difficult to determine where to replace the recorded value with a parameter.
In the web_submit_data function, VuGen only replaces it in the SWEC field.
In URLs, VuGen only replaces the value when it appears after the strings "SWEC=" or "SWEC`".
The parameter name for all the SWECount correlations is the same.
Correlate ROWID Parameters
In certain cases, the rowid is preceded by its length, encoded in hexadecimal format. Since this
length can change, this value must be correlated.
HP LoadRunner (12.00)
Page 291 of 1743
LoadRunner User Guide
Script Workflow
For example, the following string is comprised of a length value and RowID, xxx6_1-4ABCyyy,
where 6 is the length, and 1-4ABC is the RowID.
If you define parameters to correlate the string as
xxx{rowid_Length}_{rowid}yyy
then using this enhanced correlation, VuGen generates the following function before the string:
web_save_param_length("rowid", LAST);
This function gets the value of rowid, and saves its length into the parameter rowid_length in
hexadecimal format.
Correlate SWET (timestamp) Parameters
The SWETS value in the script, is the number of milliseconds since midnight January 1st, 1970.
VuGen replaces all non-empty timestamps in the script, with the parameter {SiebelTimeStamp}.
Before saving a value to this parameter, VuGen generates the following function:
web_save_timestamp_param("SiebelTimeStamp", LAST);
This function saves the current timestamp to the SiebelTimeStamp parameter.
How to Correlate Scripts - Oracle NCA
The following steps describe different items in Oracle NCA scripts that may need correlation.
Correlate Statements for Load Balancing
VuGen supports load balancing for multiple application servers. You correlate the HTTP return
values with the nca_connect_server parameters. The Vuser then connects to the relevant server
during test execution, applying load balancing. The following steps describe how to correlate
statements for load balancing.
1. Record a multi-protocol script.
Record a multi-protocol script for Oracle NCA and Web Protocols. Perform the desired actions
and save the script.
2. Define parameters for host and host arguments.
Define two variables, serverHost and serverArgs, for parameterization:
web_set_max_html_param_len("512");
web_reg_save_param("serverHost", "NOTFOUND=ERROR",
"LB=<PARAM name=\"serverHost\" value=\"","RB=\">", LAST);
web_reg_save_param("serverArgs", "NOTFOUND=ERROR",
"LB=<PARAM name=\"serverArgs\" value=\"","RB=\">", LAST);
3. Assign values to serverHost and serverArgs:
web_url("step_name", "URL=http://server1.acme.com/test.htm", LAST);
HP LoadRunner (12.00)
Page 292 of 1743
LoadRunner User Guide
Script Workflow
4. Modify the nca_connect_server statement from:
nca_connect_server("199.203.78.170", 9000"/*version=107*/,
"module=e:\\appsnca...fndnam=apps ");
to:
nca_connect_server("{ serverHost }", "9000"/*version=107*/, "{serverArgs}");
The script should now look like this:
web_set_max_html_param_len("512");
web_reg_save_param("serverHost", "NOTFOUND=ERROR",
"LB=<PARAM name=\"serverHost\" value=\"","RB=\">", LAST);
web_reg_save_param("serverArgs", "NOTFOUND=ERROR",
"LB=<PARAM name=\"serverArgs\" value=\"","RB=\">", LAST);
web_url("step_name", "URL=http://server1.acme/test.htm", LAST);
nca_connect_server("{serverHost}","9000"/*version=107*/,"{serverArgs}");
Correlate the icx_ticket Variable
The icx_ticket variable, is part of the information sent in the web_url and nca_connect_server
functions:
web_url("fnd_icx_launch.runforms",
"URL=http://ABC-123:8002/pls/VIS/fnd_icx_launch.runforms\?ICX_TICKET=5843A550589
47ED3=;RESP_APP=AR=;RESP_KEY=RECEIVABLES_MANAGER=;SECGRP_KEY=STANDARD", LAST);
This icx_ticket value is different for each recording. It contains cookie information sent by the
client. To correlate your recording, add web_reg_save_param before the first occurrence of the
recorded icx_ticket value:
web_reg_save_param("icx_ticket", "LB=TICKET=", "RB==;RES", LAST);
...
web_url("fnd_icx_launch.runforms",
"URL=http://ABC-123:8002/pls/VIS/fnd_icx_launch.runforms\?ICX_TICKET={icx_ticke
t}=;RESP_APP=AR=;RESP_KEY=RECEIVABLES_MANAGER=;SECGRP_KEY=STANDARD", LAST);
Note: The left and right boundaries of web_reg_save_param may differ depending on your
application setup.
Correlate the JServSessionldroot Values
The JServSessionIdroot value is a cookie that the application sets to store the session ID. In
most cases, VuGen automatically correlates this value and inserts a web_reg_save_param
function. If VuGen did not add this function automatically, you add it manually, replacing all of its
occurrences with the parameter name.
To identify the value that you need to correlate, open the Execution log (View > Output Window)
and locate the response body.
vuser_init.c(8):
vuser_init.c(8):
vuser_init.c(8):
HP LoadRunner (12.00)
Set-Cookie: JServSessionIdroot=my1sanw2n1.JS4; path=/\r\n
Content-Length: 79\r\n
Content-Type: text/plain\r\n
Page 293 of 1743
LoadRunner User Guide
Script Workflow
vuser_init.c(8):
\r\n
vuser_init.c(8):
81-byte response body for "http://ABC-123/servlet/oracle.fo
rms.servlet.ListenerServlet?ifcmd=getinfo=;
ifhost=mercury=;ifip=123.45.789.12" (RelFrameId=1)
vuser_init.c(8):
/servlet/oracle.forms.servlet.ListenerServlet?JServSessionI
droot=my1sanw2n1.JS4\r\n
To correlate this dynamic value, insert a web_reg_save_param function before the first occurrence
and then replace the variable value with the parameter name throughout the script. In this example,
the right and left boundaries are \r and \n, but you should check your specific environment to
determine the exact boundaries in your environment.
web_reg_save_param("NCAJServSessionId","LB=\r\n\r\n","RB=\r","ORD=1",LAST);
web_url("f60servlet",
"URL= http://ABC-"123/servlet/oracle.forms.servlet.ListenerServlet?ifcmd=get
info=;" "ifhost=mercury=;ifip=123.45.789.12", LAST);
web_url("oracle.forms.servlet.ListenerSer",
"URL=http://ABC-123{NCAJServSessionId}?ifcmd=getinfo=;" "ifhost=mercury=;ifi
p=123.45.789.12", LAST);
How to Correlate Scripts - Microsoft .NET
This task describes how to correlate Microsoft .NET Vuser scripts.
Correlate Scripts Using ADO.net Environments
1. Locate the dataset in your script.
Display the Vuser script in the Editor and expand the applicable DATASET_XML statement.
Click View > Snapshot.
2. Locate the value.
Locate the value you want to correlate. To search for a value in a data grid, display the data grid
in the Snapshot pane, and click Search > Quick Find to open the Search dialog box.
In the Search dialog box, click Include in Search, and then select the Snapshots check box.
3. Create a correlation.
Right-click on the value in the grid that you want to correlate and select Create Correlation.
The Create a correlation dialog box opens.
4. Specify a parameter name.
HP LoadRunner (12.00)
Page 294 of 1743
LoadRunner User Guide
Script Workflow
Specify a parameter name, identical to the variable you defined earlier. Click OK. VuGen
prompts you if you want to search for all occurrences. Click OK.
VuGen adds an lr.save_string function before each dataset. For example:
lr.save_string("MyCustomerID", CustomerAndOrdersDataSet_3.Tables["Customers"]
.Rows[0]["CompanyName"].ToString());
5. Reference the parameter at a later point in the script.
Select the value you want to replace with a parameter and select Replace with a parameter
from the right-click menu. Insert the saved variable name in the Parameter name box. Click OK.
VuGen prompts you to replace all of the values with a parameter, using the lr.eval_string
function to evaluate the string's value.
lr.message("The customer ID is""+ lr.eval_string("{MyCustomerID}") + ");
Unlike other protocols, the script includes direct calls to the application or framework method.
Therefore, you cannot replace the string value with the {paramName}—instead you must use
lr.eval_string to evaluate the parameter's value.
Correlate with Output Parameters
For primitive values, you should generate the script with output parameter values and examine the
output parameters for correlations.
1. Select Recording > Recording Options, and select the General > Script node.
2. Select the Insert output parameter values check box. Click OK to close the Recording
Options dialog box.
3. Select Record > Regenerate Script to regenerate the script.
4. Search the commented output primitive values for correlations.
For more information about using correlation functions, see the Function Reference (Help >
Function Reference).
HP LoadRunner (12.00)
Page 295 of 1743
LoadRunner User Guide
Script Workflow
How to Correlate Scripts - Java Scripts - Serialization
In RMI and some cases of CORBA, the client AUT creates a new instance of a Java object using
the java.io.serializable interface. It passes this instance as a parameter for a server invocation. In
the following segment, the instance p is created and passed as a parameter.
// AUT code:
java.awt.Point p =
map.set_point(p);
:
new java.awt.Point(3,7);
The automatic correlation mechanism is ineffective here, since the object did not return from any
previous call. In this case, VuGen activates the serialization mechanism and stores the object
being passed as a parameter. It saves the information to a binary data file under the user folder.
Additional parameters are saved as new binary data files, numbered sequentially. VuGen generates
the following code:
public class Actions {
// Public function: init
public int init() throws Throwable {
java.awt.Point p = (java.awt.Point)lr.deserialize(0, false);
map.set_point(p);
}
:
}
The integer passed to lr.deserialize represents the number of binary data files in the Vuser folder.
To parameterize the recorded value, use the public setLocation method (for information, see the
JDK function reference). The following example uses the setLocation method to set the value of
the object, p.
public class Actions {
// Public function: init
public int init() throws Throwable {
java.awt.Point p = (java.awt.Point)lr.deserialize(0, false);
p.setLocation(2,9);
map.set_point(p);
}
:
:
}
In certain instances the public method of setLocation is not applicable. As an alternative, you can
use the API of your class that incorporate get or set accessor methods. If you are working with AUT
classes that do not have get/set methods or use private methods, or if you are unfamiliar with the
classes' API, you can use VuGen's built-in serialization mechanism. This mechanism allows you to
expand objects in their ASCII representation and manually parameterize the script. You enable this
mechanism in the Recording Options dialog box. For details, see "Recording Properties >
Serialization Options Node" on page 236.
HP LoadRunner (12.00)
Page 296 of 1743
LoadRunner User Guide
Script Workflow
VuGen generates an lr.deserialize method that deserializes the data or displays complex data
structures as serial strings. Once the structure is broken down to its components, it is easier to
parameterize. The lr.deserialize method receives two arguments, a string and an integer. The
string is the parameter's value that is to be substituted during replay. The integer is the index
number of binary file to load.
If you choose not to expand objects in your script by clearing the Unfold Serialized Objects check
box, you can control the serialization mechanism by passing arguments to the lr.deserialize
method. The first argument is an integer indicating the number of binary files to load. The second
integer is a boolean value:
true
Use VuGen's serialization mechanism.
false Use the standard Java serialization mechanism.
The following segment shows a generated script in which the serialization mechanism was
enabled.
public class Actions {
// Public function: init
public int init() throws Throwable {
_string = "java.awt.Point __CURRENT_OBJECT = {" +
"int x = "#5#" +
"int y = "#8#" +
"}";
java.awt.Point p = (java.awt.Point)lr.deserialize(_string,0);
map.set_point(p);
}
:
}
The string values are placed between delimiters. The default delimiter is "#". You can change the
delimiter in the Serialization tab of the recording options. Delimiters are used to speed up the
parsing of the string during replay.
When modifying the string, you must maintain the following rules:
l
Order of lines may not be changed. The parser reads the values one-by-one—not the member
names.
l
Only values between two delimiters may be modified.
l
Object references may not be modified. Object references are indicated only to maintain internal
consistency.
l
"_NULL_" can appear as a value, representing the Java null constant. You can replace it with
string type values only.
l
Objects may be deserialized anywhere in the script. For example, you can deserialize all objects
HP LoadRunner (12.00)
Page 297 of 1743
LoadRunner User Guide
Script Workflow
in the init method and use the values in the action method.
l
Maintain internal consistency for the objects. For example, if a member of a vector is element
count and you add an element, you must modify the element count.
In the following segment, a vector contains two elements:
public class Actions {
// Public function: init
public int init() throws Throwable {
_string = "java.util.Vector CURRENTOBJECT = {" +
"int capacityIncrement = "#0#" +
"int elementCount = #2#" +
"java/lang/Object elementData[] = {" +
"elementData[0] = #First Element#" +
"elementData[1] = #Second Element#" +
"elementData[2] = _NULL_" +
....
"elementData[9] = _NULL_" +
"}" +
"}";
_vector = (java.util.Vector)lr.deserialize(_string,0);
map.set_vector(_vector);
}
:
}
In the following example, one of the vector's elements was changed—a "_NULL_" value was
changed to "Third element". In coordination with the addition of the new element, the
elementCount member was modified to 3.
public class Actions {
// Public function: init
public int init() throws Throwable {
_string = "java.util.Vector CURRENTOBJECT = {" +
"int capacityIncrement = "#0#" +
"int elementCount = #3# " +
"java/lang/Object elementData[] = {" +
"elementData[0] = #First Element#" +
"elementData[1] = #Second Element#" +
"elementData[2] = #Third Element#" +
....
"elementData[9] = _NULL_" +
"}" +
"}";
_vector = (java.util.Vector)lr.deserialize(_string,0);
map.set_vector(_vector);
}
:
}
HP LoadRunner (12.00)
Page 298 of 1743
LoadRunner User Guide
Script Workflow
Due to the complexity of the serialization mechanism, which opens up the objects to ASCII
representation, opening large objects while recording may increase the time required for script
generation. To decrease this time, you can specify flags which will improve the performance of the
serialization mechanism.
When adding lr.deserialize to your script, we recommend that you add it to the init method—not
the action method. This will improve performance since VuGen will only deserialize the strings
once. If it appears in the action method, VuGen will deserialize strings for every iteration.
How to Correlate Scripts - Java
VuGen's Java recorder attempts to automatically correlate statements in the generated script. It
performs correlation on Java objects only. When it encounters a Java primitive (byte, character,
boolean, integer, float, double, short, and long) during recording, the argument values appear in the
script without association to variables. VuGen automatically correlates all objects, arrays of
objects, and arrays of primitives. Note that Java arrays and strings are also considered objects.
VuGen employs several levels of correlation: Standard, Enhanced, Strings. You enable or disable
correlation from the Recording options. An additional method of Serialization can be used to handle
scripts where none of the former methods can be applied.
Standard Correlation
Standard correlation refers to the automatic correlation performed during recording for simple
objects, excluding object arrays, vectors, and container constructs.
When the recorded application invokes a method that returns an object, VuGen's correlation
mechanism records these objects. When you run the script, VuGen compares the generated
objects to the recorded objects. If the objects match, the same object is used. The following
example shows two CORBA objects my_bank and my_account. The first object, my_bank, is
invoked; the second object, my_account, is correlated and passed as a parameter in final line of the
segment:
public class Actions {
// Public function: init
public int init() throws Throwable {
Bank my_bank = bankHelper.bind("bank", "shunra");
Account my_account = accountHelper.bind("account","shunra");
my_bank.remove_account(my_account);
}
:
}
Advanced Correlation
Advanced or deep correlation refers to the automatic correlation performed during recording for
complex objects, such as object arrays and CORBA container constructs.
The deep correlation mechanism handles CORBA constructs (structures, unions, sequences,
arrays, holders, `any's) as containers. This allows it to reference inner members of containers,
additional objects, or different containers. Whenever an object is invoked or passed as a parameter,
it is also compared against the inner members of the containers.
HP LoadRunner (12.00)
Page 299 of 1743
LoadRunner User Guide
Script Workflow
In the following example, VuGen performs deep correlation by referencing an element of an array.
The remove_account object receives an account object as a parameter. During recording, the
correlation mechanism searches the returned array my_accounts and determines that its sixth
element should be passed as a parameter.
public class Actions {
// Public function: init
public int init() throws Throwable {
my_banks[] = bankHelper.bind("banks", "shunra");
my_accounts[] = accountHelper.bind("accounts","shunra");
my_banks[2].remove_account(my_accounts[6]);
}
:
}
The following segment further illustrates enhanced correlation. The script invokes the send_letter
object that received an address type argument. The correlation mechanism retrieves the inner
member, address, in the sixth element of the my_accounts array.
public class Actions {
// Public function: init
public int init() throws Throwable {
my_banks = bankHelper.bind("bank", "shunra");
my_accounts = accountHelper.bind("account", "shunra");
my_banks[2].send_letter(my_accounts[6].address);
}
:
}
String Correlation
String correlation refers to the representation of a recorded value as an actual string or a variable.
When you disable string correlation (the default setting), the actual recorded value of the string is
indicated explicitly within the script. When you enable string correlation, it creates a variable for
each string, allowing you to use it at a later point in the script.
In the following segment, string correlation is enabled—you store the value returned from the get_id
method in a string type variable for use later on in the script.
public class Actions {
// Public function: init
public int init() throws Throwable {
my_bank = bankHelper.bind("bank", "shunra");
my_account1 = accountHelper.bind("account1", "shunra");
my_account2 = accountHelper.bind("account2", "shunra");
string = my_account1.get_id();
string2 = my_account2.get_id();
my_bank.transfer_money(string, string2);
}
:
}
HP LoadRunner (12.00)
Page 300 of 1743
LoadRunner User Guide
Script Workflow
How to Correlate Scripts - XPath Correlation in Flex
Vuser Scripts
This topic describes how to use XPath correlation in Flex Vuser scripts. You use the XML View
inside the Snapshot pane to perform the correlation. Before you can successfully implement XPath
correlation, you must first configure the recording options.
For details on how to use regular correlation in Flex Vuser scripts, see "How to Correlate Scripts
Using Design Studio" on page 280.
1.
Configure the recording options.
a. Select Record > Recording Options.
b. Under Flex, click Externalizable Objects.
c. Click Serialize objects using, and select Custom Java Classes.
d. Click the Add jar or zip file button
.
e. On the LiveCycle installation discs, locate the following three files, and add them to the
Classpath Entries list:
i. flex.jar
ii. flex-messaging-common.jar
iii. flex-messaging-core.jar
Ensure that the added files exist in the same location on all load generator machines.
2. Record the Vuser script.
3. In the Editor, click inside the flex_amf_call step that contains the data you want to correlate, or
in the Step Navigator, double-click the flex_amf_call step that contains the data you want to
correlate.
4. Click View > Snapshot or click the Snapshot button
on the VuGen toolbar.
5. In the Snapshot pane, click the Response Body tab.
6. On the right-side of the Snapshot pane, click the XML View tab.
7. In the XML View, locate and select the entire string that contains the dynamic data that
requires correlation.
8. Right-click inside the selection, and select Create Correlation. The Design Studio opens. For
details on how to use Design Studio, see "Correlation Tab [Design Studio] Overview" on page
275.
HP LoadRunner (12.00)
Page 301 of 1743
LoadRunner User Guide
Script Workflow
When the correlation is complete, VuGen adds a web_reg_save_parm_xpath step to the Vuser
script.
How to Correlate Scripts - COM Protocol
The following steps describe how to correlate COM Vuser scripts.
1. Select View > Output to display the output tabs at the bottom of the window. Check for errors
in the Replay tab. Often, these errors can be corrected by correlation.
2. Select the relevant step in the Step Navigator, and view the step in the Snaphot pane.
3. Right click the value in the snapshot and select Create correlation. This will open the Design
Studio window.
4. Select the value you would like to correlate by highlighting it in the grid and clicking the
Correlate button.
When a value is correlated, VuGen adds the correlation parameter and saves the original value
in a comment in the script.
How to Search for Values that Need Correlation
The following steps describe different ways to search for values that need correlation.
Search by Comparing Scripts
1. Record a script and save it.
2. Create a new script and record the identical operations. Save the script.
3. Select Tools > Compare with Vuser to compare the scripts. For more details, see "How to
Compare Scripts Side by Side" on page 91.
4. Differences in the script are highlighted. Review the differences to determine which ones may
require correlation.
HP LoadRunner (12.00)
Page 302 of 1743
LoadRunner User Guide
Script Workflow
Note: WDiff is the default utility, but you can specify a custom comparison tool. For more
information, see "How to Compare Scripts Side by Side" on page 91.
Replay Log Search
1. Scan the script in script view for strings that may need correlation such as hash strings,
random strings, session ID's, and so on.
2. Search the generation log for the first time that the string appears (this is the response from the
server).
3. Search the extended replay log for the same response. Check to see if this response contains
a different string within the same boundaries as the original suspected string. If yes, this string
requires correlation.
How to Modify Correlation Definitions
You can modify correlation definitions to help eliminate dynamic values that do not require
correlation.These tasks describe how to modify boundary based, regular expression, and XPath
query correlation definitions for record or response correlation.
Modifying Boundary Based Correlation Definitions
1. Click the
Design Studio button on the VuGen toolbar.
2. Select a dynamic value from the correlation grid and expand Details.
3. Edit the Left Boundary or Right Boundary under the Correlation Definition section. You
can modify the definition by adding or deleting text.
HP LoadRunner (12.00)
Page 303 of 1743
LoadRunner User Guide
Script Workflow
4. Click Apply this Definition.
The Apply this Definition button will not be enabled unless the modified boundary definition
occurs in the snapshot and the script.
Note: If you do not apply the definition before selecting another dynamic value in the grid,
your changes will be lost. If you select Replay & Scan before correlating your value with
the modified definition, your changes will be lost.
Modifying Regular Expression Correlation Definitions
1. Click the
Design Studio button on the VuGen toolbar.
2. Select a dynamic value from the correlation grid and expand Details.
3. Edit the Regular Expression under the Correlation Definition section.
4. Click Apply this Definition.
The Apply this Definition button will not be enabled unless the modified boundary definition
occurs in the snapshot and the script.
Note: If you do not apply the definition before selecting another dynamic value in the grid,
your changes will be lost. If you select Replay & Scan before correlating your value with
the modified definition, your changes will be lost.
Modifying XPath Correlation Definitions
1. Click the
Design Studio button on the VuGen toolbar.
2. Select a dynamic value from the correlation grid and expand Details.
3. Edit the XPath definition under the Correlation Definition section.
4. Click Apply this Definition.
HP LoadRunner (12.00)
Page 304 of 1743
LoadRunner User Guide
Script Workflow
The Apply this Definition button will not be enabled unless the modified boundary definition
occurs in the snapshot and the script.
Note: If you do not apply the definition before selecting another dynamic value in the grid,
your changes will be lost. If you select Replay & Scan before correlating your value with
the modified definition, your changes will be lost.
Modifying Winsocket Correlation Definitions
1. Winsocket dynamic values are correlated from the snapshot. To access, select the relevant
step in the Step Navigator, and view the step in the Snaphot pane. The Winsocket protocol
has both a hex and text snapshot.
Right click the value in the snapshot and select Create correlation or Create boundary
correlation. This will open the
Design Studiowindow.
2. Select a dynamic value from the correlation grid and expand Details.
3. If you selected Create correlation, edit the Data Range in the Correlation Definition
section. If you selected Create boundary correlation, edit the left of right boundary.
4. Click Apply this Definition.
The Apply this Definition button will not be enabled unless the modified boundary definition
occurs in the snapshot.
View the following images that display both a Data Range definition and a Boundary definition.
HP LoadRunner (12.00)
Page 305 of 1743
LoadRunner User Guide
Script Workflow
HP LoadRunner (12.00)
Page 306 of 1743
LoadRunner User Guide
Script Workflow
Note: If you do not apply the definition before selecting another dynamic value in the grid,
your changes will be lost. If you select Replay & Scan before correlating your value with
the modified definition, your changes will be lost.
Note: Correlation Rule definitions cannot be modified using this method.
How to Exclude Content Based on Content-Type
The HTTP header "content-type:" defines the type of HTTP response(content). This topic
describes how to exclude content by content-type from the correlation scan by modifying the
IgnoredContent.xml file.
1. Open the <LoadRunner Installation folder>\config\IgnoredContent.xml in a text
editor.
IgnoredContent.xml
<?xml version="1.0" encoding="utf-8" ?>
<IgnoredHttpContentTypes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan
ce" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CONTENT_TYPES>
<string>application/(?!(x-amf|json))</string>
<string>audio/</string>
<string>image/</string>
<string>model/</string>
<string>video/</string>
</CONTENT_TYPES>
</IgnoredHttpContentTypes>
2. Modify the IgnoredContent.xml to exclude content-type by inserting a string or regular
expression.
If you enter:
Correlation studio will:
image/
Ignore any content type beginning with image/ such as
image/gif, image/jpeg, image/png
application/(!?
(json|x-amf))
Ignore content type that begins with application/ except for content
type application/json or application/x-amf.
Example of content added to the IgnoredContent.xml
In our example, the correlation engine will ignore application content except for x-amf , json, or
javascript application content.
<?xml version="1.0" encoding="utf-8" ?>
<IgnoredHttpContentTypes xmlns:xsi="http://www.w3.org/2001/XMLSchema-
HP LoadRunner (12.00)
Page 307 of 1743
LoadRunner User Guide
Script Workflow
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CONTENT_TYPES>
<string>application/(?!(x-amf|json|javascript))</string>
<string>audio/</string>
<string>image/</string>
<string>model/</string>
<string>video/</string>
</CONTENT_TYPES>
</IgnoredHttpContentTypes>
How to Exclude Strings from the Correlation Scan
This topic describes how to exclude strings from the correlation scan.
By default, the correlation engine will scan all plain and html text searching for correlations. Some of
the candidates found may not be real correlations. To enhance correlation accuracy, you can
configure VuGen to ignore certain items, either text strings or regular expressions by adding them to
the Excluded String List.
1.
Add a text string
a. Select Record > Recording Options > Correlations > Configuration.
b. Click the
c. Click the
button.
button to open the Excluded String List dialog box.
d. Enter the string and click OK.
2.
Add a regular expression
a. Select Record > Recording Options > Correlations > Configuration.
Click the
b. Click the
button.
button to open the Excluded String List dialog box.
c. Enter a regular expression and check the Regular Expression box or
Select the
button to view and select from a list box of regular expression character
classes and complete the regular expression.
For example:
HP LoadRunner (12.00)
Page 308 of 1743
LoadRunner User Guide
Script Workflow
If you enter:
Correlation studio will:
Exclude getCachedID as a correlation candidate.
getCachedId
^navurl:.*
Exclude strings such as navurl:\\any_char, navurl:1234 as
correlation candidates.
d. Click OK.
3.
Delete an excluded string
a. Highlight the string in the Excluded String List dialog box.
b. Click the
button.
Correlation Functions - Database Vuser Scripts
When working with Database Vuser scripts, (DbLib, CtLib, Oracle, and so forth) you can use
VuGen's automated correlation feature to insert the appropriate functions into your script. The
correlating functions are:
l
lrd_save_col saves a query result appearing in a grid, to a parameter. This function is placed
before fetching the data. It assigns the value retrieved by the subsequent lrd_fetch to the
specified parameter.
(lrd_ora8_save_col for Oracle 8 and higher)
l
lrd_save_value saves the current value of a placeholder descriptor to a parameter. It is used
with database functions that set output placeholders (such as certain stored procedures under
Oracle).
l
lrd_save_ret_param saves a stored procedure's return value to a parameter. It is used primarily
with database procedures stored in DbLib that generate return values.
Note: VuGen does not apply correlation if the saved value is invalid or NULL (no rows
returned).
For more information about these functions and their arguments, see the Function Reference (Help
> Function Reference).
Correlation Functions - Java Vuser Scripts
To correlate statements for Java Vusers, you can use the Java Vuser correlation functions. These
functions may be used for all Java type Vusers, to save a string to a parameter and retrieve it when
required.
HP LoadRunner (12.00)
Page 309 of 1743
LoadRunner User Guide
Script Workflow
lr.eval_string
Replaces a parameter with its current value.
lr.eval_data
Replaces a parameter with a byte value.
lr.eval_int
Replaces a parameter with an integer value.
lr.eval_string
Replaces a parameter with a string.
lr.save_data
Saves a byte as a parameter.
lr.save_int
Saves an integer as a parameter.
lr.save_string
Saves a null-terminated string to a parameter.
When recording a CORBA or RMI session, VuGen performs correlation internally. For more
information, see "How to Correlate Scripts - Java" on page 299.
Using the Java String Functions
When programming Java Vuser scripts, you can use the Java Vuser string functions to correlate
your scripts. In the following example, lr.eval_int substitutes the variable ID_num with its value,
defined at an earlier point in the script.
lr.message(" Track Stock: " + lr.eval_int(ID_num));
In the following example, lr.save_string assigns John Doe to the parameter Student. This
parameter is then used in an output message.
lr.save_string("John Doe", "Student");
// ...
lr.message("Get report card for " + lr.eval_string("<Student>"));
classroom.getReportCard
Web_reg_save_param function details
When you run a script, the web_reg_save_param function scans the subsequent HTML page that
is accessed. You specify a left and/or right boundary and VuGen searches for text between those
boundaries. When VuGen finds the text, it assigns it to a parameter.
The function's syntax is as follows:
int web_reg_save_param (const char *mpszParamName, <List of Attributes>, LAST);
The following table lists the available attributes. Note that the attribute value strings (for example,
Search=all) are not case sensitive.
HP LoadRunner (12.00)
Page 310 of 1743
LoadRunner User Guide
Script Workflow
NotFound
The handling method when a boundary is not found and an empty string is
generated. "ERROR," the default, indicates that VuGen should issue an error
when a boundary is not found. When set to "EMPTY," no error message is issued
and script execution continues. Note that if Continue on Error is enabled for the
script, then even when NOTFOUND is set to "ERROR," the script continues
when the boundary is not found, but it writes an error message to the Extended
log file.
LB
The left boundary of the parameter or the dynamic data. This parameter must be a
non-empty, null-terminated character string. Boundary parameters are case
sensitive; to ignore the case, add "/IC" after the boundary. Specify "/BIN" after
the boundary to specify binary data.
RB
The right boundary of the parameter or the dynamic data. This parameter must be
a non-empty, null-terminated character string. Boundary parameters are case
sensitive; to ignore the case, add "/IC" after the boundary. Specify "/BIN" after
the boundary to specify binary data.
RelFrameID
The hierarchy level of the HTML page relative to the requested URL. The possible
values are ALL or a number.
Search
The scope of the search—where to search for the delimited data. The possible
values are Headers (search only the headers), Body (search only body data, not
headers), or ALL (search body and headers). The default value is ALL.
ORD
This optional parameter indicates the ordinal or occurrence number of the match.
The default ordinal is 1. If you specify "All," it saves the parameter values in an
array.
SaveOffset
The offset of a sub-string of the found value, to save to the parameter. The default
is 0. The offset value must be non-negative.
Savelen
The length of a sub-string of the found value, from the specified offset, to save to
the parameter. The default is -1, indicating until the end of the string.
Convert
The conversion method to apply to the data:
HTML_TO_URL: convert HTML-encoded data to a URL-encoded data format
HTML_TO_TEXT: convert HTML-encoded data to plain text format
Correlation Functions - C Vuser Scripts
To correlate statements for protocols that do not have specific functions, you can use the C Vuser
correlation functions. These functions can be used for all C-type Vusers, to save a string to a
parameter and retrieve it when required.
lr_eval_string
Replaces all occurrences of a parameter with its current value.
lr_save_string
Saves a null-terminated string to a parameter.
lr_save_var
Saves a variable length string to a parameter.
HP LoadRunner (12.00)
Page 311 of 1743
LoadRunner User Guide
Script Workflow
For additional information about the syntax of these functions, see the Function Reference (Help >
Function Reference).
Using lr_eval_string
In the following example, lr_eval_string replaces the parameter row_cnt with its current value. This
value is sent to the Output window using lr_output_message.
lrd_stmt(Csr1, "select count(*) from employee", -1, 1 /*Deferred*/, ...);
lrd_bind_col(Csr1, 1, =;COUNT_D1, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
lrd_save_col(Csr1, 1, 1, 0, "row_cnt");
lrd_fetch(Csr1, 1, 1, 0, PrintRow2, 0);
lr_output_message("value: %s" , lr_eval_string("The row count is: <row_cnt>"));
Using lr_save_string
To save a NULL terminated string to a parameter, use lr_save_string. To save a variable length
string, use lr_save_var and specify the length of the string to save.
In the following example, lr_save_string assigns 777 to a parameter emp_id. This parameter is then
used in another query or for further processing.
lrd_stmt(Csr1, "select id from employees where name='John'",...);
lrd_bind_col(Csr1,1,=;ID_D1,...);
lrd_exec(Csr1, ...);
lrd_fetch(Csr1, 1, ...);
/* GRID showing returned value "777" */
lr_save_string("777", "emp_id");
Design Studio [Correlation Tab] Dialog Box
This dialog box enables you to scan for, correlate, and view information about dynamic values in
your script.
To access
Click the
Design Studio button on the VuGen toolbar.
The button is enabled only when you have a recorded script in the Solution
Explorer.
Important
information
"Correlation Tab [Design Studio] Overview" on page 275
Relevant tasks
"How to Correlate Scripts Using Design Studio" on page 280
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Correlation Tab
Replay and
Scan
HP LoadRunner (12.00)
Design studio scans for dynamic values using all enabled types: rule, record,
and replay.
Page 312 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Correlate
Replace a dynamic value in the script with a correlation parameter.
Add as Rule
Add dynamic value definition as a rule.
Rule name. Enables you to specify a rule name.
Application Name. Enables you to associate the rule to a specific
application.
For details, see "Correlations > Rules" on page 186.
Undo
Correlation
Replace the correlation parameter with the original dynamic value.
Discard
Delete the selected dynamic values from the correlation grid. You can only
use the discard action when the dynamic value has a status of New.
In addition, this action adds the text to the list of excluded strings. You can
edit the list in Recording Options > Correlation > Configuration >
Excluded string list.
View
Enables you to filter values found for correlation by the following types:
l
All
l
New
l
Correlated
Correlation Grid
Displays details about each dynamic value in the script
Type
HP LoadRunner (12.00)
Displays which engine found the dynamic value for correlations:
l
Record
l
Rules
l
Replay
l
Manual
Page 313 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Found/Replace Displays information about the number of dynamic values found with the
same definitions. Since you can perform partial correlation, meaning you can
replace specific occurrences, the information displayed depends on if you
have correlated the value or not.
l
Before you correlate
Number of values that can be replaced/ Number of values found
l
After you correlate
Number of values that have been replaced/Number of values found.
Status
Displays correlation status of the dynamic value from the script:
l
New
l
Correlated
Text in
Response
Displays the string of the dynamic value from the script.
Correlation
Parameter
Displays the correlation parameter name of the dynamic value.
Correlation Details Chevron
Displays details about the dynamic value in the snapshot/script
Original Snapshot Step Tab
Step in Script Details
Name
Displays the step name in the script where the dynamic value was found.
Line
Displays the line of the script where the dynamic value was found.
Action Name
Displays the name of action from the script where the dynamic value was
found.
Description
Displays a description of the step.
Correlation Definition Details
Type
Display API function that will be used to correlate the value.
Regular expression: web_reg_save_param_regexp
Boundary based: web_reg_save_param_ex
HP LoadRunner (12.00)
Page 314 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Definition
Displays the definition of the dynamic value.
Apply
Definition
l
Regular Expression. Dynamic value correlation is defined by a regular
expression. A regular expression is a special text string for describing a
search pattern.
l
Boundary based. Dynamic value correlation is defined by left and right
boundary text strings.
Enables you to select which definition to apply to the dynamic value. You can
scroll through the definition of the dynamic value in Occurrences in
Snapshot by clicking Prev or Next buttons.
Occurrences in Record snapshot. Displays all the occurrences of the dynamic value in the
Snapshot
record snapshot once the script as been replayed. You can scroll to view each
occurrence in the snapshot.
Replay snapshot.If the scan type of Replay has been selected, Design
Studio displays all the occurrences of the dynamic value in the replay
snapshot once the script as been replayed. You can scroll to view each
occurrence in the snapshot.
Note: Once the value has been correlated, the replay snapshot will be
blank. If you modify the Correlation Definition, the replay snapshot will
be blank.
Correlation Occurrences Tab
Occurrences in Displays the occurrences of the dynamic value in your script. You can
Script
correlate all the values or select individual values to correlate by selecting the
check box adjacent to the occurrence.
Options
Opens the Recording Options dialog box.
For details, see:
"Correlations > Configuration" on page 184
"Correlations > Rules" on page 186
HP LoadRunner (12.00)
Page 315 of 1743
LoadRunner User Guide
Script Workflow
Replaying a Vuser Script
The Replaying a Vuser Script section describes the various methods that are available to replay
Vuser scripts.
Replaying - Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
forth step, replaying a Vuser script.
After recording a Vuser script, you use VuGen to replay the script. This helps to test the basic
functionality of the Vuser script, as well as helps you to uncover errors and issues that need to be
addressed. The need for correlation is a typical issue that is revealed when you first replay a script.
For details on correlation, see "Correlation Overview" on page 274. When the replay is successful,
you are ready to add load-testing functionality to the script. Such functionality could include
parameterization, transactions, and rendezvous points.
l
For details on how to replay a Vuser script, see "How to Replay a Vuser Script" below.
l
If you encounter problems when you replay the script, yo can use VuGen's debugging
functionality to help resolved the issues. For details, see "Debugging - Overview" on page 388.
l
For details on the files that VuGen creates during a script replay, see "Files Generated During
Replay" on page 386.
l
You can use bookmarks to navigate between sections of the script. For details, see "Bookmarks
Overview" on page 382.
l
You can run a Vuser script from a Windows command prompt. For details, see "How to Run a
Vuser Script from a Command Prompt" on page 382.
l
You can run a Vuser script from a Linux command line. For details, see "How to Run a Vuser
Script from a Linux Command Line" on page 383.
How to Replay a Vuser Script
This task describes how to replay a Vuser script.
1.
Configure the run-time settings and replay options
a. Run-time settings control how your Vuser script is replayed. Access the desired run-time
settings by double-clicking the Run-Time Settings node in the Solution Explorer.
For an overview of run-time settings, see Run-Time Settings Overview.
HP LoadRunner (12.00)
Page 316 of 1743
LoadRunner User Guide
Script Workflow
b. Specify replay options by selecting Tools > Options. For details on options, see "Options
Overview" on page 94.
2.
Replay the script
To run a Vuser script until the end of the script or until the next breakpoint, perform one of the
following:
n
Select Replay > Run.
n
Click the Run button
n
Press F5.
on the Vuser toolbar.
Note: The status of the Vuser script execution appears in the lower left corner of VuGen.
The script execution status may be Ready, Running, or Paused.
3.
n
To stop a script that is running, click the Stop Replay
button on the VuGen toolbar.
n
To pause a script that is running, click the Pause
n
To continue running a script that is paused, click the Continue
toolbar.
button on the VuGen toolbar.
button on the VuGen
View the logs for detailed information
You can view detailed information about how your script behaved during the replay. This
information appears in the Output window. For details, see "Output Pane" on page 124.
To learn more about replaying a Vuser script, see "Replaying - Overview" on the previous page.
Run-Time Settings
This section describes the various Vuser run-time settings.
Run-Time Settings - Miscellaneous Topics
This section contains a variety of topics relating to run-time settings.
Content Checking Overview
You use the ContentCheck run-time options to check the contents of a page for a specific string.
This is useful for detecting non-standard errors. In normal operations, when your application server
fails, the browser displays a generic HTTP error page indicating the nature of the error. The
standard error pages are recognized by VuGen and treated as errors, causing the script to fail.
Some application servers, however, issue their own error pages that are not detected by VuGen as
HP LoadRunner (12.00)
Page 317 of 1743
LoadRunner User Guide
Script Workflow
error pages. The page is sent by the server and it contains a formatted text string, stating that an
error occurred.
For example, suppose that your application issues a custom page when an error occurs, containing
the text ASP Error. You instruct VuGen to look for this text on all returned pages. When VuGen
detects this string, it fails the replay.
Note: VuGen searches the body of the pages—not the headers.
Copying, Importing, and Exporting Run-Time Settings
This topic describes how to copy, import, and export run-time settings from one Vuser script to
another. This functionality is available for all Vuser protocols. For an overview of the run-time
settings functionality, see Run-Time Settings - Overview.
Note: In all the tasks below:
l
The script from which the run-time settings are being taken will be referred to as Script A
l
The receiving script will be referred to as Script B.
How to copy run-time settings from one script to another
1. Make sure that both Script A and Script B are open.
2. In the Solution Explorer pane, right click on the Run-Time Settings node of Script A and select
Copy in the context menu.
3. In the Solution Explorer pane, right click on the Run-Time Settings node of Script B and select
Paste in the context menu.
4. In the message box asking if you are sure, click Yes.
5. Save Script B.
Note: The settings from Script A are copied to Script B using the following logic:
l
Setting in Script A and setting in Script B: The setting in Script B is overwritten
l
Setting in Script A and no setting in Script B: The setting in Script B is set to the value of the
setting in Script A.
l
No setting in Script A and setting in Script B: The setting in Script B remains the same.
HP LoadRunner (12.00)
Page 318 of 1743
LoadRunner User Guide
Script Workflow
How to export run-time settings from Script A
1. Open Script A.
2. In the Solution Explorer pane, right click on the Run-Time Settings node of the script and select
Export.
3. In the Export run-time settings dialog, choose a location for the file, type a name for the file,
ensure that the file type is Script Settings Files (*.xsss) and click OK.
How to import run-time settings to Script B
1. Open Script B.
2. In the Solution Explorer pane, right click the Run-Time Settings node of on the script and select
Import.
3. In the Import run-time settings dialog, select the file to be imported and click OK.
4. In the message box asking if you are sure, click Yes.
5. Save Script B.
Note: The settings from Script A are copied to Script B using the following logic:
l
Setting in Script A and setting in Script B: The setting in Script B is overwritten
l
Setting in Script A and no setting in Script B: The setting in Script B is set to the value of the
setting in Script A.
l
No setting in Script A and setting in Script B: The setting in Script B remains the same.
How to revert run-time settings in a script node to the default settings
1. In the Solution Explorer pane, select the Run-Time Settings node of the script to be changed
and navigate to the required setting.
2. Click Use Defaults.
3. Click OK.
4. Save the script. Only the defaults for the displayed node are changed. If you want to revert to
the default settings for all the run-time settings, you must do so for each individual node
separately.
Note:
HP LoadRunner (12.00)
Page 319 of 1743
LoadRunner User Guide
Script Workflow
l
Run-time settings can only be modified with Copy/Paste and Import/Export from within
VuGen.
l
Copy/Paste is only effective for the common run-time settings such as Think Time,
Iterations, and Log.
Multithreading
The Controller uses a driver program (such as mdrv.exe or r3vuser.exe) to run your Vusers. If you
run each Vuser as a process, then the same driver program is launched (and loaded) into the
memory again and again for every instance of the Vuser. Loading the same driver program into
memory uses up large amounts of RAM (random access memory) and other system resources.
This limits the numbers of Vusers that can be run on any load generator.
Alternatively, if you run each Vuser as a thread, the Controller launches only one instance of the
driver program (such as mdrv.exe), for every 50 Vusers (by default). This driver process/program
launches several Vusers, each Vuser running as a thread. These threaded Vusers share segments
of the memory of the parent driver process. This eliminates the need for multiple re-loading of the
driver program/process saves much memory space, thereby enabling more Vusers to be run on a
single load generator.
To configure these options, see "General > Miscellaneous Node" on page 348.
Protocol Compatibility Table
The following table lists the Vuser protocols and which run-time setting nodes are available for each
protocol.
Protocol
Run-Time Setting Nodes
.NET
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
.NET - .NET Environment
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Internet Protocol - Proxy, Preferences, Download Filters,
ContentCheck
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
Ajax
C Vuser
HP LoadRunner (12.00)
Page 320 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Run-Time Setting Nodes
Citrix ICA
l
General – Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network – Speed Simulation
l
Citrix – Configuration, Synchronization
COM/DCOM
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
DNS
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
FTP
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Flex - RTMP, Configuration, Externalizable Objects
l
Internet Protocol - Proxy, Preferences, Download Filters,
Content Check
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Java Environment Settings - Classpath, Java VM
l
Internet Protocol - Proxy, Preferences, Download Filters
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Java Environment Settings - Classpath, Java VM
Flex
IMAP (Internet Messaging)
Java over HTTP
Java Record Replay, Java
Vuser
HP LoadRunner (12.00)
Page 321 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Run-Time Setting Nodes
LDAP
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
RDP - Configuration, Synchronization, Advanced, RDP
Agent
MAPI (Microsoft Exchange
)
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
MMS (Multimedia
Messaging Service)
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Browser - Browser Emulation
l
MMS - Server and Protocol
l
WAP - Radius, Gateway
l
Internet Protocol - Proxy, Preferences, Download Filters
ODBC
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
Oracle 2-Tier
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
Oracle NCA
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Oracle NCA - Client Emulation
MMS (Media Player)
RDP
HP LoadRunner (12.00)
Page 322 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Run-Time Setting Nodes
Oracle Web Applications
11i
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Internet Protocol - Proxy, Preferences, Download Filters,
ContentCheck
l
Oracle NCA - Client Emulation
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
RTE - RTE
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Internet Protocol - Proxy, Preferences, Download Filters,
ContentCheck
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Internet Protocol - Proxy, Preferences, Download Filters,
ContentCheck
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
SAP GUI - General
l
Network - Speed Simulation
POP3
RTE
SAP Web
SAP Click & Script
SAP GUI
HP LoadRunner (12.00)
Page 323 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Run-Time Setting Nodes
Siebel Web
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Internet Protocol - Proxy, Preferences, Download Filters,
ContentCheck
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Silverlight - Services
l
Data Format Extensions - Configuration
l
Internet Protocol - Proxy, Preferences, Download Filters,
ContentCheck
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
TruClient Ajax
l
General - Pacing, Additional Attributes, Log, Load Mode
Browser Settings, Other Settings
Web (HTTP/HTML)
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
Browser - Browser Emulation
l
Internet Protocol - Proxy, Preferences, Download Filters,
Content Check
l
Data Format Extension - Configuration
Silverlight
SMTP
HP LoadRunner (12.00)
Page 324 of 1743
LoadRunner User Guide
Script Workflow
Protocol
Run-Time Setting Nodes
Web Services
l
General - Run Logic, Pacing, Log, Think Time, Additional
Attributes, Miscellaneous
l
Network - Speed Simulation
l
JMS - Advanced
l
General - Pacing, Log, Think Time, Additional Attributes,
Miscellaneous
l
Network - Speed Simulation
Windows Sockets
Browser > Browser Emulation Node
Enables you to configure the browser related run-time settings.
To access
VuGen > Replay > Run-Time Settings > Browser > Browser Emulation
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
HP LoadRunner (12.00)
Page 325 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Description
Simulate
Browser
Cache
Instructs the Vuser to simulate a browser with a cache (enabled by default). Even if
you disable this option, each resource is only downloaded once for each page, even
if it appears multiple times. A resource can be an image, a frame, or another type of
script file. Enabling this options allows you to set the following options:
Cache URLs requiring content (HTML). Instructs VuGen to cache only the
URLs that require the HTML content. The content may be necessary for parsing,
verification, or correlation. When you select this option, HTML content is
automatically cached.
l
Specify URLs requiring content in addition to HTML pages. Allows you to
specify addiitonal (non- html) content types that you want to store in the cache.
Separate all contents types with a semicolon in the following row, Content
types.
Tip: To maintain a smaller memory footprint for the virtual users, keep this
option disabled unless it is an explicit requirement for your test.
.
l
Check for newer versions of stored pages every visit to the page. Instructs
the browser to check for later versions of the specified URL than those stored in
the cache. When you enable this option, VuGen adds the "If-modified-since"
attribute to the HTTP header. This option brings up the most recent version of
the page, but also generates more traffic during the scenario or session
execution.
Default value: disabled.
Download
nonHTML
resources
Instructs Vusers to load graphic images when accessing a Web page during replay.
This includes both graphic images that were recorded with the page, and those
which were not explicitly recorded along with the page. When real users access a
Web page, they wait for the images to load. Therefore, enable this option if you are
trying to test the entire system, including end-user time. To increase performance
and not emulate real users, disable this option.
Disable this option if you experience discrepancies in image checks, since some
images vary each time you access a Web page (for example, advertiser banners).
HP LoadRunner (12.00)
Page 326 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Description
Simulate
a new
user each
iteration
Instructs VuGen to reset all HTTP contexts between iterations to their states at the
end of the init section. This setting allows the Vuser to more accurately emulate a
new user beginning a browsing session. It deletes all cookies, closes all TCP
connections (including keep-alive), clears the emulated browser's cache, resets the
HTML frame hierarchy (frame numbering will begin from 1) and clears the usernames and passwords. (Enabled by default)
Note: Async conversations are terminated at the end of each iteration even if
this setting is disabled.
l
User
AgentSelection
Clear cache on each iteration. Clears the browser cache for each iteration in
order to simulate a user visiting a Web page for the first time. Clear the check
box to disable this option and allow Vusers to use the information stored in the
browser's cache, simulating a user who recently visited the page.
Allows you to select the browser to emulate or specify a custom user-agent string.
All Internet Vuser headers include a User Agent header that identifies the type of
browser (or toolkit for Wireless) that is being emulated. For example, Mozilla/4.0
(compatible; MSIE 6.0; Windows; Trident/4.0; English (United States))
identifies the browser as Internet Explorer running under Windows on an Intel
machine.
Use browser. Uses a standard browser available from the drop-down list. You
select the version, platform and language.
Custom browser. Indicates a custom user-agent string.
Citrix > Configuration Node
Enables you to set the Citrix configuration run-time settings.
To access
VuGen > Replay > Run-Time Settings > Citrix > Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Queue
mouse
movements
and
keystrokes
Instructs Vusers to create a queue of mouse movements and keystrokes, and
send them as packets to the server less frequently. This setting reduces
network traffic with slow connections. Enabling this option makes the session
less responsive to keyboard and mouse movements.
Default value: disabled.
HP LoadRunner (12.00)
Page 327 of 1743
LoadRunner User Guide
Script Workflow
Sound
quality
Specifies the quality of the sound. If the client machine does not have a 16-bit
Sound Blaster-compatible sound card, select Sound Off. With sound support
enabled, you will be able to play sound files from published applications on your
client machine.
SpeedScreen The mechanism used to enhance user interaction when the network speed is
Latency
slow. You can turn this mechanism on or off, depending on the network speed.
Reduction
The auto option turns it on or off based on the current network speed. If you do
not know the network speed, set this option to Use Server Default to use the
machine's default.
Use data
compression
Instructs Vusers to compress the transferred data. You should enable data
compression if you have a limited bandwidth.
Default value: enabled.
Use disk
cache for
bitmaps
Instructs Vusers to use a local cache to store bitmaps and commonly-used
graphical objects. You should enable this option if you have a limited bandwidth.
Default value: disabled.
Citrix > Synchronization Node
Enables you to set the Citrix synchronization run-time settings.
To access
VuGen > Replay > Run-Time Settings > Citrix > Synchronization
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Default
Image Sync
Tolerance
This setting controls the level of equality two images must share to be
considered synchronized.
Exact. Must have a 100% match.
Low. Must have a 95% match.
Medium. Must have an 85% match.
High. Must have a 70% match.
Default value: Exact.
Timeout
l
Connect Time. The time (in seconds) to wait idly at an established
connection before exiting.
l
Waiting Time. The time (in seconds) to wait idly at a synchronization point
before exiting.
Typing rate
The delay (in milliseconds) between keystrokes.
HP LoadRunner (12.00)
Page 328 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Default
Image Sync
Tolerance
The default tolerance level for performing synchronization on images: Exact,
Low, Medium, or High.
Mouse click
internal
delay
The delay (in milliseconds) between sending MOUSE_UP and MOUSE_DOWN
events.
Bitmap
polling
delay
The intervals, in milliseconds, in which to poll the state of the screen during
bitmap synchronization.To use the standard Citrix client notifications instead of
forced polling, specify 0.
COM/DCOM > Filter Node
Enables you to define which COM/DCOM objects to record.
To access
Use one of the following:
l
Record > Recording Options > COM/DCOM > Filter
l
Replay > Runtime Settings > COM/DCOM > Filter
User interface elements are described below:
UI Element
Description
DCOM
Profile
Specify one of the following filter types:
l
Default Filter. The filter to be used as the default when recording a COM
Vuser script.
l
New Filter. A clean filter based on the default environment settings. Note that
you must specify a name for this filter before you can record with its settings.
You can also save the current settings and delete a filter using the Save As and
Delete buttons.
HP LoadRunner (12.00)
Page 329 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
DCOM
Listener
Settings
List
Displays a tree hierarchy of type libraries. You can expand the tree to show all of
the available classes in the type library. You can expand the class tree to show all
of the interfaces supported by that class.
To exclude a type library, clear the check box next to the library name. This
excludes all of its classes in that type library. By expanding the tree, you can
exclude individual classes or interfaces by clearing the check box next to the
item.
An interface can be implemented differently by various classes. When you
exclude an interface that is implemented by other classes that have not been
excluded, a dialog box opens asking you if you also want to exclude the interface
in all classes that implement it this interface.
Note that when you clear the check box adjacent to an interface, it is equivalent
to selecting it in the Excluded Interfaces dialog box.
l
Environment. The environments to record: ADO objects, RDS Objects, and
Remote Objects. Clear the objects you do not want to record.
l
Type Libraries. A type library .tlb or .dll file, that represents the COM object
to record. All COM objects have a type library that represents them. You can
select a type library from the Registry, Microsoft Transaction Server, or file
system.
Type Libraries. In the lower section of the dialog box, VuGen displays the
following information for each type library.
l
TypLib. The name of the type library (tlb file).
l
Path. The path of the type library.
l
Guid. The Global Unique Identifier of the type library.
Adds another COM type library.
l
Browse Registry. Displays a list of type libraries found in the registry of the
local computer. Select the check box next to the desired library or libraries and
click OK.
l
Browse file system. Allows you to select type libraries from your local file
system.
l
Browse MTS. add a component from a Microsoft Transaction Server. The
MTS Components dialog box prompts you to enter the name of the MTS
server.
Type the name of the MTS server and click Connect. Remember that to record
MTS components you need an MTS client installed on your machine.
Select one or more packages of MTS components from the list of available
packages and click Add. Once the package appears in the list of Type Libraries,
you can select specific components from the package.
HP LoadRunner (12.00)
Page 330 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Removes a COM type library.
Excludes interfaces in the filter through the Excluded Interfaces dialog box.
In this dialog box, the checked interface listings are the ones that are excluded.
You can also add interfaces that are not listed. Click Add Interface... in the
Excluded Interfaces dialog box and enter the GUID number (interface ID) and
name of the interface. You can copy the GUID from the interfaces.h file created
by VuGen and listed in the selection tree in the left-hand column of the VuGen
screen. Use the Add Interface... feature to exclude interfaces that are called
needlessly by the script, but are not listed anywhere in the filter.
An interface can be implemented differently by various classes. When you
exclude an interface that is implemented by other classes that have not been
excluded, VuGen displays the a warning. If you check Don't ask me again and
close the dialog box, then the status of all instances of the interface in all other
classes will be changed automatically for this filter, whenever you change the
status of the interface in one object. Click Yes to all to change the status of all
instances of this interface for all other classes, click No to all to leave the status
of all other instances unchanged. Click Next Instance to view the next class that
uses this interface.
COM/DCOM > Options Node
Enables you to set additional options for your COM recording session, relating to the handling of
objects, generation of logs, and VARIANT definitions.
The DCOM scripting options apply to all programming languages. These settings let you configure
the scripting options for DCOM methods and interface handling.
To access
VuGen > Replay > Run-time Settings > COM/DCOM > Options
User interface elements are described below:
UI Element
Description
ADO Recordset filtering
Condense multiple recordset operations into a single-line fetch
statement (enabled by default).
Declare Temporary
VARIANTs as Globals
Define temporary VARIANT types as Globals, not as local
variables (enabled by default).
Fill array in separate
scopes
Fill in each array in a separate scope (enabled by default).
Fill structure in separate
scopes
Fill in each structure in a separate scope (enabled by default).
HP LoadRunner (12.00)
Page 331 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Generate COM exceptions
Generate COM functions and methods that raised exceptions
during recording (disabled by default).
Generate COM statistics
Generate recording time performance statistics and summary
information (disabled by default).
Limit size of SafeArray log
Limit the number of elements printed in the safearray log per
COM call, to 16 (enabled by default).
Release COM Objects
Record the releasing of COM objects when they are no longer in
use (enabled by default).
Save Recordset content
Stores Recordset content as grids, to allow viewing of recordset
in VuGen (enabled by default).
Trap binded moniker
objects
Trap all of the bound moniker objects (disabled by default).
Data Format Extension > Configuration Node
Enables Data Format Extensions during code generation.
To access
VuGen > Replay > Run-Time Settings > Data Format Extension >
Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 246.
Relevant
tasks
See also
l
"How to Apply DFE Chains to Sections of the HTTP Message" on page 837
l
"Implementing GWT-DFE Support" on page 845
l
"Data Format Extensions (DFEs) - Overview" on page 831
l
"Data Format Extension List" on page 839
User interface elements are described below:
UI Element
Description
Enable data format
extension
Enables you to select chains for each message section of the HTTP
message. Deselected by default.
Flex > Configuration Node (Run-Time Settings)
Enables you to set an external JVM (Java Virtual Machine) path.
HP LoadRunner (12.00)
Page 332 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Replay > Run-Time Settings > Flex > Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Use External JVM
Enables you to use an external JVM. If you choose this option, you must
specify the path:
External JVM Path The full path of the external JVM.
Use GraniteDS
configuration
Defines the server side Data Service configuration.
Maximum
Formatted
Request/Response
size to print
Enables you to specify the maximum character length of a request or
response body to be captured in the log files. The option only affects the
flex_amf_call and flex_remoting_call steps.
If you select this option, do not select Use Flex LCDS/BlazeDS jars to
serialize the messages in the Externalizable node.
For example, if you specify a value of 1048576 characters (1MB), only
responses or requests with a length less than a megabyte will be printed
on the Code Generation or Replay log.
Flex > RTMP Node
Enables you to set the Flex RTMP run-time settings.
To access
VuGen > Replay > Run-Time Settings > Flex > RTMP
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Close all open
RTMP
connections
after each
iteration
Automatically disconnects any open RTMP connections at the end of each
iteration.
HP LoadRunner (12.00)
Page 333 of 1743
LoadRunner User Guide
Script Workflow
TCP receive
timeout
(milliseconds)
Specifies the time interval in milliseconds during which waits for the client to
start receiving TCP/IP packets. If a timeout has been reached, triggers a
warning or error depending on the run-time setting for Status for TCP
receive timeout.
Status for TCP
receive timeout
Indicates which status to issue for a step when timeout is exceeded.
Warning
Issues a warning for the step when the timeout is exceeded. continues to the
next step.
Error
Issues an error for the step when the timeout is exceeded. The script ends.
Flex > Externalizable Node (Run-Time Settings)
The dialog box enables you to configure run time setting for externalizable objects in Flex scripts.
To access
VuGen > Replay > Run-Time Settings > Flex > Externalizable
Relevant tasks
l
How to Serialize Using External Java Serializer
l
"How to Serialize Flex Scripts " on page 645
l
"Flex Overview" on page 625
l
" Externalizable Objects in Flex Scripts" on page 642
See also
User interface elements are described below:
UI Element
Description
Do not
Run externalizable objects without encoding.
encode
externalizable
objects
HP LoadRunner (12.00)
Page 334 of 1743
LoadRunner User Guide
Script Workflow
Encode
Select the appropriate radio button:
externalizable
objects using l LoadRunner AMF serializer. Use the Flex server parser to encode and
decode externalizable objects. Select this option if you are not using the
Adobe LiveCycle Data Services (LCDS) or Adobe BlazeDS server.
l
Custom Java classes. Use an external parser to encode and decode
externalizable objects. Select one or both of the following options:
n
Use Flex LCDS/BlazeDS jars.Use Flex LCDS or BlazeDS jars to
serialize the messages. If you selected UseGraniteDS configuration in
the Configuration node, do not enable this option.
n
Use additional jars. Use Flex global jars to serialize the messages.
Specify the full path to the jar file locations in the Flex server/application
jar file location(s) box. Separate multiple entries with a semicolon. If
your jars have the same names as the LCDS or BlazeDS jars, with the
Use Flex LCDS/BlazeDS jars option enabled, they will be overwritten.
General > Additional Attributes Node
You can use the Additional Attributes node to provide additional arguments for a Vuser script. The
Additional Attributes settings apply to all Vuser script types.
You specify command line arguments that you can retrieve at a later point during the test run, using
lr_get_attrib_string. Using this node, you can pass external parameters to prepared scripts.
To access
VuGen > Replay > Run-Time Settings > General > Additional Attributes
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Additional Attributes table>
A list of the additional attributes and their values.
Add a new argument.
Remove an argument.
General > Log Node
Enables you to configure the amount and types of information that is recorded in the log.
To access
VuGen > Replay > Run-Time Settings > General > Log
HP LoadRunner (12.00)
Page 335 of 1743
LoadRunner User Guide
Script Workflow
User interface elements are described below:
UI
Element
Description
Enable
logging
Enables automatic logging during replay. Disabling this options only affects
automatic logging and log messages issued through lr_log_message. Messages
sent manually, using lr_message, lr_output_message, and lr_error_message,
are still issued.
Log
options
Indicates when messages are sent to the log:
Standard
log
l
Send messages only when an error occurs. Sends messages to the log only
when an error occurs. Click Advanced to configure the log cache size. If the
contents of the cache exceed the specified size, VuGen deletes the oldest items.
l
Always send messages. Sends all messages to the log.
Creates a standard log of functions and messages sent during script execution to
use for debugging. You can disable this option for large load testing scenarios or
profiles if you wish to save system resources.
Extended Creates an extended log, including warnings and other messages. You can disable
log
this option for large load testing scenarios or profiles if you wish to save system
resources.
You can also specify the following options:
l
Parameter substitution. Logs all parameters assigned to the script along with
their values.
l
Data returned by server. Logs all of the data returned by the server.
l
Advanced trace. Logs all of the functions and messages sent by the Vuser
during the session.
General > Log Node (AjaxTruClient)
Enables you to configure the amount and types of information that is reported to a log for Ajax
TruClient scripts.
To access
VuGen > Replay > Run-Time Settings > General > Log
User interface elements are described below:
HP LoadRunner (12.00)
Page 336 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Log Level and
Associated
Options
Error-only
l
Select to log only error messages.
Standard log
l
Log errors/warnings only (in Standard log). Select to log errors and
warnings only. Informative messages are not included.
In Extended log, all messages ignored due to this option are included,
regardless of this setting.
Extended Log
l
Select to log low-level informative messages and all messages included
in the Standard log.
HTTP-related messages
l
Log HTTP request headers. Log HTTP request header of each
request.
l
Log HTTP request body (POST data). Log the HTTP request body of
each request.
l
Log HTTP response headers. Log the HTTP response headers of
each response.
l
Log HTTP response body. Log the HTTP response body of each
response.
l
Log HTTP trace. Log the HTTP request/response handling Application
under Test (AUT) messages
Application under test (AUT) messages
l
Log AUT error messages. Logs error messages which are received
from the application under test.
l
Log AUT non-error messages. Log informative messages which are
received from the application under test.
Parameterization
l
HP LoadRunner (12.00)
Log Parameter substitution. Logs the parameters and the values used
when the Vuser script runs.
Page 337 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Create a log file
only if required
Accumulate messages in memory, write only if required.
l
Select to log messages only when an error occurs.
l
Accumulate Messages in Memory Buffer Size. Enter the memory
buffer size where important messages are logged.
Note: If the size is too small, messages will be lost. If the size is too
large, this may contribute to paging issues and slow execution.
Log Message
Formatting
Options
User Log Line Length.
l
Enter the limit for a single line in a user log file before the message line
begins to wrap.
Include Timestamps in user log.
l
Internal Support
Options
Select to include time trace to each message in the log.
These options are for use with a customer support representative only. Do
no modify them unless specifically instructed to do so by customer support.
General > Advanced Settings (TruClient)
This dialog box enables you to configure advanced settings for TruClient Ajax - Mobile.
To access
VuGen > Replay > Run-Time Settings > General > Advanced
Settings
User interface elements are described below:
UI Element
Description
Enable Plugin
Support
If selected, enables plug in support, such as Flash.
Load > Browser Settings Node (Ajax TruClient)
This node enables you to configure settings for the Ajax TruClient browser for scripts that you run in
load mode.
HP LoadRunner (12.00)
Page 338 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Replay > Run-Time Settings > Load > Browser Settings
Important
information
l
Settings that you modify in the Load Mode Browser Settings node affect load
mode only.
l
The settings available in the Load Mode Browser Settings node are the same
settings that are available in the"TruClient General Settings Dialog Box" on
page 562.
n
Settings that you modify in the Browser Settings tab affect interactive mode
only. When you save your script in interactive mode, any settings that you
modified in the Browser Settings tab are applied to the Load Mode Browser
Settings.
FireFox Browser Settings
User interface elements are described below:
UI Element
Description
Proxy selection
No proxy (direct
connection to the
internet)
For all Vusers, make the connection to the Internet directly without
using a proxy server.
Use system proxy
settings
(Default) Use system configuration for proxy settings.
Manual proxy
configuration
Enables you to set and configure proxy server settings.
Do not use a proxy for
(exceptions)
You can specify exceptions to the proxy server rules. You can list
the exceptions as hostnames, IPs and/or masks.
Note: You can use wildcards as part of the hostname, e.g.
*.devlab.ad.
Host for HTTP/all
protocols
The domain name or IP address of the proxy server used forHTTP
and other protocol requests.
Port for HTTP/all
protocols
The port number of the proxy server used for HTTP and other
protocol requests.
Use separate proxy for
HTTPS protocol
Enables you to use a separate proxy server to handle all HTTPS
protocol requests.
Host for HTTPS
protocol
The domain name or IP address of the proxy server used for HTTPS
protocol requests.
HP LoadRunner (12.00)
Page 339 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Port for HTTPS
protocol
The port number of the proxy server used for HTTPS protocol
requests.
AUTOMATIC proxy
configuration (PAC)
Automatically read the proxy settings from the proxy auto
configuration file (PAC). In the URL field, enter the URL of the PAC
file.
Advanced
Home Page URL
Enter the URL to navigate to when window home is called from
JavaScript. (about:blank by default)
User-Agent
Enter the User-Agent string for overriding the browser default in
request headers.
Compare the page in
cache to the page on
the network
Enter the corresponding number used to compare the URL page in
the cache to the URL page called from the network.
Keep-Alive
Proxy Keep-Alive
l
0. (Default) Once per session.
l
1. Every time the page is accessed.
l
2. Never.
l
3. When the page is out of date (default).
Allows persistent (non-proxied) network connections.
l
Checked. (Default) Allow persistent (non-proxied) network
connections, so that the open connections can be reused.
l
Cleared. Close each connection after the request is complete.
Allows persistent proxy connections.
l
Checked. (Defeat) Allow persistent proxy connections, so that
open connections can be reused.
l
Cleared. Close each connection after the request is complete.
Keep-Alive timeout
(sec)
Enter the number of seconds to keep idle connections open. (300 by
default)
HTTP version
Enter the HTTP version to use when accessing the
network/application not via a proxy. (1.1 by default)
Proxy HTTP version
Enter the Proxy HTTP version to use when accessing the
network/application via a proxy. (1.1 by default)
HP LoadRunner (12.00)
Page 340 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
DNS cache entries
Enter the maximum number of entries to keep in the DNS cache.
Enter 0 to disable this option. (20 by default)
SSL
Select the secure connection settings:
l
SSL 2.0
l
(Default) SSL 3.0
l
(Default) TLS 1.0
IE Browser Settings
User interface elements are described below:
UI Element
Description
Proxy selection
No proxy (direct
connection to the
internet)
For all Vusers, make the connection to the Internet directly without
using a proxy server.
Use system proxy
settings
(Default) Use system configuration for proxy settings.
Use automatic
configuration script
(PAC)
Automatically read the proxy settings from the proxy auto
configuration file (PAC). In the Address field, enter the URL of the
PAC file.
Use Manual proxy
server for your LAN
Address: Port. Use format 'Address:port'
Do not use proxy server for addresses beginning with. Use
semicolons (;) to separate entries.
Bypass proxy server for local addresses. Do not use proxy for
addresses in your LAN.
Do not use the same proxy server for all protocols. Enter a
proxy for at least one of the protocols.
Advanced
Keep-Alive timeout
(milliseconds)
Timeout (in milliseconds) for keeping idle connections open(applies
to both direct and proxied connections)
Server info timeout
(milliseconds)
Timeout (in milliseconds) for data to be returned from the server. This
setting should be changed if the Keep-Alive timeout is more than 2
minutes (120,000 seconds).
HP LoadRunner (12.00)
Page 341 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
DNS cache timeout
Timeout (in milliseconds) that DNS entries are cached.
Start Page
The URL to navigate to when window home is called from
JavaScript. (about:blank by default)
User-Agent
The User-Agent string for overriding the browser default in request
headers. Leave blank to use the default user agent of IE.
HTTP 1.1 settings
The port number of the proxy server used for HTTP and other
protocol requests.
SSL
l
Use HTTP 1.1
l
Use HTTP 1.1 through proxy connections
Select the secure connection setting(s):
Temporary Internet
Files
l
Use SSL 2.0. Enable SSL 2.0 for secure connections.
l
Use SSL 3.0. Enable SSL 3.0 for secure connections.
l
Use TLS 1.0. Enable TLS 1.0 for secure connections.
l
Use TLS 1.1. Enable TLS 1.1 for secure connections.
l
Use TLS 1.2. Enable TLS 1.2 for secure connections.
Configure when IE will compare the local copy of the resource
(cache) to the network.
Check for newer version of stored pages:
l
Every time I visit the webpage. The resource is checked on
every request.
l
Every time I start Internet Explorer. The resource is checked
on browser start.
l
Automatically.
l
Never.
Load > Other Settings (TruClient)
This dialog box enables you to configure snapshot generation and action on error for TruClient.
To access
VuGen > Replay > Run-Time Settings > Load > Other Settings
HP LoadRunner (12.00)
Page 342 of 1743
LoadRunner User Guide
Script Workflow
User interface elements are described below:
UI Element
Description
Snapshot Generation
Replay snapshots
generation
Never. If selected, snapshots are never generated on replay.
On Error. If selected, snapshots are generated on steps with errors
during replay.
Always. If selected, snapshots are generated on all steps in the script
during replay.
Action on error
Abort script. Select to abort running script when an error occurs.
Continue to the next iteration. Select to stop current iteration and
continue to the next one.
General > Replay Node
All Protocols - Except Mobile Ajax TruClient
To access
UI
Element
VuGen > Replay > Run-Time Settings > General > Replay
Description
Simulate a Instructs VuGen to reset all HTTP contexts between iterations. This setting allows
new user
the Vuser to more accurately emulate a new user beginning a browsing session.
Default value:enabled.
on each
iteration
HP LoadRunner (12.00)
Page 343 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Proxy
selection
Description
The settings in this section apply to both recording and running the script. They
apply to this script only. To configure proxy settings for all Ajax TruClient scripts,
open the Browser Configuration Settings dialog box. For more information, see
"TruClient General Settings Dialog Box" on page 562.
Retrieve global proxy settings (defined in Ajax TruClient
Browser Options).
Select to use the proxy settings defined in the Browser Options dialog box. The
settings are retrieved when you click Develop Script. Once global proxy settings
are retrieved, they are copied to the script's run-time settings and can be managed
in the "Define proxy settings for script" section.
Define specific proxy settings for the script.
l
No proxy (direct connection to the internet). For all Vusers, make the connection
to the Internet directly without using a proxy server.
l
Manual proxy configuration. If selected, you can specify exceptions to the proxy
server rules, specify the proxy server for all HTTP/HTTPS connections. you
require a separate proxy server for HTTP connections, check Use separate
proxy for HTTPS protocol box and specify the proxy server settings.
l
AUTOMATIC proxy configuration (PAC). If selected, the proxy settings is
automatically read from the proxy auto configuration file (PAC). In the URL field,
enter the URL of the PAC file.
Note: If you are using a PAC file for proxy configuration, it is required that
the PAC script directs 127.0.0.1 to a direct connection and not through a
proxy.
HP LoadRunner (12.00)
Page 344 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Snapshots
generation
Description
Recording snapshots generation
l
Never. If selected, recording snapshots of the script are not automatically
saved.
l
Always. If selected, recording snapshots are automatically saved for every step
in the script.
Replay snapshots generation
Action on
error
l
Never. If selected replay snapshots are not generated.
Note: This is the default setting.
l
On error. Select to generate a snapshot when errors occurs. This option can be
used to help identify bugs in your script. For more information, see Debug
Scripts Using Snapshots.
l
Always. If selected snapshots are generated for every step in the script.
Abort script
Select to abort running script when an error occurs.
Continue to the next iteration
Select to stop iteration when an error occurs and continue to the next one.
Replay
Options
Maximum time for object-not-found (seconds)
Enter the maximum time to search for an object before the application displays an
error message.
Inter-step interval (milliseconds)
Enter the minimal interval between steps. Specifying a higher value can help with
synchronization issues, but too high a value may slow the script more than
necessary.
End-of-network identification timeout (milliseconds)
The end-of-network for a step is recognized when the specified time has elapsed
with no networking activity.
HP LoadRunner (12.00)
Page 345 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Advanced
Description
A number of options for advanced users. For more details, read the tips displayed
at the bottom of the Run-Time settings dialog box:
l
Home Page URL. Enter the URL to navigate to when window home is called
from JavaScript.
l
User-Agent. Enter the User-Agent string for overriding the browser default in
request headers.
l
Compare the page in cache to the page on the network. Enter the
corresponding number used to compare the URL page in the cache to the URL
page called from the network. 0=Once per session, 1=Every time the page is
accessed, 2=Never, 3=When the page is out of date (default).
l
Keep-Alive. Select to allow persistent (non-proxied) network connections.
Enter the following corresponding number: 1=Allow persistent (non-proxied)
network connections, so that the open connections can be reused, 0=Close
each connection after the request is complete.
l
Proxy Keep-Alive. Select to allow persistent proxy connections. Enter the
following corresponding number: 1=Allow persistent proxy connections, so that
open connections can be reused. 0=Close each connection after the request is
complete.
l
Keep-Alive timeout (sec). Enter the number of seconds to keep idle
connections open.
l
HTTP version. Enter the HTTP version to use when accessing the
network/application not via a proxy.
l
Proxy HTTP version. Enter the Proxy HTTP version to use when accessing
the network/application via a proxy.
l
DNS cache entries. Enter the max number of entries to keep in the DNS
cache.
Note: Enter 0 to disable this option.
l
Non-interactive window size. Enter the initial dimensions (width and height in
pixels) of the browser window in non-interactive mode.
l
SSL.Select the secure connection setting/s:
n SSL 2.0 n
SSL 3.0
n
TLS 1.0
HP LoadRunner (12.00)
Page 346 of 1743
LoadRunner User Guide
Script Workflow
Mobile Ajax TruClient
UI Element
Description
Simulate a new user
on each iteration
Instructs VuGen to reset all HTTP contexts between iterations. This
setting allows the Vuser to more accurately emulate a new user
beginning a browsing session.
Default value:enabled.
Replay Options
Replay using
recorded duration
for steps
During replay, each step's minimum time of running will be as recorded.
Failed event causes
step failure
If the End Event of a step fails, the step will fail. For example, if the
End Event of a step is Document Loaded and the document fails to
load, the step will fail.
Note: After editing the script, this might cause false timing of steps
in the script.
This option is enabled by default.
Enable profiling
Enable/disable profiling for client side breakdown.
Maximum time for object-not-found (seconds)
Enter the maximum time to search for an object before the application
displays an error message.
Step timeout
The amount of time to perform a step. If the End Event does not occur b
this time the step fails.
Inter-step interval (milliseconds)
Enter the minimal interval between steps. Specifying a higher value can
help with synchronization issues, but too high a value may slow the
script more than necessary.
End-of-network identification timeout (milliseconds)
The end-of-network for a step is recognized when the specified time has
elapsed with no networking activity.
Typing interval (milliseconds)
The average amount of time between keystrokes when entering text
during replay.
HP LoadRunner (12.00)
Page 347 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Minimum Time
Random step's minimum time within range.
During replay, each step's minimum time settings will be overridden by
a randomized value.
From (percentage). Set lower percentage.
To (percentage). Set upper percentage.
Limit step's minimum time. Set the step's minimum time value in
seconds.
Apply minimum time setting on wait steps. Enable/disable applying
minimum time setting on wait steps.
Automatic
transactions
No automatic transactions. Do not apply automatic transactions.
Define each action as a transaction.. Treat each action in the script
as a transaction for performance measurements.
Define each action as step as a transaction. Treat each action and
step in as a transaction for performance measurements.
General > Miscellaneous Node
Enables you to set miscellaneous run-time settings.
To access
VuGen > Replay > Run-Time Settings > General > Miscellaneous
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 320.
l
We do not recommend enabling both the Continue on Error and Generate
Snapshot on Error options in a load test environment. This configuration may
adversely affect the Vusers' performance.
l
If you require the Vusers to generate breakdown data for diagnostics (J2EE)
during the scenario run, do not use automatic transactions. Instead, manually
define the beginning and end of each transaction.
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 348 of 1743
LoadRunner User Guide
Script Workflow
Automatic
Transactions
Error
Handling
l
Define each action as a transaction. Instructs LoadRunner (not
applicable to HP Business Service Management) to handle every action in
the script as a transaction.
l
Define each step as a transaction. Instructs LoadRunner (not applicable
to HP Business Service Management) to handle every step in the script as
a transaction.
l
Continue on Error. Continue script execution when an error occurs.
l
Multithreading
Default value: disabled.
Fail open transactions on lr_error_message. Instructs VuGen to mark
all transactions in which an lr_error_message function was issued, as
Failed. The lr_error_message function is issued through a manually
defined If statement.
l
Generate Snapshot on Error. Generates a snapshot when an error
occurs. You can see the snapshot by viewing the Vuser Log and doubleclicking on the line at which the error occurred.
l
Run Vuser as a process. Disables multithreading.
l
Run Vuser as a thread. Enables multithreading.
For details, see "Multithreading" on page 320.
General > Pacing Node
Allows you to control the time between iterations. The pace tells the Vuser how long to wait
between iterations of your actions.
To access
VuGen > Replay > Run-Time Settings > General > Pacing
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
After the
previous
iteration ends
Starts each new iteration a specified amount of time after the end of the
previous iteration. Specify either an exact number of seconds or a range of
time.
As soon as the
previous
iteration ends
The new iteration begins as soon as possible after the previous iteration
ends.
At
You specify the time between iteration—either a fixed number of seconds or a
<fixed/random> range of seconds from the beginning of the previous iteration. Each
intervals
scheduled iteration will only begin when the previous iteration is complete.
HP LoadRunner (12.00)
Page 349 of 1743
LoadRunner User Guide
Script Workflow
General > Run Logic Node
Enables you to set the run logic run-time settings.
To access
VuGen > Replay > Run-Time Settings > General > Run Logic
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
See also
"Vuser Script Sections" on page 255
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Inserts a new Action at the insertion point.
Inserts a new Action block at the insertion point.
Deletes an item.
Moves an item up.
Moves an item down.
Opens the Properties Dialog Box enabling you to set the run logic and
iterations settings.
Run Logic. Configures the action to run sequentially or randomly.
Iterations. Sets the number of times an item will run.
<Run logic tree>
A graphical illustration of the run logic for this script.
Number of
Iterations
The number of times the script will run of the items in the run logic tree.
General > Think Time Node
Enables you to configure the think time settings, controlling the time that a VuGen waits between
actions. These settings are designed to help you emulate a real user.
To
VuGen > Replay > Run-Time Settings > General > Think Time
access
See
also
l
VuGen uses lr_think_time functions to record think time values into your Vuser
scripts. For more information about the lr_think_time function and how to modify it
manually, see the Function Reference (Help > Function Reference).
User interface elements are described below:
HP LoadRunner (12.00)
Page 350 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Description
As
recorded
During replay, use the argument that appears in the lr_think_time function. For
example, lr_think_time(10) waits ten seconds.
Ignore
think time
Ignore the recorded think time—replay the script ignoring all lr_think_time
functions.
Limit think
time to
Limit the think time's maximum value.
Multiply
recorded
think time
by
During replay, use a multiple of the recorded think time. This can increase or
decrease the think time applied during playback. For example, if a think time of four
seconds was recorded, you can instruct your Vuser to multiply that value by two,
for a total of eight seconds. To reduce the think time to two seconds, multiply the
recorded time by 0.5.
Replay the
think time
Enables options which let you customize the recorded think times.
Use
random
percentage
of
recorded
think time
Use a random percentage of the recorded think time. You set a range for the think
time value by specifying a range for the think time. For example, if the think time
argument is 4, and you specify a minimum of 50% and a maximum of 150%, the
lowest think time can be two (50%) and the highest value six (150%).
Internet Protocol > ContentCheck Node
Enables you to check websites for content during run-time.
To access
VuGen > Replay > Run-Time Settings > Internet Protocol > ContentCheck
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Deletes the selected rule or application.
Exports rules to an xml file.
Imports rules from an existing xml file.
Adds a new application to the list of applications and rules. Click to change
the name.
HP LoadRunner (12.00)
Page 351 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Displays the rule criteria in the right pane, allowing you to enter a new rule
for the currently selected application.
l
Search for text. The text of the string for which you want to search.
l
Search by prefix and suffix. The prefix and suffix of the string for
which you want to search.
l
Match case. Perform a case sensitive search.
l
Fail if. Configure the results of the search to fail if the string is either
found or not found.
l
Search JavaScript alert box text. Only search for text within
JavaScript alert boxes (Web and Oracle Web Applications 11i Vusers
only).
Set the ContentCheck configuration as default (i.e. new scripts will start
with this configuration).
<Application and
Rule list>
A list of applications and rules. You can enable and disable individual items
by using the check boxes to the left of each item.
Enable
ContentCheck
during replay
Enable content checking during replay. Note that even after you define
applications, you can disable it for a specific test run, by disabling this
option.
Default value: enabled.
Internet Protocol > Download Filters Node
Enables you to set the download filters.
To access
VuGen > Replay > Run-Time Settings > Internet Protocol > Download
Filters
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
<Filter list> A list of filters for the script. Each filter has a type and data. For example, a filter of
type URL would have a URL address as its data. You can Add, Edit, Remove, or
Remove All entries in the list.
HP LoadRunner (12.00)
Page 352 of 1743
LoadRunner User Guide
Script Workflow
Exclude
addresses
in list
Ignore requests from the listed sites or hosts.
Include
only
addresses
in list
Restrict replay to the listed sites or hosts.
Internet Protocol > Preferences Node
Enables you to set various internet related run-time settings.
To access
VuGen > Replay > Run-Time Settings > Internet Protocol > Preferences
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Checks
l
Enable Image and Text Check. Allows the Vuser to perform verification
checks during replay by executing the verification functions web_find or
web_image_check. This option only applies to statements recorded in
HTML-based mode. Vusers running with verification checks use more
memory than Vusers who do not perform checks.
Default value: disabled.
Generate
Web
Performance
Graphs
Instructs a Vuser to collect data used to create Web Performance graphs. You
view the Hits per Second, Pages per Second, and Response Bytes per
Second (Throughput) graphs during test execution using the online monitors and
after test execution using the Analysis. You view the Component Breakdown
graph after test execution using the Analysis. Select the types of graph data for
the Vuser to collect.
Note: If you do not use the Web performance graphs, disable these options
to save memory.
HP LoadRunner (12.00)
Page 353 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Advanced
l
WinInet Replay. Instructs VuGen to use the WinInet replay engine instead of
the standard Sockets replay. VuGen has two HTTP replay engines: Socketsbased (default) or WinInet based. The WinInet is the engine used by Internet
Explorer and it supports all of the features incorporated into the IE browser.
The limitations of the WinInet replay engine are that it is not scalable and
does not support Linux. In addition, when working with threads, the WinInet
engine does not accurately emulate the modem speed and number of
connections. VuGen's proprietary sockets-based replay is a lighter engine
that is scalable for load testing. It is also accurate when working with threads.
The limitation of the sockets-based engine is that it does not support SOCKS
proxy. If you are recording in that type of environment, use the WinInet replay
engine.
Default value: disabled (socket-based replay engine).
File and line in automatic transaction names. Creates unique transaction
names for automatic transactions by adding file name and line number to the
transaction name.
l
Default value: enabled.
l
Non-critical item errors as warnings. This option returns a warning status
for a function which failed on an item that is not critical for load testing, such
as an image or Java applet that failed to download. This option is enabled by
default. If you want a certain warning to be considered an error and fail your
test, you can disable this option. You can set a content-type to be critical by
adding it to the list of Non-Resources. For more information, see "NonResources Dialog Box" on page 212.
l
Save snapshot resources locally. Instructs VuGen to save the snapshot
resources to files on the local machine.
. Opens the "Advanced Options Dialog Box" below.
l
Advanced Options Dialog Box
Enables you to set the advanced internet preference run-time settings.
To access
VuGen > Replay > Run-Time Settings > Internet Protocol > Preferences >
Options
Important
information
l
This dialog box is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 320.
l
This dialog box divides the properties into different categories: HTTP,
General, Authentication, Log, and Web (Click & Script) Specific.
HP LoadRunner (12.00)
Page 354 of 1743
LoadRunner User Guide
Script Workflow
HTTP
User interface elements are described below:
UI Element
Description
HTTP
version
Specifies which version HTTP to use: version 1.0 or 1.1. This information is
included in the HTTP request header whenever a Vuser sends a request to a
Web server.
Default value: HTTP 1.1.
HTTP 1.1 supports the following features:
l
Persistent Connections—see "Keep-Alive HTTP connections" below.
l
HTML compression—see Accept Server-Side Compression below.
l
Virtual Hosting—multiple domain names sharing the same IP address.
Keep-Alive
HTTP
connections
Keep-alive is a term used for an HTTP extension that allows persistent or
continuous connections. These long-lived HTTP sessions allow multiple
requests to be sent over the same TCP connection. This improves the
performance of the Web server and clients.
The keep-alive option works only with Web servers that support keep-alive
connections. This setting specifies that all Vusers that run the Vuser script have
keep-alive HTTP connections enabled.
Default value: enabled.
AcceptLanguage
request
header
Provides a comma-separated list of accepted languages. For example, en-us,
fr, and so forth. For more details, see "Page Request Header Language" on
page 1000.
HTTP errors
as warnings
Issues a warning instead of an error upon failing to download resources due to
an HTTP error.
HTTPrequest
connect
timeout
(seconds)
The time, in seconds, that a Vuser will wait for the connection of a specific
HTTP request within a step before aborting. Timeouts provide an opportunity for
the server to stabilize and respond to the user. Note that this timeout also
applies to the time the Vuser will wait for a WAP connection, initiated by the
wap_connect function.
Maximum value: 32000 seconds.
HTTPrequest
receive
timeout
(seconds)
The time, in seconds, that a Vuser will wait to receive the response of a specific
HTTP request within a step before aborting. Timeouts provide an opportunity for
the server to stabilize and respond to the user.
Maximum value: 32000 seconds.
HP LoadRunner (12.00)
Page 355 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Request Zlib
Headers
Sends request data to the server with the zlib compression library headers. By
default, requests sent to the server include the zlib headers. This option lets
you emulate non-browser applications that do not include zlib headers in their
requests. To exclude these headers, set this option to No.
Default value: Yes.
Accept
Indicate to the server that the replay can accept compressed data. The
Server-Side
available options are: None (no compression), gzip (accept gzip compression),
Compression gzip, deflate (accept gzip or deflate compression), and deflate (accept deflate
compression). Note that by accepting compressed data, you may significantly
increase the CPU consumption.
Default value: Accept gzip and deflate compression.
To manually add compression, enter the following function at the beginning of
the script:
web_add_auto_header("Accept-Encoding", "gzip");
To verify that the server sent compressed data, search for the string Content Encoding: gzip in the section of the server's responses of the replay log. The log
also shows the data size before and after decompression.
Delete
unreferenced
cache entries
Delete cache entries that have not been referenced within the specified number
of iterations. Set to zero (0) to never delete cache entries.
General
User interface elements are described below:
UI Element
Description
DNS caching
Instructs the Vuser to save a host's IP addresses to a cache after resolving its
value from the Domain Name Server. This saves time in subsequent calls to
the same server. In situations where the IP address changes, as with certain
load balancing techniques, be sure to disable this option to prevent Vuser from
using the value in the cache.
Default value: enabled.
Convert
from/to UTF-8
Converts received HTML pages and submitted data from and to UTF-8. You
enable UTF-8 support in the recording options. For more information, see
"Recording Options" on page 176.
Default value: no.
Step timeout
caused by
resources is a
warning
Issues a warning instead of an error when a timeout occurs due to a resource
that did not load within the timeout interval. For non-resources, VuGen issues
an error.
Default value: disabled.
HP LoadRunner (12.00)
Page 356 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Parse HTML
Content-Type
When expecting HTML, parse the response only when it is the specified
content-type: HTML, text\html, TEXT any text, or ANY, any content-type.
Note that text/xml is not parsed as HTML.
Default value: TEXT.
The timeout settings are primarily for advanced users who have determined
that acceptable timeout values should be different for their environment. The
default settings should be sufficient in most cases. If the server does not
respond in a reasonable amount of time, check for other connection-related
issues, rather than setting a very long timeout which could cause the scripts to
wait unnecessarily.
Step
download
timeout (sec)
The time that the Vuser will wait before aborting a step in the script. This option
can be used to emulate a user behavior of not waiting for more than x seconds
for a page.
Maximum value: 32000 seconds.
Network
buffer size
Sets the maximum size of the buffer used to receive the HTTP response. If the
size of the data is larger than the specified size, the server will send the data in
chunks, increasing the overhead of the system. When running multiple Vusers
from the Controller, every Vuser uses its own network buffer. This setting is
primarily for advanced users who have determined that the network buffer size
may affect their script's performance. The default is 12K bytes. The maximum
size is 0x7FFF FFFF.
Print NTLM
information
Print information about the NTLM handshake to the standard log.
Print SSL
information
Print information about the SSL handshake to the standard log.
Max number
of error
matches
issued as
ERRORS
Limits the number of error matches issued as ERRORS for content checks
using a LB or RB (left boundary or right boundary). This applies to matches
where a failure occurs when the string is found (Fail=Found). All subsequent
matches are listed as informational messages.
Default value: 10 matches.
Maximum
number of
META
Refresh to the
same page
The maximum number of times that a META refresh can be performed per
page.
Default value: 2.
ContentCheck Store the values in the ContentCheck XML file in UTF-8.
values in
UTF-8
HP LoadRunner (12.00)
Page 357 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Tree-View
request body
limit
Limit the number of request body bytes displayed in Tree-View. Set to zero (0)
for no limit.
IP Version
The IP version to be used: IPv4, IPv6 or automatic selection. The default value
is IPv4.
web-sync
retry interval
(millisec)
The time to wait (in milliseconds) between testing the condition that yields false
and the next retry. The default value is 1000.
web-sync
retry timeout
(millisec)
The maximum time (in milliseconds) during which retries are allowed. If the
computed timeout exceeds the step timeout (as determined by the 'Step
download timeout' setting), the latter is used.
Authentication
User interface elements are described below:
UI Element
Description
Fixed think
time upon
authentication
retry (msec)
Automatically adds a think time to the Vuser script for emulating a user
entering authentication information (username and password). This think time
will be included in the transaction time.
Default value: 0.
Disable NTLM2
session
security
Use full NTLM 2 handshake security instead of the more basic NTLM 2
session security response.
Default value: No.
Use Windows
Use the Microsoft Security API for NTLM authentication instead of the
native NTLM
indigenous one.
implementation Default value: No.
Override
Use the credentials provided by the user at logon.
credentials in
Windows
native NTML
implementation
Enable
integrated
Authentication
HP LoadRunner (12.00)
Enable Kerberos-based authentication. When the server proposes
authentication schemes, use Negotiate in preference to other schemes.
Default value: No.
Page 358 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Induce heavy
KDC load
Do not reuse credentials obtained in previous iterations. Enabling this setting
will increase the load on the KDC (Key Distribution Server). To lower the load
on the server, set this option to Yes in order to reuse the credentials obtained
in previous iterations. This option is only relevant when Kerberos
authentication is used.
Default value: No.
Use canonical
name in SPN
Use the canonical name instead of the original hostname retrieved from the
URL, to generate SPN (Service Principal Name).
Default value: Yes.
Append nondefault port to
SPN
Append the port number to the SPN, if the specified port is a non-standard
one(neither 80 nor 443).
Default value: No.
Enable
retrieving key
from nCipher
HSM
Enables LoadRunner to retrieve private keys from the HSM (Hardware
Security Module), such as nCipher.
Default value: Yes.
Log
User interface elements are described below:
UI Element
Description
Print buffer line length
Line length for printing request/response header/body and/or
JavaScript source, disabling wrapping.
Print buffer escape only
binary zeros
l
Yes. Escape only binary zeros when printing request/response
headers/body and/or JavaScript source.
l
No. Escape any unprintable/control characters.
Web (Click & Script) Specific (Replay only for version 12 and later)
User interface elements are described below:
HP LoadRunner (12.00)
Page 359 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
General
l
Home Page URL. The URL of the home page that opens with your browser
(default is about:blank).
l
DOM-based snapshots. Instructs VuGen to generate snapshots from the
DOM instead of from the server responses.
Default value: Yes.
l
Charset conversions by HTTP. Perform charset conversions by the
`Content-Type:....; charset=...' HTTP response header. Overrides `Convert
from /to UTF-8.'
l
Reparse when META changes charset. Reparse HTML when a META tag
changes the charset. Effective only when Charset conversions by HTTP is
enabled. Auto means reparsing is enabled only if it used in the first iteration.
l
Fail on JavaScript error. Fails the Vuser when a JavaScript evaluation error
occurs.
Default value: No (issue a warning message only after a JavaScript error,
but continue to run the script).
l
Initialize standard classes for each new window project. When enabled,
the script—the src compiled script, will not be cached.
l
Ignore acted on element being disabled. Ignore the element acted on by a
Vuser script function being disabled.
HP LoadRunner (12.00)
Page 360 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Timers
l
Optimize timers at end of step. When possible, executes a
setTimeout/setInterval/<META refresh> that expires at the end of the step
before the expiration time
Default value: Yes.
l
Single setTimeout/setInterval threshold (seconds). Specifies an upper
timeout for the window.setTimeout and window.setInterval methods. If the
delay exceeds this timeout, these methods will not invoke the functions that
are passed to them. This emulates a user waiting a specified time before
clicking on the next element.
Default value: 5 seconds.
l
Accumulative setTimeout/setInterval threshold (seconds). Specifies a
timeout for the window.setTimeout and window.setInterval methods. If the
delay exceeds this timeout, additional calls to window.setTimeout and
window.setInterval will be ignored. The timeout is accumulative per step.
Default value: 30 seconds.
History
l
Reestablish setInterval at end of step.0 = No; 1 = Once; 2 = Yes.
l
Limit no-network timers at end of step: Limit the number of
setTimeout/setInterval specified script evaluations at the end of a step when
no network requests are issued. Set to zero (0) for no limit. The default value
is 100. This limit is only used when 'Optimize timers at end of step' is
enabled.
l
History support. Enables support for the window.history object for the test
run. The options are Enabled, Disabled, and Auto. The Auto option
instructs Vusers to support the window.history object only if it was used in
the first iteration. Note that by disabling this option, you improve performance.
Default value: auto.
l
Maximum history size. The maximum number of steps to keep in the
history list.
Default value: 100 steps.
HP LoadRunner (12.00)
Page 361 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Navigator
Properties
l
navigator.browserLanguage. The browser language set in the navigator
DOM object's browserLanguage property.
Default value: The recorded value. Scripts created with older recording
engines use en-us by default.
l
navigator.systemLanguage. The system language set in the navigator
DOM object's systemLanguage property.
Default value: The recorded value. Scripts created with older recording
engines use en-us by default.
l
navigator.userLanguage. The user language set in the navigator DOM
object's userLanguage property.
Default value: The recorded value. Scripts created with older recording
engines use en-us by default.
Screen
Properties
l
screen.width Sets the width property of the screen DOM object in pixels.
Default value: 1024 pixels.
l
screen.height Sets the height property of the screen DOM object in pixels.
Default value: 768 pixels.
l
screen.availWidth Sets the availWidth property of the screen DOM object in
pixels.
Default value: 1024 pixels.
l
screen.availHeight. Sets the availHeight property of the screen DOM object
in pixels.
Default value: 768 pixels.
HP LoadRunner (12.00)
Page 362 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Memory
Management
l
Default block size for DOM memory allocations. Sets the default block
size for DOM memory allocations. If the value is too small, it may result in
extra calls to malloc, slowing the execution times. Too large a block size,
may result in an unnecessarily big footprint.
Default value: 16384 bytes.
l
Memory Manager for dynamically-created DOM objects.Yes—Use the
Memory Manager for dynamically-created DOM objects. No—Do not use the
Memory Manager, for example when multiple DOM objects are dynamically
created in the same document as under SAP. Auto—Use the protocol
recommended (default Yes for all protocols except for SAP).
l
JavaScript Runtime memory size (KB). Specifies the size of the
JavaScript runtime memory in kilobytes.
Default value: 256 KB.
l
JavaScript Stack memory size (KB). Specifies the size of the JavaScript
stack memory in kilobytes.
Default value: 32 KB.
Web
Javascript
l
Enable running Javascript code. Yes—Enables running web Javascript
steps, such as web_js_run() and web_js_reset(). No—Web
Javascript steps can not be run. Note that enabling this option causes the
creation of a Javascript Engine Runtime, even if there are no Javascript steps
in the script.
Default value: No
l
Javascript Engine runtime size (KB). Specifies the size of the Javascript
Engine Runtime memory in kilobytes. One Runtime will be created for all
Vusers in a process.
Default value: 10240 KB
l
Javascript Engine stack size per-thread (KB). Specifies the size of each
Vuser thread in the Javascript Engine memory, in kilobytes.
Default value: 32 KB
Internet Protocol > Proxy Node
Enables you to set the proxy server connection settings.
HP LoadRunner (12.00)
Page 363 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Replay > Run-Time Settings > Internet Protocol > Proxy
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI
Element
Description
No
proxy
All Vusers should use direct connections to the Internet. This means that the
connection is made without using a proxy server.
Obtain
the
proxy
settings
from the
default
browser
All Vusers use the proxy settings of the default browser from the machine upon which
they are running.
Note: This option is not available when Firefox has been set as the default browser.
Uninstall Firefox and set another browser as default.
Use
custom
proxy
All Vusers use a custom proxy server. You can supply the actual proxy server details
or the path of a proxy automatic configuration script (. pac file) that enables automatic
configuration.
l
Use automatic configuration script. Allows you to specify a JavaScript file
containing proxy assignment information. This script tells the browser when to
access a proxy server and when to connect directly to the site, depending on the
URL. In addition, it can instruct the browser to use a specific proxy server for
certain addresses and another server for other addresses. Specify the location of
the script in the Address field.
l
Use proxy server. You can specify one proxy server for all HTTP sites, and
another proxy server for all HTTPS (secure) sites or check the use the same
proxy server for all protocols box.
. Allows you to specify exceptions to the proxy server rules.
l
l
. Opens the Proxy Authentication Dialog Box. If the proxy server
requires authentication for each Vuser, use this dialog box to enter the relevant
password and user name. To add authentication dynamically during recording, or
to add authentication for multiple proxy servers, use the web_set_user function.
For more information, see the Function Reference ( Help > Function Reference).
Java Environment Settings > Java Classpath Node
The ClassPath section lets you specify the location of additional classes that were not included in
the system's classpath environment variable. You may need these classes to run Java applications
HP LoadRunner (12.00)
Page 364 of 1743
LoadRunner User Guide
Script Workflow
and insure proper replay.
To access
VuGen > Replay > Run-Time Settings > Java Environment Settings >
Classpath
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Add Classpath. Adds a new line to the classpath list. Use the Browse
button to locate the classpath.
Note: Adding multiple JAR files at once is only supported if you have Internet
Explorer 10 or higher.
Delete. Permanently removes a classpath.
Edit Classpath. Allows you to edit the path for the selected classpath.
Classpath
Entries List
A list of classpath entries.
Java Environment Settings > Java VM Node
Enables you to set the Java VM run-time settings.
To access
VuGen > Replay > Run-Time Settings > Java Environment Settings > Java
VM
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI
Element
Description
HP LoadRunner (12.00)
Page 365 of 1743
LoadRunner User Guide
Script Workflow
Virtual
Machine
Settings
Class
Loading
Settings
l
Use internal logic to locate JDK. Search the PATH, registry, and Windows
folder for the JDK to use during replay.
l
Use specified JDK. Use a specified JDK during replay.
l
JDK. The home folder of the specified JDK.
l
Additional VM Parameters. Any optional parameters used by the virtual
machine.
l
Using Xbootclasspath parameters. Replays the script with the Xbootclasspath
/p option.
Load each Vuser using dedicated class loader. Load each Vuser using a
dedicated class loader. This will allow you to use a unique namespace for each
Vuser and manage their resources separately.
JMS > Advanced Node
Enables you to set the JMS Advanced run-time settings.
To access
VuGen > Replay > Run-Time Settings > JMS > Advanced
Important
This node is available only for the Web Service protocol. For a complete list of
information protocols and their associated nodes, see "Protocol Compatibility Table" on page
320.
Relevant
tasks
"How to Prepare Scripts for Replay" on page 894
User interface elements are described below:
VM (Virtual Machine)
UI
Element
Description
Use
external
VM
Enables you to select a VM (Virtual Machine) other than the standard one. If you
disable this option, Vusers use the JVM provided with VuGen.
JVM
Home
Location of the external JVM. This should point to the JDK home folder, defined by
JDK_HOME. VuGen supports JDK 1.4 and above.
Classpath Vendor implementation of JMS classes together with any other required supporting
classes, as determined by the JMS implementation vendor.
HP LoadRunner (12.00)
Page 366 of 1743
LoadRunner User Guide
Script Workflow
JMS
UI Element
Description
Additional
VM
Parameters
Extra parameters to send to the JVM such as Xbootclasspath, and any
parameters specified by the JVM documentation.
JNDI initial
context
factory
The fully qualified class name of the factory class that will create an initial
context. Select a context factory from the list or provide your own.
JNDI
provider URL
URL string of the service provider. For example:
l
Weblogic - t3://myserver:myport
l
Websphere - iiop://myserver:myport
JMS
connection
factory
JNDI name of the JMS connection factory. You can only specify one
connection factory per script.
JMS security
principal
Identity of the principal (for example the user) for the authentication scheme.
JMS security
credentials
The principal's credentials for the authentication scheme.
Number of
JMS
connections
per process
The number of JMS connections per mdrv process, or Vuser. All Vusers
sharing a connection will receive the same messages. The default is 1, and the
maximum is 50 Vusers. The fewer connections you have per process, the
better your performance.
Received
message
timeout
options
The timeout for received messages:
l
Infinite wait. Wait as long as required for the message before continuing.
l
No wait. Do not wait for the Receive message, and return control to the
script immediately. If there was no message in the queue, the operation
fails.
l
Specify the timeout in seconds. A timeout value for the message. If the
timeout expired and no message has arrived, the operation fails. (default)
l
User defined timeout. The amount of seconds to wait for the message
before timing out. The default is twenty seconds.
Default value: No wait.
Automatically Generates a selector for the response message with the correlation ID of the
generate
request (No by default). Each JMS message sent to the server has a specific
selector
ID. Enable this option if you want VuGen to automatically create a selector that
includes the message ID.
HP LoadRunner (12.00)
Page 367 of 1743
LoadRunner User Guide
Script Workflow
MMS > Server and Protocol Node
Enables you to set the MMS (Multimedia Messaging Service) run-time settings.
To access
VuGen > Replay > Run-Time Settings > MMS > Server and Protocol
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 320.
l
In the General > Miscellaneous node, under Multithreading, select Run
Vuser as a process.
User interface elements are described below:
UI Element
Description
Automatic
WAP
Connections
Defines when to connect and disconnect from a WAP gateway. This setting is
only relevant when a WAP gateway is used. The possible values are:
Per Iteration. Connect at the beginning of each iteration and disconnect at the
end of each iteration.
Per Send or Receive. Connect and disconnect at the beginning and end of
each message.
None. Do not use automatic WAP connections.
Default value: Per Iteration.
Default Sender The default address sent in the Sender header.
Default value: +999999.
address
MMS Version
The version of the MMS protocol used by the script.
MMSC URL
The URL of the MMSC (Multimedia Messaging Center) server.
SMSC IP
The IP address of the SMSC server used for sending MMS notifications over
SMPP.
SMSC Port
The IP port of the SMSC server used for sending MMS notifications over
SMPP.
Timeout
(seconds)
The time that the server waits for incoming messages.
Default value: 60 seconds.
Mobile TruClient Properties > Mobile Device Node
This pane enables you to select a mobile device properties when recording a TruClient Ajax - Mobile
script.
HP LoadRunner (12.00)
Page 368 of 1743
LoadRunner User Guide
Script Workflow
To access
Relevant tasks
l
VuGen > Replay > Run-Time Settings > Mobile TruClient
Properties > Mobile Device Node
l
Select Mobile Device button from the Main VuGen Toolbar
"How to Add, Remove, and Import Mobile Device Settings for Mobile
TruClient" on page 716
"How to Record a Script with Mobile TruClient" on page 715
User interface elements are described below:
UI Element
Description
Mobile Device
Select the mobile device type you want to test.
User Agent
Specify the header string that is sent to server to identify your mobile
device. Once you have a selected a device, the default header value
will appear. However, this header string can be modified.
Display
Specify the height and width of your mobile device screen. Mobile
TruClient will open browser window according to the display settings.
.NET > .NET Environment Node
Enables you to set the run-time settings for .NET Vuser scripts.
To access
VuGen > Replay > Run-Time Settings > .NET > .NET Environment
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 369 of 1743
LoadRunner User Guide
Script Workflow
AUT
Configuration settings for the AUT location and configuration files.
configuration
l AUT Application Base Path. The AUT (Application Under Test) base
folder from which DLLs are loaded during replay. By default, during recording,
all of the necessary DLLs are stored in the script's folder. Use this option to
specify the location of any missing DLL files for the AUT. This is usually the
installation path of the recorded application. Note that the AUT must be
installed on the machine running the script. If you leave this box empty,
VuGen uses the local script\bin folder as the application base folder during
replay.
l
Concurrency
AUT Configuration File. The file name of the recorded application's
configuration file. VuGen copies the AUT configuration file to the script\bin
folder and loads the locally saved file. To specify a different location, enter a
full path. If you only specify a file name, and the file is not in the script\bin
folder, VuGen loads it from the App base folder.
AppDomain Per Vuser. Enables execution of each Vuser in a separate app
domain. Running Vusers in separate App Domains enables each Vuser to
execute separately without sharing static variables and prevents locking
between them.
Default value: true.
.NET > Shared DLLs
This dialog box enables you to view and modify the list of shared DLLs after you record a Vuser
script. If a DLL is included in the list of shared DLLs, when the Vuser script is run and requires a
particular DLL, the Vuser will access the DLL in its shared location – the DLL will not be copied to
the load generator. Adding a DLL to the list of shared DLLs therefore saves hard-drive space on the
load generator when a Vuser is run.
Note: The Use Shared DLLs option is accessible from both the Recording Options and Runtime Settings. If you use modify the list or DLL folder from the Run-time Settings via the
Controller, the changes will be ineffective.
Workaround: Modify the DLL list through VuGen and not through the Controller.
After you record a Vuser script, the list of shared DLLs is copied from the Recording Options to the
Run-Time Settings. For details on how to view and modify the recording options, see ".NET >
Shared DLLs" on page 224.
To access
VuGen > Replay > Run-Time Settings > Microsoft .NET > Shared DLLs
See also
".NET > Shared DLLs" on page 224
User interface elements are described below:
HP LoadRunner (12.00)
Page 370 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Description
Add. Adds a new line to the DLL Entries list. Specify a full path to the DLL.
Note: The location that you specify for a shared DLL, must be accessible to all load
generators on which the Vuser will run.
Edit. Allows you to edit the path to the selected DLL.
Delete. Permanently removes the DLL entry.
DLL
Entries
List
A list of classpath entries.
Network > Speed Simulation Node
Enables you to configure the network speed run-time settings.
To access
VuGen > Replay > Run-Time Settings > Network > Speed Simulation
Important
information
l
This node is available only for specific protocols. For a complete list of
protocols and their associated nodes, see "Protocol Compatibility Table" on
page 320.
l
On Linux machines, this settings is only supported for the Web (HTTP/HTML)
protocol.
User interface elements are described below:
UI Element
Description
Use
bandwidth
Indicate a specific bandwidth level for your Vuser to emulate. You can select a
speed ranging from 14.4 to 512 Kbps, emulating analog modems, ISDN, or DSL.
Use custom
bandwidth
Indicate a bandwidth limit for your Vuser to emulate. Specify the bandwidth in
bits, where 1 Kilobit=1024 bits.
Use
maximum
bandwidth
Vusers run at the maximum bandwidth that is available over the network.
Default value: enabled.
Oracle NCA > Client Emulation Node
Enables you to set the Oracle NCA run-time settings.
To access
VuGen > Replay > Run-Time Settings > Oracle NCA > Client Emulation
HP LoadRunner (12.00)
Page 371 of 1743
LoadRunner User Guide
Script Workflow
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Network
l
Socket Mode. Configure the connection between the client and server at the
socket level.
Timeout. The time that an Oracle NCA Vuser waits for a response from the
server. Default value: -1 (disables the timeout and the client waits
indefinitely).
n
Pragma Mode. Configure the communication on the Oracle-defined Pragma
mode (higher level than socket and HTTP).
l
Connection
Diagnostic
n
Max Retries. The maximum number of IfError messages the client will
accept from the server before issuing an error. IfError messages are the
periodic messages the server sends to the client, indicating that it will
respond with the data as soon as it is able.
n
Retry Interval (ms). The interval (in milliseconds) between retries in the case
of IfError messages.
n
Include retry intervals in transaction. Includes the interval between retry
time, as part of the transaction duration time.
l
Enable Heartbeat. Sends a heartbeat signal is sent to the server. You can
configure the frequency of the heartbeat by setting the frequency property.
Default value: enabled, 120.
l
Forms version. The version of the Oracle Forms server detected during
recording. Modify this setting only if the server was upgraded since the
recording.
l
Command line parameter separator. Marker for the division between
separate parameters in a command line string.
l
Application Version. The version of Oracle Application. This option is
relevant when using Oracle Application—not a custom Oracle NCA
application. It is only required when using Oracle database breakdown.
RDP > Advanced Node
Enables you to set the RDP advanced run-time settings.
To access
VuGen > Replay > Run-Time Settings > RDP > Advanced
HP LoadRunner (12.00)
Page 372 of 1743
LoadRunner User Guide
Script Workflow
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Bitmap
caching
Allows the remote desktop server to use bitmap caching. Enabling this setting
can save system resources on the remote desktop server.
Font
smoothing
Allows the remote desktop server to use font smoothing. Disabling this setting
can save system resources on the remote desktop server.
Menu and
window
animation
Allows the remote desktop server to animate menus and windows. Disabling
this setting can save system resources on the remote desktop server.
Remote
desktop
composition
Enables remote desktop composition.
Show contents Shows the contents of windows while they are being dragged. Disabling this
of window
setting can save system resources on the remote desktop server.
while
dragging
Show remote
desktop
background
image
Allows you to run the remote desktop application without displaying the
desktop background image on the remote desktop. Disabling this setting can
save system resources on the remote desktop server.
Socket receive
buffer size
(bytes)
The number of bytes to allocate for the socket's receive buffer. If the buffer is
too small, it can fill up causing the server to disconnect. If the buffer is too
large, it uses more local system resources (memory).
Themes
Allows the remote desktop server to use Windows themes. Disabling this
setting can save system resources on the remote desktop server.
RDP > Configuration Node
Enables you to set the RDP configuration run-time settings.
To access
VuGen > Replay > Run-Time Settings > RDP > Configuration
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
HP LoadRunner (12.00)
Page 373 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Enable RDP
caching
Support data caching orders in RDP (enabled by default).
RDP Client
Version Emulation
The version of RDP packets to produce during replay: As Recorded, or a
specific version number.
Remote desktop
color depth
The color depth settings for the replay: As Recorded, or a specific depth.
Remote desktop
resolution (pixels)
The size of the window in which the applications are run: As Recorded,
or a specific size (in pixels).
Start the following
program on
connection
Open RDP connection to invoke the specified application. Specify the
following information: Program path and file name and optionally, Start
in folder.
Supported
Protocols
Specify the type of authentication that is used by the Vuser to connect to
the server when the script is replayed:
l
RDP: Connects without employing any authentication.
l
CredSSP: Connects using the Credential Security Support Provider
(CredSSP) protocol to perform strong server authentication.
l
SSL: Enables clients to authenticate to servers and provides a secure
channel by encrypting communications.
RDP > RDP Agent Node
Enables you to set the RDP Agent run-time settings.
To access
VuGen > Replay > Run-Time Settings > RDP > RDP Agent
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI
Element Description
Replay
using
RDP
agent
Instructs VuGen to use the extended information gathered by the RDP agent during
recording. This requires you to have recorded the session with the Use RDP agent
Recording Option enabled. The LoadRunner RDP agent must be installed on the
server. For details, see "How to Install / Uninstall the RDP Agent" on page 755.
Wait time for RDP agent response. The maximum time in milliseconds to wait for
the agent to respond to a request.
HP LoadRunner (12.00)
Page 374 of 1743
LoadRunner User Guide
Script Workflow
UI
Element Description
Enable
RDP
agent
log
Enables the RDP agent log. This feature is should be used only for debugging
purposes.
l
RDP agent log detail level. Configures the level of detail generated in the RDP
agent log with Standard being the lowest level of detail and Extended Debug
being the highest level of detail.
l
RDP agent log destination. Configures the destination of the RDP agent log
data. File saves the log messages only on the remote server side. Stream sends
the log messages to the VuGen machine. FileAndStream sends the log
messages to both destinations.
l
RDP agent log folder. The folder path on the remote server that the RDP agent
log file will be generated in. If none is specified and the agent log destination was
set to File, the log is saved in the temp folder of the user on the server.
RDP > Synchronization Node
Enables you to set the RDP synchronization run-time settings.
To access
VuGen > Replay > Run-Time Settings > RDP > Synchronization
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Default input
origin
The default origin for input operations.
Default offset
addition
Saves the offset of images that moved during synchronization for all
subsequent functions.
Default value: No.
Default
The time in seconds to wait for synchronization operations. Enter a value
synchronization between 0 and 1000.
Default value: 60.
timeout (sec)
HP LoadRunner (12.00)
Page 375 of 1743
LoadRunner User Guide
Script Workflow
Default
tolerance for
image
synchronization
The tolerance level for performing synchronization on images. Select one of
the options: Exact, Low, Medium, or High. High has the most tolerance for
changes and mismatches. Low requires a match of approximately 95
percent, Medium requires a match of approximately 85 percent, High
requires a match of approximately 70 percent, and Exact requires an 100
percent match.
Default value: Medium.
Disable
When selected, it prevents the Synchronization Failure Dialog box from
synchronization opening.
Default value: not selected.
failure dialog
Fail image
Instructs Vusers how to proceed when images are not found during
synchronization synchronization. Yes sets a Fail status and Vusers follow the Continue on
step on timeout Error setting. No returns an LR_NOT_FOUND flag, the step reports a
warning and the script continues.
Default value: Yes.
Recorded
Uses coordinates for all input operations with a non-specified input origin.
Default value: enabled.
Synched
Adds the most recent offsets saved at one of the previous synchronization
functions to the recorded coordinates of each input operation with a nonspecified input origin.
Typing speed
(msec/char)
The time in milliseconds for sending consecutive characters in keyboard
commands. Enter a value between 0 and 1000.
Default value: 150.
RTE > RTE Node
Enables you to set the RTE run-time settings.
To access
VuGen > Replay > Run-Time Settings > RTE > RTE
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Maximum
number of
connection
attempts
The TE_connect function is generated by VuGen when you record a
connection to a host. When you replay an RTE Vuser script, the TE_connect
function connects the terminal emulator to the specified host. If the first
attempt to connect is not successful, the Vuser retries a number of times to
connect successfully.
Default value: 5.
HP LoadRunner (12.00)
Page 376 of 1743
LoadRunner User Guide
Script Workflow
Use original
device name
In certain environments, each session (Vuser) requires a unique device
name. The TE_connect function generates a unique 8-character device name
for each Vuser, and connects using this name. Select this option to connect
using the device name that is contained within the com_string parameter of
the TE_connect function.
Note: The original device name setting applies to IBM block-mode terminals
only.
Delay before
typing
The delay setting determines how Vusers execute TE_type functions.
l
First key. Specify the amount of time (in milliseconds) that a Vuser waits
before entering the first character in a string.
l
Subsequent keys. Specifies the amount of time (milliseconds) that a
Vuser waits before between submitting successive characters.
Note: You can use the TE_typing_style function to override the Delay
settings for a portion of a Vuser script.
X-System
synchronization
l
Timeout. The timeout (in seconds) to wait for the system to stabilize
when replaying a TE_wait_sync function before an error is returned.
l
Stable time. The time (in milliseconds) that the Vuser waits to ensure
that the terminal is no longer in the X-SYSTEM mode after executing a
TE_wait_sync function.
SAPGUI > General Node
Enables you to set the SAP GUI run-time settings.
To access
VuGen > Replay > Run-Time Settings > SAPGUI > General
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Send status bar
text
Send the text from the status bar to the log file.
Send active
window title
Send the active window title text to the log file.
HP LoadRunner (12.00)
Page 377 of 1743
LoadRunner User Guide
Script Workflow
Show SAP
Client during
replay
Shows an animation of the actions in the SAP client during replay. The
benefit of displaying the user interface (UI) is that you can see how the
forms are filled out and closely follow the actions of the Vuser. This option,
however, requires additional resources and may affect the performance of
your load test.
Take ActiveScreen snapshots during replay. Captures replay
snapshots with the Control ID information for all active objects.
ActiveScreen snapshots differ from regular ones, in that they allow you
to see which objects were recognized by VuGen in the SAP GUI client.
As you move your mouse across the snapshot, VuGen highlights the
detected objects. You can then add new steps to the script directly from
within the snapshot. It also allows you to add steps interactively from
within the snapshot for a specific object. For more information, see "How
to Enhance SAP GUI Scripts" on page 790.
l
Opens the SAP GUI Advanced Options Dialog Box, enabling you to set the
following settings:
l
Replay using running SAPlogon application. Instructs the Vusers to
use the SAPlogon application that is currently running for replay.
l
Set SAPfewgsvr application timeout. Allows you to modify the
SAPfewgsvr.exe process timeout.
n
Timeout to SAPfewgsvr. The SAPfewgsvr.exe process timeout in
seconds. Default value: 300 seconds.
Silverlight > Services Node
Displays the WSDL files associated with your script and allows you to modify their settings for the
replay phase.
To access
VuGen > Replay > Run-Time Settings > Silverlight > Services
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI
Element
Description
<Service A list of the WSDL files that are available for this script.
List>
Protocol
=;
Security
Data
Opens the Protocol and Security Scenario Data dialog box, allowing you to configure
a number of settings for each selected WSDL. For more information, see "Protocol
and Security Scenario Data Dialog Box" on page 242.
HP LoadRunner (12.00)
Page 378 of 1743
LoadRunner User Guide
Script Workflow
WAP > Gateway Node
Enables you to set the WAP gateway run-time settings.
To access
VuGen > Replay > Run-Time Settings > WAP > Gateway
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI
Element
Description
HTTP
Direct
Run the Vusers run in HTTP mode, accessing a Web server directly.
WAP
Run the Vusers accessing a Web server via a WAP Gateway.
Gateway
Property l IP. The IP of the gateway.
l
Port. The port of the gateway. When running your Vusers through a WAP
gateway, VuGen automatically sets default port numbers, depending on the
selected mode. However, you can customize the settings and specify a custom
IP address and port for the gateway.
l
WAP 1.x (WSP). Selects the appropriate WAP version. If you recorded in WAP
1.x (WSP), you can run the Vuser in either 1.x (WSP), or 2.0 (HTTP proxy) mode.
If you select this option, you can set the WAP 1.x (WSP) Properties. For more
information, see "WAP 1.x (WSP) Properties" below.
l
WAP 2.0 (HTTP). Selects the appropriate WAP version. If you recorded in WAP
2.0 (HTTP proxy), then you can only run the Vuser in the same mode.
WAP 1.x (WSP) Properties
UI Element
Description
Advanced
Expand to set the Advanced Properties. For more information see "Advanced
Properties" on the next page.
Connection
Options
l
Connection-oriented Mode sets the connection mode for the WSP
session to Connection-Oriented.
l
Connectionless Mode sets the connection mode for the WSP session to
Connectionless.
Enable
Security
Enable a secure connection to the WAP gateway.
HP LoadRunner (12.00)
Page 379 of 1743
LoadRunner User Guide
Script Workflow
Advanced Properties
UI Element
Description
Acknowledge
headers
Returns standard headers that provide information to the gateway.
Default value: Disabled.
BearerType
The type of bearer used as the underlying transport.
CAPSessionResume Enables requests for session suspend or resume.
Client SDU buffer
size
The largest transaction service data unit that may be sent to the client
during the session.
Default value: 4000.
Confirm Push
support
In CO mode, if a push message is received, this option instructs the
Vuser to confirm the receipt of the message. For more information, see
VuGen Push Support.
MethodMOR
The number of outstanding methods that can occur simultaneously.
Network MTU Size
The maximum size in bytes, of the network packet.
Default value: 4096.
Push support
Enables push type messages across the gateway.
Default value: Disabled.
PushMOR
The number of outstanding push transactions that can occur
simultaneously.
Retrieve messages
When a push messages is received, this option instructs the Vuser to
retrieve the message data from the URL indicated in the push message.
Default value: Disabled.
Server SDU buffer
size
The largest transaction service data unit that may be sent to the server
during the session.
Default value: 4000.
Support Cookies
Provide support for saving and retrieving cookies.
Default value: Disabled.
WTLS Abbreviated
Handshake
Use an abbreviated handshake instead of a full one, when receiving a
redirect message.
Default value: False.
WTLS Deffie
Hellman
Use the Deffie Hellman encryption scheme for WTLS (Wireless
Transport Layer Security) instead of the default scheme, RSA.
Default value: False.
WTLS Deffie
Hellman identifier
An identifier for the Deffie Hellman encryption scheme. This identifier is
required for the abbreviated handshake with the Operwave gateway that
uses the Deffie Hellman encryption scheme.
HP LoadRunner (12.00)
Page 380 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
WTP
Retransmission
Time
The time in seconds that the WTP layer waits before re-sending the
PDU if it did not receive a response.
Default value: 5000.
WTP Segmentation
and Reassembly
Enables segmentation and reassembly (SAR) in WTP, Wireless
Transport Protocol.
Default value: True.
WAP > Radius Node
Enables you to set the WAP radius run-time settings.
To access
VuGen > Replay > Run-Time Settings > WAP > Radius
Important
This node is available only for specific protocols. For a complete list of protocols
information and their associated nodes, see "Protocol Compatibility Table" on page 320.
User interface elements are described below:
UI Element
Description
Accounting port
number
Accounting port of the Radius server.
Authentication port
number
Authentication port of the Radius server.
Connection Timeout
(sec)
The time in seconds to wait for the Radius server to respond.
Default value: 120 seconds.
IP Address
IP address of the Radius server.
Network Type
Accounting network type: GPRS (General Packet Radio Service) or
CSD (Circuit-Switched Data).
Radius client IP
Radius packets source IP, usually used to differentiate between
packets transmitted on different NIC cards on a single Load
Generator machine.
Retransmission retries
The number of times to retry after a failed transmission. Default
value: 0.
Secret Key
The secret key of the Radius server.
Store attributes
returned by the server
to parameters
Allow Vusers to save attributes returned by the server as
parameters, which can be used at a later time.
Default value: False.
HP LoadRunner (12.00)
Page 381 of 1743
LoadRunner User Guide
Script Workflow
Bookmarks Overview
When you edit a Vuser script, you can use bookmarks to navigate between sections of the script.
When you add a bookmark, a bookmark icon is added to the left of the selected line in your script.
The Bookmarks pane displays a list of all bookmarks that exist in the Vuser script. Using the
Bookmarks pane, you can:
l
Navigate to the location of the bookmark in your script.
l
Navigate between consecutive bookmarks in the pane.
l
Delete an individual bookmark.
l
Clear all bookmarks.
For task details, see "How to Use Bookmarks" on page 385.
How to Run a Vuser Script from a Command Prompt
This task describes how to run a Vuser script from a command prompt or from the Windows Run
dialog box—without the VuGen user interface.
To send command line parameters to a Vuser from within VuGen, add the attributes and their
values in the Run-Time settings dialog box. For details, see the "General > Additional Attributes
Node" on page 335.
To run a script from a command line or the Run dialog box:
1. Open a Command Prompt window, or select Start > Run to open the Run dialog box.
2. Type mdrv followed by the script name, using the following syntax:
<installation_dir>/bin/mdrv.exe -usr <script_name>
where script_name is the full path to the .usr script file, for example,
c:\temp\mytest\mytest.usr.
3. Add other command line options and arguments.
4. Click Enter. The mdrv program runs a single instance of the script without the user interface.
The output files provide the run-time information.
For a complete list of the command line options, type mdrv at a command prompt from the
LoadRunner bin folder, without any arguments. The following examples provide common usages of
a command line expression:
HP LoadRunner (12.00)
Page 382 of 1743
LoadRunner User Guide
Script Workflow
You can specify the load generator, as well as indicate the number of times to run the script as
indicated by the following example:
l
script1
-host pc4
-loop 5
Specify a location for the output files. For example:
l
-out c:\tmp\vuser
Specify arguments to pass to your script by using the following format:
l
script_name
-arg_name arg_value
-arg_name arg_value
You can retrieve the command line values by parsing the command line during replay, using the
parsing functions, such as lr_get_attrib_double. For details, see the Function Reference (Help >
Function Reference).
Note: The Linux command line utility, run_db_vuser, does not yet support many of the
standard Windows command line options. For details, see Running a Vuser from the Linux
Command Line.
How to Run a Vuser Script from a Linux Command
Line
When using VuGen to develop Linux-based Vusers, you must check that the recorded script runs
on the Linux platform. This task describes how to perform this check and run a Vuser script from a
Linux command.
1.
Verify that the script replays in VuGen
Replay the script in VuGen to verify that the script works in windows before attempting to run it
in Linux. This is recommended because it is easier to edit and debug the script in VuGen. For
task details, see "How to Replay a Vuser Script" on page 316.
2.
Copy the script files to the Linux server
Transfer the script files to the Linux server
3.
Check the Vuser setup on the Linux machine by using verify_
generator.
If you intend to run all of the Vusers on one host, type:
verify_generator
The verify_generator either returns OK when the setting is correct, or Failed and a suggestion
on how to correct the setup.
HP LoadRunner (12.00)
Page 383 of 1743
LoadRunner User Guide
Script Workflow
For detailed information about the verify checks type:
verify_generator [-v]
The verify utility checks the local host for its communication parameters and its compatibility
with all types of Vusers. It checks the following items in the Vuser environment:
4.
n
at least 128 file descriptors
n
proper .rhost permissions: -rw-r--r--
n
the host can be contacted using rsh to the host. If not, checks for the host name in .rhosts
n
M_LROOT is defined
n
.cshrc defines the correct M_LROOT
n
.cshrc exists in the home directory
n
the current user is the owner of the .cshrc
n
a LoadRunner installation exists in $M_LROOT
n
the executables have executable permissions
n
PATH contains $M_LROOT/bin, and /usr/bin
n
the rstatd daemon exists and is running
Run the script
Run the script in standalone mode from the Vuser script folder, using the run_db_vuser shell
script:
run_db_vuser.sh <commands> script_name.usr
The run_db_vuser shell script has the following command line options:
Command Description
--help
Display the available options. (This option must be preceded by two dashes.)
-cpp_only
Run cpp only (pre-processing) on the script.
-cci_only
Run cci only (pre-compiling) on the script to create a file with a .ci extension.
You can run cci only after a successful cpp.
-driver
driver_
path
Use a specific driver program. Each database has its own driver program
located in the /bin folder. For example, the driver for CtLib located in the /bin
folder, is mdrv. This option lets you specify an external driver.
HP LoadRunner (12.00)
Page 384 of 1743
LoadRunner User Guide
Script Workflow
-exec_
only
Execute the Vuser .ci file. This option is available only when a valid .ci file
exists.
-ci ci_file_
name
Execute a specific .ci file.
-out
output_
path
Place the results in a specific folder.
By default, run_db_vuser.sh runs cpp, cci, and execute in verbose mode. It uses the driver in
the VuGen installation\bin folder, and saves the results to an output file in the Vuser script
folder. You must always specify a .usr file. If you are not in the script folder, specify the full
path of the .usr file.
For example, the following command line executes a Vuser script called test1, and places the
output file in a folder called results1. The results folder must be an existing folder—it will not be
created automatically:
run_db_vuser.sh-out /u/joe/results1
test1.usr
How to Use Bookmarks
When working in the Editor, VuGen lets you place bookmarks at various locations within your
script. You can navigate between the bookmarks to analyze and debug your code. The following
steps describe how to work with bookmarks. Most of the bookmark functionality is available from
VuGen's Bookmarks pane. To access the Bookmarks pane, click View > Bookmarks.
Create a Bookmark
In the Editor, place the cursor at the desired location and press Ctrl + F2. VuGen places a bookmark
icon
in the left margin of the script.
Remove a Bookmark
To remove a bookmark, perform one of the following:
l
In the Editor, click in the line that contains the bookmark and press Ctrl + F2.
l
In the Bookmark pane, select the bookmark that you want to delete and click the Delete
Bookmark button
.
VuGen removes the bookmark icon from the left margin.
Navigate between Bookmarks
Click View > Bookmarks to display the Bookmarks pane.
HP LoadRunner (12.00)
Page 385 of 1743
LoadRunner User Guide
Script Workflow
l
To move to the next bookmark, click the Next Bookmark button
or press F2.
l
To return to the previous bookmark, click the Previous Bookmark button
F2.
or press Shift +
You can navigate between bookmarks in the current action only. To navigate to a bookmark in
another action, select that action in the left pane and then press F2.
Navigate to a Specific Bookmark in a Vuser Script
In the Bookmarks pane, double-click the specific bookmark to which you want to navigate. The
cursor flashes in the Editor at the start of the line containing the bookmark.
Files Generated During Replay
This section describes what occurs when a Vuser script is replayed, and describes the files that are
created.
1. The options.txt file is created. This file includes command line parameters to the
preprocessor.
Example of options.txt file
-DCCI
-D_IDA_XL
-DWINNT
-Ic:\tmp\Vuser
s)
-IE:\LRUN45B2\include
-ec:\tmp\Vuser\logfile.log
c:\tmp\Vuser\VUSER.c
d)
(name and location of Vuser include file
(name and location of include files)
(name and location of output logfile)
(name and location of file to be processe
2. The file Vuser.c is created. This file contains 'includes' to all the relevant .c and .h files.
Example of Vuser.c file
#include
#include
#include
#include
"E:\LRUN45B2\include\lrun.h"
"c:\tmp\web\init.c"
"c:\tmp\web\run.c"
"c:\tmp\web\end.c"
3. The c preprocessor cpp.exe is invoked in order to 'fill in' any macro definitions, precompiler
directives, and so on, from the development files.
HP LoadRunner (12.00)
Page 386 of 1743
LoadRunner User Guide
Script Workflow
The following command line is used:
cpp -foptions.txt
4. The file pre_cci.c is created which is also a C file (pre_cci.c is defined in the options.txt file).
The file logfile.log (also defined in options.txt) is created containing any output of this
process. This file should be empty if there are no problems with the preprocessing stage. If the
file is not empty then it is almost certain that the next stage of compilation will fail due to a fatal
error.
5. The cci.exe C compiler is now invoked to create a platform-dependent pseudo-binary file (.ci)
to be used by the Vuser driver program that will interpret it at run-time. The cci takes the pre_
cci.c file as input.
6. The file pre_cci.ci is created as follows:
cci -errout c:\tmp\Vuser\logfile.log -c pre_cci.
7. The file logfile.log is the log file containing output of the compilation.
8. The file pre_cci.ci is now renamed to Vuser.ci.
Since the compilation can contain both warnings and errors, and since the driver does not know
the results of this process, the driver first checks if there are entries in the logfile.log file. If
there are, it then checks if the file Vuser.ci has been built. If the file size is not zero, it means
that the cci has succeeded to compile - if not, then the compilation has failed and an error
message will be given.
9. The relevant driver is now run, taking both the .usr file and the Vuser.ci file as input. For
example:
mdrv.exe -usr c:\tmp\Vuser\.usr -out c:\tmp\Vuser -file c:\tmp\Vuser\Vuser.ci
The .usr file is needed since it tells the driver program which database is being used. This
determines which libraries need to be loaded for the run.
10. If there is an existing replay log file, output.txt, (see the following entry), the log file is copied to
output.bak.
11. The output.txt file is created (in the path defined by the 'out' variable). This file contains the
output messages that were generated during the script replay. These are the same messages
that appear in the Replay view of VuGen's Output pane.
Debugging Vuser Scripts
The Debugging section describes the various methods that are available to debug Vuser scripts.
HP LoadRunner (12.00)
Page 387 of 1743
LoadRunner User Guide
Script Workflow
Debugging - Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
fifth step, debugging a Vuser script.
After creating a Vuser script, replay the script to verify that the script runs without errors. Using
VuGen's debug features, you can identify and resolve errors in your scripts. You can access most
of these script debugging features from the VuGen toolbar.
Running a Vuser script
To run a Vuser script until the end of the script or until the next breakpoint, perform one of the
following:
l
Select Replay > Run.
l
Click the Run button
l
Press F5.
on the Vuser toolbar.
Note: The status of the Vuser script execution appears in the lower left corner of VuGen. The
script execution status may be Ready, Running, or Paused.
l
To stop a script that is running, click the Stop Replay
button on the VuGen toolbar.
l
To pause a script that is running, click the Pause
l
To continue running a script that is paused, click the Continue
button on the VuGen toolbar.
button on the VuGen toolbar.
The Run Step by Step Command
The Run Step by Step command runs the script one line at a time. This enables you to follow the
script execution. The Run Step by Step command starts the script replay, and then and pauses it
on the first line of the script, usually in the vuser_init() action.
To run the script step by step, perform one of the following:
l
Select Replay > Run Step by Step.
l
Click the Run Step by Step button
l
Press F10.
HP LoadRunner (12.00)
on the VuGen toolbar.
Page 388 of 1743
LoadRunner User Guide
Script Workflow
Note that the Run Step by Step button is available only while a script is being replayed.
Animated Run
You can run a Vuser script in animated mode or non-animated mode. When you run in animated
mode, VuGen highlights the line that is running in the Vuser script. When you run in non-animated
mode, VuGen executes the Vuser script, but does not indicate the line being executed.
To toggle between the animated mode and the non-animated mode:
l
Click the Animated Run
button on the VuGen toolbar.
l
Click Replay > Animated Run.
Note that the Animated Run button is available only while a script is being replayed.
For details on how to set the run mode using VuGen options, see "Scripting Options" on page 103.
Breakpoints
Breakpoints pause script execution at specified points in the script. This enables you to examine
the effects of the script on your application at pre-determined points during script execution.
l
For concept details on breakpoints, see "Working with Breakpoints" on page 392.
l
For task details, see "How to Debug Scripts with Breakpoints" on page 394.
Bookmarks
When working in Script view, VuGen lets you place bookmarks at various locations within your
script. You can navigate between the bookmarks to help analyze and debug your code.
l
For task details, see "How to Use Bookmarks" on page 385.
Watching Variables
The Watch pane enables you to monitor variables and expressions while a script runs. You can
monitor variables and expressions only when execution of a Vuser script is in the Paused state. To
display the Watch pane, click View > Debug > Watch. For details on using the Watch pane, see
"Watching Expressions and Variables" on page 392.
Go To Commands
l
To navigate around a script using breakpoints, you can use the Go To Source command. For
details, see "How to Debug Scripts with Breakpoints" on page 394.
l
To navigate around a script using bookmarks, you can use the Next Bookmark and Previous
Bookmark commands. For details, see "How to Use Bookmarks" on page 385.
HP LoadRunner (12.00)
Page 389 of 1743
LoadRunner User Guide
Script Workflow
If you want to examine the Replay log messages for a specific step or function, right-click the step
in the Editor and select Go To Step in Replay Log. VuGen places the cursor at the start of the
corresponding step in the Output pane's Replay log.
Output Pane
The Output pane displays messages that were generated during the replay of your script. For
details, see "Output Pane" on page 124.
To enable some recorded Vuser scripts to replay correctly, it may be necessary to implement
correlation. Correlation is used when a recorded script includes a dynamic value (such as a session
ID) and therefore cannot be successfully replayed. To resolve this, you convert the dynamic value
into a variable—thereby enabling your script to replay successfully. For details, see "Correlation
Overview" on page 274.
Error Handling
You can specify how a Vuser handles errors during script execution. By default, when a Vuser
detects an error, the Vuser stops executing the script. You can instruct a Vuser to continue with the
next iteration when an error occurs using one of the following methods:
l
Using run-time settings. You can specify the Continue on Error run-time setting. The
Continue on Error run-time setting applies to the entire Vuser script. You can use the lr_
continue_on_error function to override the Continue on Error run-time setting for a portion of
a script.
l
Using the lr_continue_on_error function. The lr_continue_on_error function enables you to
control error handling for a specific segment of a Vuser script. To mark the segment, enclose it
with lr_continue_on_error(1); and lr_continue_on_error(0); statements. The new error
settings apply to the enclosed Vuser script segment. See the paragraphs below for details.
For example, if you enable the Continue on Error run-time setting and a Vuser encounters an error
during replay of the following script segment, the Vuser continues executing the script:
web_link("EBOOKS",
"Text=EBOOKS",
"Snapshot=t2.inf",
LAST);
web_link("Find Rocket eBooks",
"Text=Find Rocket eBooks",
"Snapshot=t3.inf",
LAST);
To instruct the Vuser to continue on error for a specific segment of the script, enclose the segment
with the appropriate lr_continue_on_error statements:
lr_continue_on_error(1);
web_link("EBOOKS",
"Text=EBOOKS",
"Snapshot=t2.inf",
LAST);
web_link("Find Rocket eBooks",
HP LoadRunner (12.00)
Page 390 of 1743
LoadRunner User Guide
Script Workflow
"Text=Find Rocket eBooks",
"Snapshot=t3.inf",
LAST);
lr_continue_on_error(0);
Additional Debugging Information
General Debugging Tip
VuGen can be used as a regular text editor. You can open any text file in it and edit it. When an error
message is displayed during replay in the output window below, you can double click on it and
VuGen jumps the cursor to the line of the test that caused the problem. You can also place the
cursor on the error code and press F1 to view the online help explanation for the error code.
Using C Functions for Tracing
You can use the C interpreter trace option (in version 230 or higher) to debug your Vuser scripts.
The ci_set_debug statement allows trace and debug to be turned on and off at specific points in
the script.
ci_set_debug(ci_this_context, int debug, int trace);
For example, you could add the following statements to your script:
ci_set_debug(ci_this_context, 1, 1) /* turn ON trace =; debug */
ci_set_debug(ci_this_context, 0, 0) /* turn OFF trace =; debug */
Additional C Language Keywords
When you run a C script in VuGen, its parser uses the built-in C interpreter to parse the functions in
the script. You can add keywords that are not part of the standard parser's library. By default,
several common C++ keywords are added during installation, such as size_t and DWORD. You
can edit the list and add additional keywords for your environment.
Add Additional Keywords
1. Open the vugen_extra_keywords.ini file, located in your machine's <Windows> or
<Windows>/System directory.
2. In the EXTRA_KEYWORDS_C section, add the desired keywords for the C interpreter.
The file has the following format:
[EXTRA_KEYWORDS_C]
FILE=
size_t=
WORD=
DWORD=
LPCSTR=
Examining Replay Output
Look at the replay output (either from within VuGen, or the file output.txt representing the output of
the VuGen driver). You may also change the run-time settings options in VuGen to select more
HP LoadRunner (12.00)
Page 391 of 1743
LoadRunner User Guide
Script Workflow
extensive logging in order to obtain a more detailed log output of the replayed test.
Working with Breakpoints
VuGen lets you include breakpoints in you Vuser scripts to help you to debug the scripts.
Breakpoints pause script execution at specified points in the script. This enables you to analyze the
effects of the script on your application at pre-determined points during script execution. For task
details, see "How to Debug Scripts with Breakpoints" on page 394. A breakpoint symbol ( ) in the
left margin of the script indicates the presence of a breakpoint. In addition, VuGen highlights the line
in the script.
You can disable a breakpoint if the breakpoint is temporarily not required. A white dot inside the
Breakpoint symbol indicates a disabled breakpoint ( ). When a breakpoint is disabled, script
execution continues at the disabled breakpoint and is paused at the following enabled breakpoint.
You use the Breakpoints pane to enable and disable breakpoints. In addition, the breakpoints pane
enables you to delete an existing breakpoint or delete all existing breakpoints. To display the
Breakpoints pane, click View > Debug > Breakpoints.
To run a script with breakpoints, begin running the script as usual. VuGen pauses script execution
when it reaches a breakpoint. You can examine the effects of the script run up to the breakpoint,
make any necessary changes, and then restart the script from the breakpoint.
To resume execution, select Replay > Run. Once restarted, the script continues until it encounters
another breakpoint or the end of the script.
Watching Expressions and Variables
VuGen's Watch pane enables you to monitor variables while a script runs. The list of variables that
you want to watch is known as the watch list, and is displayed in the watch pane. To display the
Watch pane, click View > Debug > Watch. You can add only variables to the watch list - you
cannot add expressions to the watch list. You can add, edit, or remove variables within the watch
list by using the Watch pane's toolbar buttons. You can sort the columns in the watch pane by
expression, value, or type name by clicking the column headers. For details on other debugging
features in VuGen, see "Debugging - Overview" on page 388.
Note: You can monitor variables only when execution of a Vuser script is in the Paused state.
Adding a New Watch to the Watch List
You can add a new watch expression only when execution of a Vuser script is in the Paused state.
To add a new watch:
1. Click View > Debug > Watch to open the Watch pane.
2. Click the Add Watch button
. The Add New Watch dialog box opens.
3. In the Expression field, enter the variable that you want to watch, and then click OK. VuGen
adds the variable to the list of expressions in the watch list.
HP LoadRunner (12.00)
Page 392 of 1743
LoadRunner User Guide
Script Workflow
Note: You can add only variables to the watch list - you cannot add expressions to the watch list.
Editing a Watch Expression
Note: You can edit a watch expression only when execution of a Vuser script is in the Paused
state.
To edit a watch expression:
1. Click View > Debug > Watch to open the Watch pane.
2. In the watch list, select the expression that you want to edit, and then click the Edit Watch
Expression button
. The Edit Watch dialog box opens.
3. In the Expression field, modify the existing variable as required, and then click OK. VuGen
displays the modified variable in the list of variables in the watch list.
Deleting a Watch Expression
Note: You can delete a watch expression only when execution of a Vuser script is in the Paused
state.
To delete a watch expression:
1. Click View > Debug > Watch to open the Watch pane.
2. In the Watch pane, select the expression that you want to delete, and then click the Delete
Watch button
watch list.
. VuGen deletes the selected expression from the list of expressions in the
Deleting All Watch Expressions From the Watch List
Note: You can delete watch expressions only when execution of a Vuser script is in the Paused
state.
To delete all watch expressions from the watch list:
1. Click View > Debug > Watch to open the Watch pane.
2. Click the Delete All Watches button
list.
. VuGen deletes all the expressions from the watch
Debugging Web Vuser Scripts
VuGen provides an additional tool to help you debug Web Vuser scripts—the Results Summary
report.
You can specify whether or not a Web Vuser generates a Results Summary report during script
execution. The Results Summary report summarizes the success or failure of each step in the Web
Vuser scripts and allows you to view the Web page returned by each step. For additional details on
working with the Results Summary report, select Replay > Test Results and click F1 to open the
online help.
HP LoadRunner (12.00)
Page 393 of 1743
LoadRunner User Guide
Script Workflow
For more user interface information, see "Scripting Options" on page 103.
Note: Transaction times may be increased when a Vuser generates a Results Summary
report. Vusers can generate Results Summary reports only when run from VuGen. When you
run a script from the Controller or Business Process Monitor, Vusers do not generate reports.
How to Debug Scripts with Breakpoints
The following steps describe how to work with breakpoints. For concept details, see "Working with
Breakpoints" on page 392.
Add a Breakpoint
To add a breakpoint:
Locate the cursor in the script where you want to insert the breakpoint and then do one of the
following:
l
Select Replay > Toggle Breakpoint.
l
Press F9.
l
Click in the left margin if the script, adjacent to where you want to insert the breakpoint.
The Breakpoint symbol (
the script.
) appears in the left margin of the script, and VuGen highlights the line in
Delete a Breakpoint
To delete a breakpoint:
Locate the cursor in the script where you want to delete the breakpoint and then do one of the
following:
l
Select Replay > Toggle Breakpoint.
l
Press F9.
l
Click the breakpoint symbol left margin if the script.
The Breakpoint symbol (
) is removed from the left margin of the script.
Enable/Disable a Breakpoint
To disable a breakpoint:
Click View > Debug > Breakpoints to display the Breakpoints pane.
l
Select the appropriate Enable check box to enable a breakpoint. The Breakpoint symbol (
appears in the left margin of the script.
l
Clear the appropriate Enable check box to disable a breakpoint. The Disabled Breakpoint
symbol ( ) appears in the left margin of the script.
HP LoadRunner (12.00)
)
Page 394 of 1743
LoadRunner User Guide
Script Workflow
When a breakpoint is disabled, script execution continues at the disabled breakpoint and is paused
at the following enabled breakpoint.
Manage Breakpoints
The Breakpoints pane allows you to remove, enable, and disable breakpoints in a Vuser script. For
user interface details, see "Breakpoints Pane" on page 135.
Navigate to a specific breakpoint in a Vuser script
To navigate to a specific breakpoint in a Vuser script, perform one of the following:
l
In the Breakpoints pane, select the specific breakpoint to which you want to navigate, and then
click the Go to source button
l
.
In the Breakpoints pane, double-click the breakpoint to which you want to navigate.
The cursor flashes in the Editor at the start of the line containing the breakpoint.
Run a Script With Breakpoints
Begin running the script as usual. VuGen pauses script execution when it reaches a breakpoint.
You can examine the effects of the script run up to the breakpoint, make any necessary changes,
and then restart the script from the breakpoint.
To resume execution, select Replay > Run. Once restarted, the script continues until it encounters
another breakpoint or the end of the script.
Enhancing a Script for Load Testing
The Enhancing a Script for Load Testing section explains the features that VuGen provides to
enable you to create Vuser scripts that will be able to accurately generate load. This includes
features such as parameterization, transactions, and rendezvous points.
Enhancing a Script for Load Testing - Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
sixth step, viewing the results of the replay of a Vuser script.
This task describes the additional things you can do to a Vuser script to prepare the script for load
testing. All of the items in this task are optional.
Add Parameterization
When you record a business process, VuGen generates a script that contains the actual values
used during recording. Suppose you want to perform the script's actions (query, submit, and so
forth) using different values from those recorded. To do this, you replace the recorded values with
parameters. This is known as parameterizing the script. For more information, see "Parameterizing
- Overview" on page 408.
HP LoadRunner (12.00)
Page 395 of 1743
LoadRunner User Guide
Script Workflow
Insert Transactions
You can insert transactions into your Vuser script either while recording the script or after recording
the script. For task details, see "How to Insert Transactions" on page 398.
Insert Rendezvous Points
You can synchronize Vusers to perform a task at exactly the same moment by creating a
rendezvous point. When a Vuser arrives at the rendezvous point, it waits until all Vusers
participating in the rendezvous arrive. When the designated number of Vusers arrive, the Vusers
are released.
You can insert rendezvous points in one of the following ways:
l
To insert a rendezvous point while recording, click the Rendezvous button
Recording toolbar and enter a name in the dialog box (not case sensitive).
on the
l
To insert a rendezvous point after recording, select Design > Insert in Script > Rendezvous
and enter a name for the rendezvous point (not case sensitive).
When a rendezvous point is inserted, VuGen inserts a lr_rendezvous function into the Vuser
script. For example, the following function defines a rendezvous point named rendezvous1:
lr_rendezvous("rendezvous1");
For concept details, see "Rendezvous Points" on page 400.
Insert VuGen Functions
You can insert VuGen functions at this point. For a list of some useful functions see "Adding VuGen
Functions - Overview" on page 400.
Insert Steps
You can insert a variety of steps into your script such as think time steps, debug messages, and
output messages. For task details, see "How to Insert Steps into a Script" on page 406.
Insert Comments
VuGen allows you to insert comments between Vuser activities. You can insert a comment to
describe an activity or to provide information about a specific operation. For example, if you are
recording database actions, you could insert a comment to mark the first query, such as "This is the
first query."
You can insert a comment in one of the following ways:
l
To insert a comment while recording, click the Insert Comment button
toolbar and enter the desired comment in the Insert Comment dialog box.
on the Recording
l
To insert a comment after recording, select Design > Insert in Script > Comment and enter
the comment.
The following script segment shows how a comment appears in a Vuser script:
HP LoadRunner (12.00)
Page 396 of 1743
LoadRunner User Guide
Script Workflow
/* <comments> */
Insert Log Messages
You can use VuGen to generate and insert lr_log_message functions into a Vuser script. For
example, if you are recording database actions, you could insert a message to indicate the first
query, "This is the first query."
To insert a log message, select Design > Insert in Script > Log Message and enter the
message.
Insert Synchronization Points (RTE Vusers only)
You can add synchronization functions to synchronize the execution of the Vuser script with the
output from your application. Synchronization applies to RTE Vuser scripts only.
The following is a list of the available synchronization functions:
Function
Description
TE_wait_cursor
Waits for the cursor to appear at a specified location in the terminal
window.
TE_wait_silent
Waits for the client application to be silent for a specified number of
seconds.
TE_wait_sync
Waits for the system to return from X-SYSTEM or Input Inhibited
mode.
TE_wait_text
Waits for a string to appear in a designated location.
TE_wait_sync_
transaction
Records the time that the system remained in the most recent XSYSTEM mode.
For details about synchronization in RTE Vuser scripts, see "RTE Synchronization Overview" on
page 766.
Transaction Overview
You define transactions to measure the performance of the server. Each transaction measures the
time it takes for the server to respond to specified Vuser requests. These requests can be simple
tasks such as waiting for a response for a single query, or complex tasks, such as submitting
several queries and generating a report.
To measure a transaction, you insert Vuser functions to mark the beginning and the end of a task.
Within a script, you can mark an unlimited number of transactions, each transaction with a different
name.
For LoadRunner, the Controller measures the time that it takes to perform each transaction. After
the test run, you analyze the server's performance per transaction using the Analysis' graphs and
reports.
HP LoadRunner (12.00)
Page 397 of 1743
LoadRunner User Guide
Script Workflow
Before creating a script, you should determine which business processes you want to measure.
You then mark each business process or sub-process as a transaction.
Transaction names cannot contain a "_" or "@" symbol. This will cause errors to occur when
attempting to open the Analysis Cross Results graphs.
You can create transactions either during or after recording. For task details, see "How to Insert
Transactions" below.
How to Insert Transactions
You can insert a transaction into a Vuser script either while recording the script or after recording the
script. The following steps describe different methods to insert transactions. For background
information, see "Transaction Overview" on the previous page.
Insert a transaction after recording
You use VuGen's Editor to insert a transaction after recording a Vuser script.
1. To mark the start of a transaction, locate the cursor in the script where you want to start the
transaction, and then perform one of the following:
n
Select Design > Insert in Script > Start Transaction.
n
Press Ctrl+T.
n
Right-click in the script where you want to start the transaction and select Insert > Start
Transaction.
VuGen inserts an lr_start_transaction statement into the Vuser script. Enter a transaction
name into the new step.
2. To mark the end of a transaction, locate the cursor in the script where you want to end the
transaction, and then perform one of the following:
n
Select Design > Insert in Script > End Transaction.
n
Press Ctrl+Shift+T.
n
Right-click in the script where you want to end the transaction and select Insert > End
Transaction.
VuGen inserts an lr_end_transaction statement into the Vuser script. Enter a transaction
name into the new step.
3. To simultaneously mark the start and end of a transaction:
a. Select the steps that you want to include in the transaction.
b. Select Design > Insert in Script > Surround with Transaction, or right-click inside the
selection and select Surround with Transaction, or press Shift+Ctrl+I.
HP LoadRunner (12.00)
Page 398 of 1743
LoadRunner User Guide
Script Workflow
The Surround with Transaction dialog box opens.
c. Enter a name for the transaction, and then click OK.
VuGen inserts an lr_start_transaction statement before the first selected step, and an lr_
end_transaction statement after the last selected step.
Insert a transaction while recording
l
To mark the start of a transaction, click the Start Transaction button
on the Recording
toolbar, enter a transaction name, and click OK. When the script is generated, VuGen inserts an
lr_start_transaction statement into the Vuser script.
l
To mark the end of a transaction, click the End Transaction button
on the Recording
toolbar and select the transaction to close. When the script is generated, VuGen inserts an lr_
end_transaction statement into the Vuser script.
Notes:
l
You can create nested transactions—transactions within transactions. If you nest
transactions, close the inner transactions before closing the outer ones—otherwise the
transactions won't be analyzed properly. However, transactions must be contained within a
single action section.
l
Transaction names must be unique and may contain letters or numbers. Do not use the
following characters: . , : # / \ " <.
l
A failed transaction does not automatically set the script's Replay status to Failed.
How to Display Transactions
The following steps describe how to display different types of transactions when viewing them in
the task pane. For background information, see "Transaction Overview" on page 397.
Display Hidden Transactions
To display the hidden transactions—the non-primary and client side transactions—click the button
adjacent to Show hidden transactions at the bottom of the transaction list. VuGen lists the hidden
transactions in gray. To hide them, click the button again.
Display Transactions With Errors
Transactions with errors are those that do not measure any server steps, or those with illegal
names. To show the transactions with errors, click the Show transactions with errors button.
VuGen lists the transactions with errors in red. To hide them, click the button again.
Display Transactions for Non-primary Steps
To show the transactions for non-primary steps, you need to display all of the thumbnails. Select
HP LoadRunner (12.00)
Page 399 of 1743
LoadRunner User Guide
Script Workflow
View > Show All Thumbnails.
Rendezvous Points
When performing load testing, you need to emulate heavy user load on your system. To accomplish
this, you synchronize Vusers to perform a task at exactly the same moment. You configure multiple
Vusers to act simultaneously by creating a rendezvous point. When a Vuser arrives at the
rendezvous point, it waits until all Vusers participating in the rendezvous arrive. When the
designated number of Vusers arrive, the Vusers are released.
You designate the meeting place by inserting a rendezvous point into your Vuser script. When a
Vuser executes a script and encounters the rendezvous point, script execution is paused and the
Vuser waits for permission from the Controller to continue. After the Vuser is released from the
rendezvous, it performs the next task in the script.
For task details, see "Enhancing a Script for Load Testing - Overview" on page 395.
Note: Rendezvous points are effective only in Action sections—not init or end sections.
Adding VuGen Functions - Overview
This section contains useful VuGen functions that you may want to add to your script while
debugging or preparing your script for load testing.
Obtaining Vuser Information
You can add the following functions to your Vuser scripts to retrieve Vuser information:
Function
Description
lr_get_attrib_
string
Returns a command line parameter string.
lr_get_host_
name
Returns the name of the machine running the Vuser script.
lr_get_master_
host_name
Returns the name of the machine running the Controller. Not applicable when
working with the HP Business Service Management.
lr_whoami
Returns the name of a Vuser executing the script. Not applicable when
working with the HP Business Service Management.
In the following example, the lr_get_host_name function retrieves the name of the computer on
which the Vuser is running.
my_host = lr_get_host_name( );
For more information about the above functions, see the Function Reference (Help > Function
Reference).
HP LoadRunner (12.00)
Page 400 of 1743
LoadRunner User Guide
Script Workflow
Sending Messages to Output
Using the Message type functions in your Vuser script, you can send customized error and
notification messages to the output and log files, and to the Test Report summary. For example,
you could insert a message that displays the current state of the client application. The LoadRunner
Controller displays these messages in the Output window. You can also save these messages to a
file.
When working with HP Business Service Management, you can use Message type functions to
send error and notification messages to the Web site or Business Process Monitor log files. For
example, you could insert a message that displays the current state of the Web-based application.
Note: Do not send messages from within a transaction as this may lengthen the transaction
execution time and skew the transaction results.
You can use the following message functions in your Vuser scripts:
Function
Description
lr_debug_
message
Sends a debug message to the Output window or the Business Process Monitor
log file.
lr_error_
message
Sends an error message to the Output window, Test Results report, or the
Business Process Monitor log files.
lr_get_
debug_
message
Retrieves the current message class.
lr_log_
message
Sends an output message directly to the log file, output.txt, located in the Vuser
script folder. This function is useful in preventing output messages from interfering
with TCP/IP traffic.
lr_output_
message
Sends a message to the Output window, Test Results report, or the Business
Process Monitor log files.
lr_set_
debug_
message
Sets a message class for output messages.
lr_vuser_
status_
message
Sends a message to the Vuser status area in the Controller. Not applicable when
working with the HP Business Service Management.
lr_
message
Sends a message to the Vuser log and Output window or the Business Process
Monitor log files.
The behavior of the lr_message, lr_output_message, and lr_log_message functions are not
affected by the script's debugging level in the Log run-time settings—they will always send
messages.
HP LoadRunner (12.00)
Page 401 of 1743
LoadRunner User Guide
Script Workflow
Using the lr_output_message, and lr_error_message functions, you can also send meaningful
messages to the Test Results summary report. For information, see "Viewing Replay Results" on
page 479
General Vuser Functions
The general Vuser functions are also called LR functions because each LR function has an lr prefix.
The LR functions can be used in any type of Vuser script. The LR functions enable you to:
l
Get run-time information about a Vuser, its Vuser Group, and its host.
l
Add transactions and synchronization points to a Vuser script. For example, the lr_start_
transaction (lr.start_transaction in Java) function marks the beginning of a transaction, and
the lr_end_transaction (lr.end_transaction in Java) function marks the end of a transaction.
See "Enhancing a Script for Load Testing" on page 395 for more information.
l
Send messages to the output, indicating an error or a warning.
For details see the Function Reference (Help > Function Reference).
Protocol-Specific Vuser Functions
In addition to the general Vuser functions, VuGen also generates and inserts protocol-specific
functions into the Vuser script while you record.
The protocol-specific functions are particular to the type of Vuser that you are recording. For
example, VuGen inserts LRS functions into a Windows Sockets script.
By default, VuGen's automatic script generator creates Vuser scripts in C for most protocols, and in
Java for Java type protocols. You can instruct VuGen to generate code in Visual Basic or
Javascript. For more information, see "General > Script Node" on page 203.
All standard conventions apply to the scripts, including control flow and syntax. You can add
comments and conditional statements to the script just as you do in other programming languages.
The following segment from a Web Vuser script shows several functions that VuGen recorded and
generated in a script:
#include "as_web.h"
Action1()
{
web_add_cookie("nav=140; DOMAIN=dogbert");
web_url("dogbert",
"URL=http://dogbert/",
"RecContentType=text/html",
LAST);
web_image("Library",
"Alt=Library",
LAST);
web_link("1 Book Search:",
"Text=1 Book Search:",
HP LoadRunner (12.00)
Page 402 of 1743
LoadRunner User Guide
Script Workflow
LAST);
lr_start_transaction("Purchase_Order");
...
For more information about using C functions in your Vuser scripts, see the Function Reference
(Help > Function Reference). For more information about modifying a Java script, see "Java Vuser
Protocol - Manually Programming Scripts" on page 667.
Note: The C Interpreter used for running Vuser scripts written in C, only supports the ANSI C
language. It does not support the Microsoft extensions to ANSI C.
Encrypting Text
You can encrypt text within your script to protect your passwords and other confidential text strings.
You can perform encryption both automatically, from the user interface, and manually, through
programming. You can restore the string at any time, to determine its original value. When you
encrypt a string, it appears in the script as a coded string. VuGen uses 32-bit encryption.
In order for the script to use the encrypted string, it must be decrypted with lr_decrypt.
lr_start_transaction(lr_decrypt("3c29f4486a595750"));
For task details, see "How to Encrypt/Decrypt Text" on the next page.
Password Encoding
You can encode passwords in order to use the resulting strings as arguments in your script or
parameter values. For example, your Web site may include a form in which the user must supply a
password. You may want to test how your site responds to different passwords, but you also want
to protect the integrity of the passwords. The Password Encoder enables you to encode your
passwords and place secure values into the table.
To encode a password, select Start > All Programs > HP Software > HP LoadRunner > Tools
> Password Encoder.
For task details, see "How to Encode a Password" on the next page.
For user interface details, see "Password Encoder Dialog Box" on the next page.
Encrypting Text
You can encrypt text within your script to protect your passwords and other confidential text strings.
You can perform encryption both automatically, from the user interface, and manually, through
programming. You can restore the string at any time, to determine its original value. When you
encrypt a string, it appears in the script as a coded string. VuGen uses 32-bit encryption.
In order for the script to use the encrypted string, it must be decrypted with lr_decrypt.
lr_start_transaction(lr_decrypt("3c29f4486a595750"));
For task details, see "How to Encrypt/Decrypt Text" on the next page.
HP LoadRunner (12.00)
Page 403 of 1743
LoadRunner User Guide
Script Workflow
How to Encrypt/Decrypt Text
This task describes how to encrypt and decrypt strings in your code. For background information,
see "Encrypting Text" on the previous page.
Encrypt a string
1. Select the text you want to encrypt.
2. Select Encrypt string (string) from the right-click menu.
Restore an encrypted string
1. Select the string you want to restore.
2. Select Restoreencrypted string (string) from the right-click menu.
For more information on the lr_decrypt function, see the Function Reference (Help > Function
Reference).
How to Encode a Password
This task describes how to encode a password. You can encode passwords in order to use the
resulting strings as arguments in your script or parameter values. For example, your Web site may
include a form in which the user must supply a password. You may want to test how your site
responds to different passwords, but you also want to protect the integrity of the passwords.
Encode a password
1. From the Windows menu, select Start > All Programs > HP Software > HP LoadRunner >
Tools > Password Encoder. The Password Encoder dialog box opens.
2. Enter the password in the Password box.
3. Click Generate. The Password Encoder encrypts the password and displays it in the Encoded
String box.
4. Use the Copy button to copy and paste the encoded value into the Data Table.
Password Encoder Dialog Box
This dialog box enables you to generate encoded passwords.
HP LoadRunner (12.00)
Page 404 of 1743
LoadRunner User Guide
Script Workflow
To access
Start > All Programs > HP Software > HP LoadRunner > Tools >
Password Encoder
Relevant
tasks
"How to Encode a Password" on the previous page
See also
"Password Encoding" on page 403
User interface elements are described below:
UI Element Description
Copy
Copy the results from the encoded string field to paste them to the Data table
containing your list of parameters.
Encoded
String
The encoded results are displayed here.
Generate
Click this to generate the encoded password.
Password
Enter the password you want to encode here.
How to Create a Controller Scenario from VuGen
Note: The following section only applies to LoadRunner. For information on integrating scripts
into Business Process profiles, see the HP Business Service Management documentation.
Normally, you create a scenario from the LoadRunner Controller. You can also create a basic
scenario from VuGen using the current script.
To create this type of scenario, select Tools > Create Controller Scenario and complete the
dialog box. For user interface details, see "Create Controller Scenario Dialog Box" on the next
page.
For more information, see the HP Controller User Guide.
HP LoadRunner (12.00)
Page 405 of 1743
LoadRunner User Guide
Script Workflow
How to Insert Steps into a Script
The following steps describe how to add different types of steps into a Vuser script.
Insert Think Time Steps
The time that a user waits between performing successive actions is known as the think time.
Vusers use the lr_think_time function to emulate real-user think time. When your record a Vuser
script, VuGen records the actual think times and inserts appropriate lr_think_time statements into
the Vuser script. You can edit the recorded lr_think_time statements, and manually add more lr_
think_time statements to a Vuser script.
To add a think time step, select Design > Insert in Script > New Step > Think Time and specify
the desired think time - in seconds.
Note: When you record a Java Vuser script, lr_think_time statements are not generated in the
Vuser script.
You can use the run-time settings to influence how the lr_think_time statements operate when you
execute a Vuser script. For user interface details, see "General > Think Time Node" on page 350.
Insert Debug Messages
You can add a debug or error message using VuGen's user interface. For debug messages you can
indicate the level of the text message—the message is only issued when your specified level
matches the message class. You set the message class using lr_set_debug_message.
To insert a debug message, select Design> Insert in Script >New Step > Debug Message and
complete the dialog box. For user interface details, see Debug Message Dialog Box.
Insert Error and Output Messages
For protocols that support the Step Navigator, such as Web, Winsock, and Oracle NCA, you can
add an error or output message using the user interface. A common usage of this function is to
insert a conditional statement, and issue a message if the error condition is detected.
To insert an error or output message, select Design > Insert in Script >New Step > Error
Message or Output Message, and enter the message. An lr_error_message or lr_output_
message function is inserted at the current point in the script.
Note: An Error Message step in a script does not automatically set the Replay status to Failed.
Create Controller Scenario Dialog Box
This dialog box enables you to create a basic Controller scenario from within VuGen.
HP LoadRunner (12.00)
Page 406 of 1743
LoadRunner User Guide
Script Workflow
To access
VuGen > Tools > Create Controller Scenario
Relevant tasks
"How to Create a Controller Scenario from VuGen" on page
405
User interface elements are described below:
UI
Element
Description
Add script If a scenario is currently open in the Controller and you want to add the script to this
to current scenario, select this check box. If you clear the check box, LoadRunner opens a
scenario
new scenario with the specified number of Vusers.
Group
Name
For a manual scenario, users with common traits are organized into groups.
Specify a new group name for the Vusers.
Load
Generator
The name of the machine that will run the scenario.
Results
Directory
Enter the desired location for the results.
Script
Name
For a goal-oriented scenario, specify a script name.
HP LoadRunner (12.00)
Page 407 of 1743
LoadRunner User Guide
Script Workflow
, continued
Select
Scenario
Type
l
Goal Oriented Scenario. LoadRunner automatically builds a scenario based
on the goals you specify.
l
Manual Scenario. The scenario is created manually by specifying the number
of Vusers to run.
Parameters
The Parameters section describes who how to insert, define and modify parameters.
Parameterizing - Overview
When you record a business process, VuGen generates a script that contains the actual values
used during recording. Suppose you want to perform the script's actions (query, submit, and so
forth) using different values from those recorded. To do this, you replace the recorded values with
parameters. This is known as parameterizing the script.
The resulting Vusers substitute the parameter with values from a data source that you specify. The
data source can be either a file, or internally generated variables. For details, see "Parameter
Types" on page 410.
Parameters appear inside a Vuser script within parameter delimiters. By default, VuGen uses "{"
and "}" as the left and right parameter delimiters, but you can modify these delimiters if required. In
addition, you can modify the background color and outline color of parameters in a script. For
details, see "Scripting Options" on page 103.
Delimiter Example
Script section as recorded.
"value=UNIX"
Script section after "UNIX" has been replaced with the "Operating System" parameter.
"value={Operating System}"
You can use parameterization only for the arguments within a function. You cannot parameterize
text strings that are not function arguments. In addition, not all function arguments can be
parameterized. For details on which arguments you can parameterize, see the Function Reference
(Help > Function Reference) for each function.
Input parameters are parameters whose values you define in the design stage before running the
script. Output parameters you define during design stage, but they acquire values during test
execution. Output parameters are often used with Web Service calls. Use care when selecting a
parameter for your script during design stage, make sure that it is not an empty Output parameter.
Example
Let's say you recorded a Vuser script while operating a Web application. VuGen generated the
HP LoadRunner (12.00)
Page 408 of 1743
LoadRunner User Guide
Script Workflow
following statement that searches a library's database for the title "UNIX":
web_submit_form("db2net.exe",
ITEMDATA,
"name=library.TITLE",
"value=UNIX",
ENDITEM,
"name=library.AUTHOR",
"value=",
ENDITEM,
"name=library.SUBJECT",
"value=",
ENDITEM,
LAST);
When you replay the script using multiple Vusers and iterations, you do not want to repeatedly
use the same value, UNIX. Instead, you replace the constant value with a parameter:
web_submit_form("db2net.exe",
ITEMDATA,
"name=library.TITLE",
"value={Book_Title}",
ENDITEM,
"name=library.AUTHOR",
"value=",
ENDITEM,
"name=library.SUBJECT",
"value=",
ENDITEM,
LAST);
For task details, see "How to Create a Parameter" on page 412.
To enable some recorded Vuser scripts to replay correctly, it may be necessary to implement
correlation. Correlation is used when a recorded script includes a dynamic value (such as a session
ID) and therefore cannot be successfully replayed. To resolve this, you convert the dynamic value
into a variable—thereby enabling your script to replay successfully. For details, see "Correlation
Overview" on page 274.
VTS and Parameterization
What is VTS?
HP LoadRunner Virtual Table Server [VTS] is a web-based application that works with LoadRunner
Vuser scripts. VTS offers an alternative to standard LoadRunner parameterization.
When you use standard LoadRunner parameterization, each Vuser is assigned parameter values
from a dedicated set of values - parameter values are not shared between Vusers. In contrast, VTS
enables you to assign parameter values from a single set of parameter values to multiple Vusers.
This may enable you to more accurately emulate a real-user environment.
HP LoadRunner (12.00)
Page 409 of 1743
LoadRunner User Guide
Script Workflow
VTS is composed of two components, VTS-Client and VTS-Server. VTS-Client is a set of API
functions that are used to access data in VTS-Server. Because the VTS API functions are
integrated into LoadRunner, there is no need to install VTS-Client. VTS-Server includes a table that
contains parameter values that can be used by your Vuser scripts. The VTS table is composed of
columns and rows. Each column represents a set of values that can be assigned to a specific
parameter in your Vuser scripts. The cells within a column contain the actual values that are
assigned to the parameter.
Note: Significant changes were made to VTS in LoadRunner version 11.52. When upgrading to
VTS 11.52 or later, these changes may result in various compatibility issues. For details on
script modifications that are required in order to resolve these compatibility issues, see the
VTS documentation that is available from the VTS > Help menu.
l
For details on how to install VTS-Server, see the HP LoadRunner Installation Guide. After
installing VTS-Server, you can access further information about VTS from the VTS > Help
menu.
l
For details on how to use VTS functionality in TruClient Vuser scripts, see "How to Use VTS in
TruClient" on page 539.
Parameter Types
Every parameter is defined by the type of data it contains. This section contains information on the
different parameter types.
File Parameter Types
Data files hold data that a Vuser accesses during script execution. Data files can be local or global.
You can specify an existing ASCII file, use VuGen to create a new one, or import a database file.
Data files are useful if you have many known values for your parameter.
The data in a data file is stored in the form of a table. One file can contain values for many
parameters. Each column holds the data for one parameter. Column breaks are marked by a
delimiter, for example, a comma.
In the following example, the data file contains ID numbers and first names:
id,first_name
120,John
121,Bill
122,Tom
Note: When working with languages other than English, save the parameter file as a UTF-8
file. In the Parameter Properties window, click Edit with Notepad. In Notepad, save the file as
a text file with UTF-8 type encoding.
HP LoadRunner (12.00)
Page 410 of 1743
LoadRunner User Guide
Script Workflow
Table Parameter Types
The Table parameter type is meant for applications that you want to test by filling in table cell
values. Whereas the file type uses one cell value for each parameter occurrence, the table type
uses several rows and columns as parameter values, similar to an array of values. Using the table
type, you can fill in an entire table with a single command. This is common in SAP GUI Vusers
where the sapgui_table_fill_data function fills the table cells.
XML Parameter Types
Used as a placeholder for multiple valued data contained in an XML structure. You can use an XML
type parameter to replace the entire structure with a single parameter. For example, an XML
parameter called Address can replace a contact name, an address, city, and postal code. Using
XML parameters for this type of data allows for cleaner input of the data, and enables cleaner
parameterization of Vuser scripts. We recommend that you use XML parameters with Web Service
scripts or for SOA services.
Internal Data Parameter Types
Internal data is generated automatically while a Vuser runs, such as Date/Time, Group Name,
Iteration Number, Load Generator Name, Random Number, Unique Number, and Vuser ID.
l
Custom: You can specify the parameter data type.
l
Date/Time: The current date/time. You can specify the format and the offset in the Parameter
Properties dialog box.
l
Group Name: The name of the Vuser Group. If there is no Vuser Group (for example, when
running a script from VuGen) the value is always none.
l
Iteration Number: The current iteration number.
l
Load Generator Name: The name of the Vuser script's load generator (the computer on which
the Vuser is running).
l
Random Number: A random number within a range of values that you specify.
l
Unique Number: Assigns a range of numbers to be used for each Vuser. You specify the start
value and the block size (the amount of unique numbers to set aside for each Vuser). For
example, if you specify a start value of 1 and a block size of 100 the first Vuser can use the
numbers 1 to 100, the second Vuser can use the numbers 201-300, and so on.
l
Vuser ID: The ID number assigned to the Vuser by the Controller during a scenario run. When
you run a script from VuGen, the Vuser ID is always -1.
Note: This is not the ID number that appears in the Vuser window—it is a unique ID number
generated at runtime.
User-Defined Function Parameters
Data that is generated using a function from an external DLL. A user-defined function replaces the
parameter with a value returned from a function located in an external DLL.
HP LoadRunner (12.00)
Page 411 of 1743
LoadRunner User Guide
Script Workflow
Before you assign a user-defined function as a parameter, you create the external library (DLL) with
the function. The function should have the following format:
__declspec(dllexport) char *<functionName>(char *, char *)
The arguments sent to this function are both NULL.
When you create the library, we recommend that you use the default dynamic library path. That
way, you do not have to enter a full path name for the library, but rather, just the library name.
VuGen's bin folder is the default dynamic library path. You can add your library to this folder.
The following are examples of user-defined functions:
__declspec(dllexport) char *UF_GetVersion(char *x1, char *x2) {return "Ver2.0";}
__declspec(dllexport) char *UF_GetCurrentTime(char *x1, char *x2) {
time_t x = tunefully); static char t[35]; strcpy(t, ctime( =;x)); t[24] = '\0';
return t;}
How to Create a Parameter
This task describes how to create a parameter.
1.
Select the value you want to parameterize
You can do this step from both the Editor and from the Steps Navigator pane.
Select the value you want to parameterize, right-click and select Replace with Parameter.
Notes:
n
When creating XML parameters in script view, you must select only the inner xml, without
the bounding tags. For example, to parameterize the complex data structure
<A><B>Belement</B><C>Celement</C></A>, select the whole string,
<B>Belement</B><C>Celement</C>, and replace it with a parameter.
n
When parameterizing Java Record Replay or Java Vuser scripts, you must parameterize
complete values, not parts of a value.
Steps Navigator pane
Right-click on a step and select Show Arguments. Click the ABC icon next to the argument
that you want to parameterize.
2.
Create a new parameter in the Select or Create Parameter dialog box
Specify the parameters name and type in the Select or Create Parameter dialog box. For user
interface details, see "Select or Create Parameter Dialog Box" on page 425.
3.
Add a list of required values
From the Select or Create Parameter dialog box, select Properties. Create a table and add
entries to serve as the list of values for your parameter. For user interface details, see
HP LoadRunner (12.00)
Page 412 of 1743
LoadRunner User Guide
Script Workflow
"Parameter Properties Dialog Box" on page 426.
4.
Modify the parameter braces - optional
You can modify the braces that surround parameters in the Configure Parameter Braces
dialog box. You can access the dialog box from the following locations:
n
Right-click on the Parameters node in the Solution Explorer pane and select Configure
Parameter Delimiters.
n
Design > Parameters > Configure Parameter Delimiters
n
Tools > Options > Parameters
For user interface details, see Parameter Delimiters Configuration Dialog Box.
Data Assignment Methods for File/Table/XML
Parameters
When using values from a file, VuGen lets you specify the way in which you assign data from the
source to the parameters. The following methods for assigning data are available:
Sequential
Assigns data to a Vuser sequentially. As a running Vuser accesses the data table, it takes the next
available row of data.
If there are not enough values in the data table, VuGen returns to the first value in the table,
continuing in a loop until the end of the test.
Random
Assigns a random value from the data table every time a new parameter value is requested.
When running a scenario in LoadRunner, or a script in HP Business Process Monitor, you can
specify a seed number for random sequencing. Each seed value represents one sequence of
random values used for test execution. Whenever you use this seed value, the same sequence of
values is assigned to the Vusers in the scenario. You enable this option if you discover a problem in
the test execution and want to repeat the test using the same sequence of random values.
Unique
Assigns a unique sequential value to the parameter for each Vuser. Ensure that there is enough
data in the table for all Vusers and their iterations. If you have 20 Vusers and you want to perform 5
iterations, your table must contain at least 100 unique values.
If you run out of unique values, VuGen behaves according to the option you select in the When out
of values field. For more information, see "Parameter Properties Dialog Box" on page 426.
Note: For LoadRunner users: If a script uses Unique file parameterization, running more than
one Vuser group with that script in the same scenario may cause unexpected scenario results.
HP LoadRunner (12.00)
Page 413 of 1743
LoadRunner User Guide
Script Workflow
For more information about Vuser groups in scenarios, see the Function Reference.
l
For details on the different data assignment and update methods, see "Data Assignment and
Update Methods for File/Table/ XML Parameters" below.
l
For details on how parameters behave when the number of iterations do not match the number of
values in the parameter file, see "Vuser Behavior in the Controller (LoadRunner Only)" on the
next page.
Data Assignment and Update Methods for File/Table/
XML Parameters
For File, Table, and XML type parameters, the Data Assignment method that you select, together
with your choice of Update method, affect the values that the Vusers use to substitute parameters
during the scenario run.
The Data Assignment method is determined by the Select next row field, and the Update method
is determined by the Update value on field.
The following table summarizes the values that Vusers use depending on which Data Assignment
and Update properties you selected:
Update
Method
Data Assignment Method
Sequential
Random
Unique
Each
iteration
The Vuser takes the next The Vuser takes a new
value from the data table random value from the
for each iteration.
data table for each
iteration.
The Vuser takes a value
from the next unique
position in the data table
for each iteration.
Each
occurrence
(Data Files
only)
The Vuser takes the next
value from the data table
for each occurrence of
the parameter, even if it
is within the same
iteration.
The Vuser takes a new
random value from the
data table for each
occurrence of the
parameter, even if it is
within the same iteration.
The Vuser takes a new
unique value from the data
table for each occurrence
of the parameter, even if it
is within the same
iteration.
Once
The value assigned in
the first iteration is used
for all subsequent
iterations for each Vuser.
The random value
assigned in the first
iteration is used for all
iterations of that Vuser.
The unique value
assigned in the first
iteration is used for all
subsequent iterations of
the Vuser.
Examples
Assume that your table/file has the following values:
Kim; David; Michael; Jane; Ron; Alice; Ken; Julie; Fred
HP LoadRunner (12.00)
Page 414 of 1743
LoadRunner User Guide
Script Workflow
Sequential Method
l
If you specify update on Each iteration, all the Vusers use Kim in the first iteration, David in the
second iteration, Michael in the third iteration, and so on.
l
If you specify update on Each occurrence, all the Vusers use Kim in the first occurrence, David
in the second occurrence, Michael in the third occurrence, and so on.
l
If you specify update Once, all Vusers take Kim for all iterations.
Note: If you select the Sequential method and there are not enough values in the data table,
VuGen returns to the first value in the table, continuing in a loop until the end of the test.
Random Method
l
If you specify update on Each iteration, the Vusers use random values from the table for each
iteration.
l
If you specify update on Each occurrence, the Vusers use random values for each occurrence
of the parameter.
l
If you specify update Once, all Vusers take the first randomly assigned value for all the
iterations.
Unique Method
l
If you specify update on Each iteration, for a test run of 3 iterations, the first Vuser takes Kim in
the first iteration, David in the second, and Michael in the third. The second Vuser takes Jane,
Ron, and Alice. The third Vuser, Ken, Julie, and Fred.
l
If you specify update on Each occurrence, then the Vuser uses a unique value from the list for
each occurrence of the parameter.
l
If you specify update Once, the first Vuser takes Kim for all iterations, the second Vuser takes
David for all iterations, and so on.
Vuser Behavior in the Controller (LoadRunner Only)
When you set up a scenario to run a parameterized script, you can instruct the Vusers how to act
when there are not enough values. The following table summarizes the results of a scenario using
the following parameter settings:
l
Select next row = Unique
l
Update Value on = Each iteration
l
When out of values = Continue with last value
HP LoadRunner (12.00)
Page 415 of 1743
LoadRunner User Guide
Script Workflow
Situation
Duration
Resulting Action
More
iterations
than
values
Run until
When the unique values are finished, each Vuser continues with
completion the last value, but a warning message is sent to the log indicating
that the values are no longer unique.
More
Vusers
than
values
Run
indefinitely
or Run for
...
Vusers take all of the unique values until they are finished. Then
the test issues an error message Error: Insufficient records for
param <param_name> in table to provide the Vuser with
unique data. To avoid this, change the When out of values
option in the Parameter properties or the Select next row method
in the Parameter properties.
One of two
parameters
are out of
values
Run
indefinitely
or Run for
...
The parameter that ran out of values, continues in a cyclic manner
until the values of the second parameter are no longer unique.
How to Work with Existing Parameters
This task describes how to replace values with pre-defined parameters.
Replace a value with a parameter
You can replace a value with an pre-defined parameter. In the script-editor, right-click on the
relevant value and select one of the following options:
l
Replace with Parameter > select a <pre-defined> parameter. The list of parameters include
parameters which have the same original value or parameters that have not yet been used.
l
Replace with Parameter > select a parameter from the Parameter List dialog box.
Replace multiple occurrences of a value with a parameter
You can replace multiple occurrences of a value with a parameter. To do this, in the script editor
replace at least one occurrence of the value with a parameter. Right-click the parameter and select
Replace more occurrences. Use Search and Replace to replace all of the values in the script
with the selected parameter.
Restore the original value
You can undo a parameter and restore the original value by right-clicking the parameter in the script
editor and selecting Restore original value.
XML Parameters
When you create a Web Service call to emulate a specific operation, the arguments in the operation
may include complex structures with many values. You can use an XML type parameter to replace
the entire structure with a single parameter.
HP LoadRunner (12.00)
Page 416 of 1743
LoadRunner User Guide
Script Workflow
You can create several value sets for the XML elements and assign a different value set for each
iteration.
The XML parameter type supports complex schema types such as arrays, Choice, and <Any>
elements.
When working with Web Service Input Arguments, you may encounter arrays and their subelements. You can define a single XML parameter that will contain values for all of the array
elements.
You can create new XML type parameters directly from the Insert menu, similar to all other
parameter types. For Web Services type scripts, you create an XML parameter directly from the
Web Services Call properties.
Caution: For protocols using XML, replay fails to create a request when a parameterized input
argument contains the ampersand (&) character.
How to Create an XML Parameter from a Web
Service Call
This task describes how to create a new XML Parameter from a Web Service Call. This procedure
is in addition to the standard procedure to create a parameter. XML Parameters can also be created
by using the standard procedure.
Create an XML Parameter from a Web Service Call
1. Select the root element of the complex data structure. The right pane displays the argument's
details.
HP LoadRunner (12.00)
Page 417 of 1743
LoadRunner User Guide
Script Workflow
2. Select XML in the right pane, and click the ABC
dialog box opens.
icon. The Select or Create Parameter
3. In the Parameter name box, enter a name for the parameter.
4. In the Parameter type box, select XML if it is not already selected.
5. Click Properties to assign a value set now, or OK to close the dialog box and assign values
later.
How to Create XML Parameters - Standard Method
This task describes how to create an XML type parameter without viewing the properties of a Web
Service call. This is the most common way of parameterizing values for most protocols and
parameter types.
For Web Service Scripts, we recommend that you create parameters from within a Web Service
Call, as described in "XML Parameters" on page 416.
Create a new XML parameter
1. Select Insert > New Parameter or select a constant value in the Script view and select
Replace with a Parameter from the right-click menu. The Select or Create Parameter dialog
box opens.
2. In the Parameter name box, enter a name for the parameter.
HP LoadRunner (12.00)
Page 418 of 1743
LoadRunner User Guide
Script Workflow
3. In the Parameter type box, select XML if it is not already selected.
4. Click Properties to assign a value set now, or OK to close the dialog box and assign values
later.
How to Define XML Value Sets
This task describes how to create value sets for XML parameters.
Value sets are arrays that contain a set of values. Using the Add Column and Duplicate Column
buttons, you can create multiple value sets for your parameter and use them for different iterations.
When using value sets, the number of array elements per parameter does not have to be constant.
You can use optional elements that will appear in one value set, but not in another. This allows you
to vary the values you send for each of the iterations—some iterations can include specific array
elements, while other iterations exclude them.
To exclude an optional element, click the small triangle in the upper left corner of the cell and insure
that it is not filled in.
In the following example, Set 1 and Set 2 use the optional elements: name, street, and state. Set 3
does not use a street name.
HP LoadRunner (12.00)
Page 419 of 1743
LoadRunner User Guide
Script Workflow
Set parameter element values
1. View the Parameter Properties.
If the Parameter Properties dialog box is not open, select Vuser > Parameter List and select
the desired parameter. The dialog box shows a read-only view of the parameter values.
2. Open the Data Parameterization box.
Click the Edit Data button to open the Data Parameterization dialog box.
3. Define value sets for the XML parameter.
In the Set columns, insert values corresponding to the schema.
HP LoadRunner (12.00)
Page 420 of 1743
LoadRunner User Guide
Script Workflow
If a row says NIL, it implies that the element is nillable. To include a value for the nillable
element, enter the value as usual. To mark a value as nil, click the NIL icon to fill it in. This
erases any value that you may have assigned to the element. In the following example, the city
element is nillable, but it is only marked as nil in Set 2 and Set3—not in Set 1.
4. Create additional value sets.
To insert more value sets, click Add Column and insert another set of values in the new
column. To copy an existing value set, select a row in the value set you want to copy and click
Duplicate Column.
5. Copy arrays.
To duplicate an array element and its children, select the parent node and choose Duplicate
Array Element from the right-click menu.
6. Handle the <any> elements.
For any type elements, right-click <any> in the Schema column and select one of the available
options. These options may vary depending on the location of the cursor.
n
Add Array Element. Adds a sub-element under the root element.
HP LoadRunner (12.00)
Page 421 of 1743
LoadRunner User Guide
Script Workflow
n
Insert child. Adds a sub-element to the selected element.
n
Insert sibling. Adds a sub-element on the same level as the selected element.
n
Load XML. Loads the element values from an XML file.
n
Save XML. Saves the array as an XML file.
n
Copy XML. Copies the full XML of the selected element to the clipboard.
Click the Rename text to provide a meaningful name for each array element.
7. Remove unwanted columns.
To remove a value set, select it and click Delete Column.
8. Save the changes.
Click Apply to save the changes and update the view in the Parameter Properties dialog box.
How to Set an Assignment Method
This task describes how to set an assignment method. The assignment method indicates which of
the value sets to use and how to use them. For example, you can instruct Vusers to use a new
value set for each iteration and use the value sets sequentially or at random. For more information,
see "Data Assignment and Update Methods for File/Table/ XML Parameters" on page 414.
Define an assignment method
1. Open the Parameter Properties and select a parameter.
2. Define a data assignment method.
In the Select next value list, select a data assignment method to instruct the Vuser how to
select the file data during Vuser script execution. The options are: Sequential, Random, or
Unique. For more information, see "Data Assignment Methods for File/Table/XML Parameters"
on page 413.
HP LoadRunner (12.00)
Page 422 of 1743
LoadRunner User Guide
Script Workflow
3. Select an update option for the parameter.
In the Update value on list, select an update option. The choices are Each Iteration, Each
Occurrence, and Once. For more information, see "Data Assignment and Update Methods for
File/Table/ XML Parameters" on page 414.
4. If you chose Unique as the data assignment method the When out of values and Allocate
Vuser values in the Controller options become enabled.
n
When out of values. Specify what to do when there is no more unique data: Abort Vuser,
Continue in a cyclic manner, or Continue with last value.
n
Allocate Vuser values in the Controller (for LoadRunner users only). Indicate whether you
want to manually allocate data blocks for the Vusers. You can allow the Controller to
automatically allocate a block size or you can specify the desired number of values. Select
Automatically allocate block size or Allocate x values for each Vuser. For the second
option, specify the number of values to allocate.
To track this occurrence, enable the Extended Log > Parameter Substitution option in the
Log Run-Time settings. When there is not enough data, VuGen writes a warning message to
the Vuser log: No more unique values for this parameter in table <table_name>.
5. In the Parameter Properties dialog box, click Close.
The list of input arguments is replaced by the parameter name, and ABC button is replace by a
table icon
parameter.
which you can click to edit the parameter properties or un-parameterize the
How to Modify XML Parameter Properties
This task describes how to modify XML parameter properties.
To modify XML parameter properties:
1. In the Step Navigator, right-click the required step and select Show Arguments. The Web
Service Call Properties dialog box opens.
2. From the list of arguments, under Input Arguments, select the XML parameter. The right pane
displays the parameter details.
3. To modify the XML parameter properties, select the XML check box, click the table icon
button, and then select Parameter Properties. The Parameter Properties dialog box opens.
4. Modify the parameter properties as desired.
HP LoadRunner (12.00)
Page 423 of 1743
LoadRunner User Guide
Script Workflow
How to Set AUT Environment Parameters
When working with scripts stored in HP Application Lifecycle Management (ALM), you can work
with different Application Under Test (AUT) environments.
AUT Environments are environments that you define in ALM that represent different testing
configurations. By parameterizing the environment data, you can make your test more flexible and
portable. Instead of running several scripts that use the same logic, but with different AUT
environment constants, you can maintain a single script that uses AUT environment parameters.
You define environment-specific parameters in ALM's AUT Environment configuration. During the
test run, ALM inserts these values into your script. For more details on working with AUT
environments, refer to the HP Application Lifecycle Management User Guide.
This task describes how to define an AUT environment type parameter in your Vuser script.
1. Create a parameter in VuGen. Make sure the name of the parameter matches the name of the
corresponding AUT environment parameter.
2. Set the parameter type to "Custom parameter".
3. Enter the following parameter description "ALMPARAM" , using the exact spelling and case.
How to Import Parameter Data from a Database
VuGen enables you to import data from a database for use with parameterization. You can import
the data in one of the following ways. After you import the data, it is saved as a file .dat extension
with a prefix of the <source script name>_ and stored as a regular parameter file.
Create a Query Using Microsoft Query
1. In the "Database Query Wizard" on page 440, select Create query using Microsoft Query. If
you need instructions on Microsoft Query, select Show me how to use Microsoft Query.
2. Click Finish. If Microsoft Query is not installed on your machine, VuGen issues a message
indicating that it is not available. Install MS Query from Microsoft Office before proceeding.
3. Follow the instructions in the wizard, importing the desired tables and columns.
4. When you finish importing the data, select Exit and return to the Virtual User Generator
and click Finish. The database records appear in the Parameter Properties box as a data file.
Specify an SQL Statement Manually
1. In the "Database Query Wizard" on page 440, select Specify SQL Statement Manually and
click Next.
2. Click Create to specify a new connection string. The Select Data Source window opens.
HP LoadRunner (12.00)
Page 424 of 1743
LoadRunner User Guide
Script Workflow
3. Select a data source, or click New to create a new one. The wizard guides you through the
procedure for creating an ODBC data source. When you are finished, the connection string
appears in the Connection String box.
4. In the SQLstatement box, enter an SQL statement.
5. Click Finish to process the SQL statement and import the data. The database records appears
in the Parameter Properties box as a data file.
Select or Create Parameter Dialog Box
This dialog box enables you to create a new parameter or modify an existing parameter.
To access
Relevant
tasks
Use one of the following:
l
VuGen > Solution Explorer pane > right-click on the Parameters node >
Create New Parameter
l
In script editor, right-click on the value > Replace with Parameter > Create
New Parameter
l
VuGen > Design > Parameters > Create New Parameter
"How to Create a Parameter" on page 412
User interface elements are described below:
UI Element
Description
Parameter
name
The name of the parameter.
Note: Do not use the name unique, it is used by VuGen.
Parameter
type
The type of the parameter. For information about the different parameter types
see "Parameter Types" on page 410.
Original
value
The original value of the parameter before parameterization.
HP LoadRunner (12.00)
Page 425 of 1743
LoadRunner User Guide
Script Workflow
Opens the Parameter Properties dialog box. For details, see "Parameter
Properties Dialog Box" below.
Parameter Properties Dialog Box
This page allows you to view and modify the properties of a parameter. This dialog box varies
depending on the type of parameter you are using.
To access
VuGen > Right-click parameter > Parameter properties
Date/Time, Group Name, Iteration Number, Load Generation Name, and
Vuser ID Parameters
User interface elements are described below:
UI Element
Description
Adds the custom format specified in the Date/time format or Text format field
to the format list.
Deletes the selected format from the format list.
Restores the format list to it's default state.
HP LoadRunner (12.00)
Page 426 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Date/time
format / Text
format
You can specify a custom format here. See the chart below for a list of
Date/time symbols.
Format list
The list of formats. See the chart below for a list of Date/time symbols.
Offset
(Date/time to
type only)
Allows you to set an offset for the date/time parameter. For example, if you
want to test a date next month, you set the date offset to 30 days.
l
Working days only. Use values for work days only (excludes Saturdays
and Sundays).
Note: To change the non-working days, configure the
NonWorkingDays parameter under the Misc section in the vugen.ini
file:
[Misc]
NonWorkingDays="5,6"
Days are represented by integers as follows:
Mon = 1, Tue = 2, Wed = 3 ,Thur = 4, Fri = 5, Sat = 6, Sun = 7
l
Prior to current date. Sets the offset for a date or time that has already
passed (negative offset).
Parameter
type
The parameter type. For more information see "Parameter Types" on page 410.
Sample
(current time)
Displays an example parameter value based on the selected format.
HP LoadRunner (12.00)
Page 427 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Update
values on
l
Each occurrence. Use a new value for each occurrence of the parameter in
your script. This is useful when the statements using a parameter are
unrelated. For example, for random data, it may be useful to use a new value
for each occurrence of the parameter.
l
Each iteration. Updates the parameter one time per iteration. If a parameter
appears in a script several times, the Vuser uses the same value for all
occurrences of the parameter, for the entire iteration. This is useful when the
statements using a parameter are related.
Note: If you create an action block with parameters using its own
iteration count—if you instruct VuGen to update their values each
iteration, it refers to the global iteration and not the block iteration.
l
Once. Updates the parameter value only once during the scenario run. The
Vuser uses the same parameter value for all occurrences and all iterations of
the parameter. This type may be useful when working with dates and times.
The following table describes the date/time symbols:
Symbol
Description
c
complete date and time in digits
#c
complete date as a string and time
H
hours (24 hour clock)
I
hours (12 hour clock)
M
minutes
S
seconds
p
AM or PM
d
day
m
month in digits (01-12)
b
month as a string - short format (e.g. Dec)
B
month as a string - long format (e.g. December)
y
year in short format (e.g. 03)
Y
year in long format (e.g. 2013)
HP LoadRunner (12.00)
Page 428 of 1743
LoadRunner User Guide
Script Workflow
File Parameters
User interface elements are described below:
UI Element
Description
Adds a column to the data set.
Adds a row to the data set.
Creates a new data table.
Opens the Database Query Wizard, enabling you to import data from an
existing database. For more information, see
Deletes a column from the data set.
Deletes a row from the data set.
Enables you to view and edit parameter values in Notepad. This is
important when working with large data sets because VuGen only
displays up to 100 rows in the UI.
Notepad opens with the parameter's name in the first row and its original
value in the second row. Enter additional column names and values into
the file using a delimiter such as a comma or a tab to indicate a column
break. Begin a new line for each table row (for each new row of data).
Opens the Parameter Simulation dialog box. This allows you to simulate
the parameter behavior with your data set. For more information, see
"Parameter Simulation Dialog Box" on page 435.
Select Column
Enables you to select the column to use as the data source either by the
column number or name.
File Format
l
Column delimiter. The character used to separate values in the data
file.
l
First data line. The first line of data to be used during Vuser script
execution. The header is line 0. To begin with the first line after the
header, specify 1. If there is no header, specify 0.
HP LoadRunner (12.00)
Page 429 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Select next row
The method of selecting the file data during Vuser script execution. The
options are: Sequential, Random, or Unique. For more information see
"Data Assignment Methods for File/Table/XML Parameters" on page 413.
Update value on
The method that determines when the parameter will switch to the next
value. The choices are Each Iteration, Each Occurrence, and Once. For
more information see "Data Assignment Methods for File/Table/XML
Parameters" on page 413.
When out of
values
Specify what to do when there is no more unique data: Abort the Vuser,
Continue in a cyclic manner, or Continue with last value.
Allocate Vuser
values in the
Controller
(LoadRunner only). Indicate whether you want to manually allocate data
blocks for the Vusers. You can allow the Controller to automatically
allocate a block size or you can specify the desired number of values.
Select Automatically allocate block size or Allocate x values for each
Vuser. For the second option, specify the number of values to allocate.
To track this occurrence, enable the Extended Log > Parameter
Substitution option in the Log Run-Time settings. When there is not
enough data, VuGen writes a warning message to the Vuser log "No more
unique values for this parameter in table <table_name>".
File path
Select the .dat file with the data for your parameter. Alternatively, you can
create a new data set using the Create Table button.
Table Parameters
User interface elements are described below:
UI Element (A-Z)
Description
Adds a column to the data set.
Adds a row to the data set.
Creates a new data table.
Opens the Database Query Wizard, enabling you to import data from an
existing database. For more information, see
Deletes a column from the data set.
Deletes a row from the data set.
HP LoadRunner (12.00)
Page 430 of 1743
LoadRunner User Guide
Script Workflow
UI Element (A-Z)
Description
Enables you to view and edit parameter values in Notepad. This is
important when working with large data sets because VuGen only displays
up to 100 rows in the UI.
Notepad opens with the parameter's name in the first row and its original
value in the second row. Enter additional column names and values into the
file using a delimiter such as a comma or a tab to indicate a column break.
Begin a new line for each table row (for each new row of data).
Allocate Vuser
values in the
Controller
(LoadRunner only). Indicate whether you want to manually allocate data
blocks for the Vusers. You can allow the Controller to automatically allocate
a block size or you can specify the desired number of values. Select
Automatically allocate block size or Allocate x values for each Vuser.
For the second option, specify the number of values to allocate.
To track this occurrence, enable the Extended Log > Parameter
Substitution option in the Log Run-Time settings. When there is not
enough data, VuGen writes a warning message to the Vuser log "No more
unique values for this parameter in table <table_name>".
Column
The columns to use. Alternatively, you can select Select all columns.
To specify one or more columns by their number, select Columns by
number and enter the column numbers separated by a comma or a dash.
The column number is the index of the column containing your data. For
example, if the data for the parameter is in the table's first column, select 1.
In the Column delimiter box, select a column delimiter—the character
used to separate the columns in the table. The available delimiters are:
comma, tab, space.
File path
Select the .dat file with the data for your parameter. Alternatively, you can
create a new data set using the Create Table button.
Row delimiter
for log display
This delimiter is used to differentiate between rows in the output logs. If you
enable parameter substitution logging, VuGen sends the substituted values
to the Replay log. The row delimiter character in the Replay log indicates a
new row.
HP LoadRunner (12.00)
Page 431 of 1743
LoadRunner User Guide
Script Workflow
UI Element (A-Z)
Description
Rows
l
Rows per iteration. How many rows to use per iteration. This only
relevant when the Update value on field is set to Each iteration. If
Update value on is set to Once, then the same rows will be used for all
iterations.
l
First line of data. The first line of data to be used during script
execution. To begin with the first line after the header, enter 1.
l
. Displays information about the table, including how
many rows of data are available.
Select next row
The method of selecting the file data during Vuser script execution. The
options are: Sequential, Random, or Unique. For more information see
"Data Assignment Methods for File/Table/XML Parameters" on page 413.
Update value on
The method that determines when the parameter will switch to the next
value. The choices are Each Iteration, Each Occurrence, and Once. For
more information see "Data Assignment Methods for File/Table/XML
Parameters" on page 413.
When not
enough rows
Specifies what VuGen does when there are not enough rows in the table for
the iteration.
Example: The table you want to fill has 3 rows, but your data only has two
rows. Select Parameter will get less rows than required to fill in only two
rows. Select Use behavior of "Select Next Row" to loop around and get
the next row according the method specified in the Select next row box.
When out of
values
Specify what to do when there is no more unique data: Abort the Vuser,
Continue in a cyclic manner, or Continue with last value.
Random Number Parameters
User interface elements are described below:
UI
Element
Description
Number
format
Specifies the minimum number of digits your parameter will have. Where %01d
represents one digit, %02d represents two digits, and so on.
Random The minimum and maximum range for the random values.
range
Sample
value
Displays an example parameter value based on the selected format.
HP LoadRunner (12.00)
Page 432 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Update
value on
Description
l
Each occurrence. Use a new value for each occurrence of the parameter in your
script. This is useful when the statements using a parameter are unrelated. For
example, for random data, it may be useful to use a new value for each occurrence
of the parameter.
l
Each iteration. Updates the parameter one time per iteration. If a parameter
appears in a script several times, the Vuser uses the same value for all
occurrences of the parameter, for the entire iteration. This is useful when the
statements using a parameter are related.
Note: If you create an action block with parameters using its own iteration count—if
you instruct VuGen to update their values each iteration, it refers to the global
iteration and not the block iteration.
l Once. Updates the parameter value only once during the scenario run. The Vuser
uses the same parameter value for all occurrences and all iterations of the
parameter. This type may be useful when working with dates and times.
Unique Number Parameters
Note: When scheduling a scenario in the Controller, the When out of values option only
applies to the Run for HH:MM:SS option in the Schedule Builder's Duration tab. It is ignored
for the Run until completion option.
User interface elements are described below:
UI
Element Description
Number
format
Specifies the minimum number of digits your parameter will have. Where %01d
represents one digit, %02d represents two digits, and so on.
Number
range
l
Start. The starting value.
l
Block size per Vuser. The amount of unique numbers assigned to each Vuser.
For example, if you specify a starting value of 1 and a block size of 100, the values
be 1-100 can be used by the first Vuser, the values 101-200 can be used by the
second Vuser, and so on.
Sample
value
Displays an example parameter value based on the selected format.
HP LoadRunner (12.00)
Page 433 of 1743
LoadRunner User Guide
Script Workflow
UI
Element Description
Update
value
on
l
Each occurrence. Use a new value for each occurrence of the parameter in your
script. This is useful when the statements using a parameter are unrelated. For
example, for random data, it may be useful to use a new value for each occurrence
of the parameter.
l
Each iteration. Updates the parameter one time per iteration. If a parameter
appears in a script several times, the Vuser uses the same value for all
occurrences of the parameter, for the entire iteration. This is useful when the
statements using a parameter are related.
Note: If you create an action block with parameters using its own iteration count—if
you instruct VuGen to update their values each iteration, it refers to the global
iteration and not the block iteration.
l Once. Updates the parameter value only once during the scenario run. The Vuser
uses the same parameter value for all occurrences and all iterations of the
parameter. This type may be useful when working with dates and times.
When
out of
values
Determines what to do when the range of values is reached for a Vuser. The range of
values is determined by the start value and the block size.
Abort Vuser. Terminates the Vuser script.
Continue in a cyclical manner. Restart the unique numbers for this Vuser from the
beginning of its assigned range. For example, if a Vuser had the range of 1-100 and it
reached 100, it would start again at 1.
Continue with last value. Use the last assigned value for this parameter for all
subsequent occurrences of this parameter. For example, if a Vuser had the range of 1100 and it reached 100, it would continue with the value of 100 until the end of the
script.
User Defined Function Parameters
User interface elements are described below:
UI
Element
Description
Function The name of the function. Use the name of the function as it appears in the DLL file.
Name
Library
Names
The location of the relevant library files.
HP LoadRunner (12.00)
Page 434 of 1743
LoadRunner User Guide
Script Workflow
UI
Element
Update
value on
Description
l
Each occurrence. Use a new value for each occurrence of the parameter in your
script. This is useful when the statements using a parameter are unrelated. For
example, for random data, it may be useful to use a new value for each
occurrence of the parameter.
l
Each iteration. Updates the parameter one time per iteration. If a parameter
appears in a script several times, the Vuser uses the same value for all
occurrences of the parameter, for the entire iteration. This is useful when the
statements using a parameter are related.
Note: If you create an action block with parameters using its own iteration
count—if you instruct VuGen to update their values each iteration, it refers to
the global iteration and not the block iteration.
l
Once. Updates the parameter value only once during the scenario run. The Vuser
uses the same parameter value for all occurrences and all iterations of the
parameter. This type may be useful when working with dates and times.
XML Parameters
For information about Web Services XML parameters, see "XML Parameters" on page 416.
Parameter Simulation Dialog Box
This dialog box allows you to view a simulation of the behavior of a file parameter.
To access
VuGen > Parameter List > Select Parameter > Simulate Parameter
HP LoadRunner (12.00)
Page 435 of 1743
LoadRunner User Guide
Script Workflow
Important
information
l
This feature is only relevant for file type parameters.
l
Not all types of Parameter Substitution can be simulated. If you select Select
next row: Same line as... or Update value on: Each occurrence, then the
Parameter Simulation dialog box will not open.
l
VuGen can simulate up to 256 iterations and 256 Vusers.
l
Run Indefinitely is compliant with the Real-life schedule in the Scheduler of
the Controller.
l
If you select Select next row: Unique in the Parameter List dialog, then each
Vuser is assigned a unique range of rows from which the Simulator will
substitute values (for that Vuser).
Note: If you have more than one unique parameter, you need to verify that
each parameter has defined values for all Vusers.
With this setting, the default selection in the Allocate Vuser values in the
Controller section is Automatically allocate block size. In this case, when you
run the simulation, the range allocation takes place in accordance with your
Scenario run mode selection.
If you change the default selection to Allocate x values for each Vuser, then
the Vusers will be allocated the amount of values you specify, ignoring of your
Scenario run mode selection.
User interface elements are described below:
UI Element
Description
Vusers
The number of Vusers to run in the simulation.
Scenario
Run Mode
l
Run until completion. Enter the number of iteration to run or select Take
number of iteration from Run-Time settings.
l
Run indefinitely. Simulates the run indefinitely option in the controller. VuGen
only actually simulates the number of iterations you specify.
Runs the parameter simulation. The values of each parameter substitution are
displayed.
Example:
In the following examples, the settings in the Parameter List dialog box are:
l
Values for the new parameter. Value1 to Value7
l
Select next row. Unique
HP LoadRunner (12.00)
Page 436 of 1743
LoadRunner User Guide
Script Workflow
l
When out of rows. Continue with last value
l
Allocate Vuser values in the Controller. Automatically allocate block size
Scenario run mode: Run until completion
In the following example, the user has selected three Vusers, set the Scenario run mode to Run
until completion, and selected three iterations.
When the scenario run mode is set to Run until completion, the number of rows that each Vuser
receives is the same as the number of iterations. The range allocation stops when there are no
longer enough rows in the table.
As the simulation is run, the first Vuser takes the first three values (because this was the number of
iterations). The second Vuser takes the next three values. The third Vuser takes the remaining
value in the first iteration. For the remaining iterations, since the When out of values option in the
Parameter List dialog box was set to Continue with last value, the third Vuser continues with the
same value.
A fourth Vuser would have failed.
Scenario run mode: Run indefinitely
HP LoadRunner (12.00)
Page 437 of 1743
LoadRunner User Guide
Script Workflow
In the following example, the user has selected 3 Vusers and set the Scenario run mode to Run
indefinitely and selected to show 3 iterations.
When the Scenario run mode is set to Run indefinitely, the allocated range for each Vuser is
calculated by dividing the number of cells in the .dat file by the number of Vusers. In this scenario,
that is 7/3 = 2 (The simulator takes the closest smaller integer.).
As the simulation is run, the first Vuser takes Value1 and Value2. The second Vuser takes Value3
and Value4 and the third Vuser takes Value5 and Value6. Since there are were only 3 Vusers,
Value7 was not distributed.
Note: If you hold the mouse over the cells in the first column of the table, a tool tip appears with
information about which values were assigned to that Vuser.
If you hold the mouse over cells which were not assigned values, a tool tip appears with the
reason no values were assigned.
A tool tip does not appear if a proper value was assigned.
HP LoadRunner (12.00)
Page 438 of 1743
LoadRunner User Guide
Script Workflow
Parameter List Dialog Box
This dialog box enables you to view, create, delete, select, and modify parameters. The Parameter
list shows all of the parameters that you created, including both input and output parameters.
To access
Use one of the following:
l
VuGen > Solution Explorer pane > > Parameters node >
Parameter List
l
In the script editor, right-click on a value > Replace with Parameter>
Parameter List
l
VuGen > Design > Parameters > Parameter List
Important
information
Do not name a parameter unique, since this name is used by VuGen.
See also
"Parameter Properties Dialog Box" on page 426
User interface elements are described below (unlabeled elements are shown in angle brackets):
UI Element
Description
Creates a new parameter. This does not replace any highlighted text with the
parameter. Do not name a parameter unique, since this name is used by
VuGen.
Deletes the selected parameter.
Note: If the parameter replaced a previous value, the original value is restored.
HP LoadRunner (12.00)
Page 439 of 1743
LoadRunner User Guide
Script Workflow
<Parameter
Properties
Pane>
Parameter
type
This pane appears different depending on the type of parameter you are using.
For information about this pane, see one of the following sections:
l
For Date/Time, Group Name, Iteration Number, Load Generation Name, and
Vuser ID parameters see "Parameter Properties Dialog Box" on page 426.
l
For File parameters, see "Parameter Properties Dialog Box" on page 426.
l
For Table parameters, see "Parameter Properties Dialog Box" on page 426.
l
For BPT parameters, see "Parameter Properties Dialog Box" on page 426.
l
For Random Number parameters, see "Parameter Properties Dialog Box"
on page 426.
l
For Unique Number parameters, see "Parameter Properties Dialog Box" on
page 426.
l
For User Defined Function parameters, see "Parameter Properties Dialog
Box" on page 426.
l
For XML parameters, see "Parameter Properties Dialog Box" on page 426.
This drop-down list lets you select the parameter type. For information about
the different parameter types, see "Parameter Types" on page 410.
Database Query Wizard
This wizard enables you to select data for a parameter form an existing database.
To
access
VuGen > Right-click parameter > Parameter properties > Data Wizard (only
available for File / Table type parameters)
Relevant
tasks
"How to Import Parameter Data from a Database" on page 424
User interface elements are described below:
UI Element
Description
Query Definition
Select from one of the following options:
l
Create query using Microsoft Query
l
Specify SQL statement manually
Show me how to use
Microsoft Query
Displays instructions for using Microsoft Query when after you
click next.
Maximum number of rows
The maximum number of rows to be created in the .dat file based
on the specified query.
HP LoadRunner (12.00)
Page 440 of 1743
LoadRunner User Guide
Script Workflow
Create Parameter Dialog Box (Winsock)
This dialog box enables you to correlate data and create parameters in Winsock scripts.
To access
VuGen > Step Navigator > Right-click menu > Create Parameter
User interface elements are described below:
UI Element
Description
Parameter
Name
The name of the parameter.
Data Range You can define the parameter by a start and end range in bytes. Enter the numbers
manually in the From and To fields or click Select Range and highlight the
desired text.
Boundaries You can define the parameter by defining a left and right boundary. To do so,
select Extract parameter data using boundaries. Click the button to right of the
Left field, highlight the desired text, and click Done. Repeat the procedure for the
Right boundary.
Script
Statement
The statement that will appear in your script based on the options selected in this
dialog box. You can manually edit this statement.
Parameter Original Value Dialog Box
This dialog box appears when you are parameterizing a Vuser script, and lets you specify the
parameter's original value.
To access
In VuGen, select a text string in the Editor. Right-click and then select Replace
with Parameter > Parameter List. Select an existing parameter and click Close.
Important
Each parameter has an original value. You can replace any parameter in a Vuser
information script with the parameter's original value. When you parameterize a selected text
string and the selected text string is not the same as the selected parameter's
original value, you can select to either keep the parameter's existing original
value, or replace the parameter's original value with the selected text string.
User interface elements are described below:
UI Element
Description
Use old original value <text>
Keeps the parameter's existing original value.
Use new original value
<text>
Assigns the selected text as the parameter's new original
value.
HP LoadRunner (12.00)
Page 441 of 1743
LoadRunner User Guide
Script Workflow
Parameters - Troubleshooting and Limitations
This section describes troubleshooting and limitations for parameters.
Function Argument Limitations
You can use parameterization only for the arguments within a function. You cannot parameterize
text strings that are not function arguments. In addition, not all function arguments can be
parameterized. For details on which arguments you can parameterize, see the Function Reference
(Help > Function Reference) for each function.
For example, consider the lrd_stmt function. The function has the following syntax:
lrd_stmt (LRD_CURSOR FAR *mptCursor, char FAR *mpcText, long mliTextLen, LRDOS_I
NT4 mjOpt1, LRDOS_INT4 mjOpt2, int miDBErrorSeverity);
The indicates that you can parameterize only the mpcText argument.
A recorded lrd_stmt function could look like this: lrd_stmt(Csr4, "select name from sysobjects where name =\"Kim\" ", -1, 148, -999
99, 0);
You could parameterize the recorded function to look like this:
lrd_stmt(Csr4, "select name from sysobjects where name =\"<name>\" ", -1, 148, 99999, 0);
Note: You can use the lr_eval_string function to "parameterize" a function argument that you
cannot parameterize by using standard parameterization. In addition, you can use the lr_eval_
string function to "parameterize" any string in a Vuser script.
For VB, COM, and Microsoft .NET protocols, you must use the lr.eval string function to define a
parameter. For example,
lr.eval_string("{Custom_param}").
For more information on the lr_eval_string function, see the Function Reference.
Data Table File Size Limitations
If .dat file's size is over 100MB, a message is displayed that the file is too big and will not be
displayed.
If you need to load a file over 100MB, you can change "MaxParametersDisplaySize" parameter in
vugen.ini:
[ParamTable]
MaxParametersDisplaySize=100000000
Async Studio
HP LoadRunner (12.00)
Page 442 of 1743
LoadRunner User Guide
Script Workflow
Synchronous and Asynchronous Concepts
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
Original web applications communicated using conversations that had a synchronous nature. A
typical synchronous conversation includes the following steps:
1. The user interacts with an application that is presented in a web browser.
2. Based on the user input, the browser submits a request to the web server.
3. The server sends a response to the request, and the application in the browser is updated.
Synchronous applications have a number of limitations. One limitation involves the updating of the
data that is displayed in the application inside the browser. For example, consider an application
that displays stock prices of a number of shares. Ideally, the application should be able to update
the display of the stock prices as soon as the prices are updated on the web-server. A synchronous
application would be able to update the prices on a fixed time interval. For example, every 10
seconds, the browser could sent a request to the server for the most up-to-date stock prices. One
limitation of this solution is that the displayed stock prices may be out-of-date for a period of time
before the refresh interval is reached. Although this may not be critical in our share portfolio
scenario, the scenario illustrates the limitation of a synchronous application to timeously update
information.
Where necessary, synchronous applications are being replaced with what are known as
asynchronous applications. Asynchronous applications enable a client to be notified whenever an
event occurs on the server side. Asynchronous applications are therefore better able to update
information as required.
In order to enable asynchronous behavior, asynchronous communication occurs in parallel
(simultaneously) with the main, synchronous flow of the business processes. This behavior makes
asynchronous applications harder to accurately emulate using traditional synchronous Vuser
scripts.
Although there are numerous types of asynchronous applications, there are three primary types:
push, poll, and long-poll. For details, see "Types of Asynchronous Communication" below.
For an introduction to using asynchronous communication in Vuser scripts, see "LoadRunner
Support for Asynchronous Communication - Overview" on page 446.
Types of Asynchronous Communication
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
Asynchronous request and response sequences
HP LoadRunner (12.00)
Page 443 of 1743
LoadRunner User Guide
Script Workflow
Asynchronous communication is comprised of various request and response sequences. Such
request and response sequences can be classified as one of three types of asynchronous
communication: poll, push, and long-poll. When you develop a Vuser script, it is often useful to
know the types of asynchronous communication that are implemented when the required business
processes are performed.
Polling Asynchronous Communication
The browser sends HTTP requests to the server at regular intervals, for example, every 5 seconds.
The server responds with updates. This enables the system to intermittently update the application
interface inside the browser. If the server has no update, it informs the application that there is no
update, based on the application protocol.
Long-Polling Asynchronous Communication
The client generates an HTTP request to a known address on the server. Whenever the server has
an update, it responds with an HTTP response. Immediately after receiving the server response,
the client issues another request.
HP LoadRunner (12.00)
Page 444 of 1743
LoadRunner User Guide
Script Workflow
Push Asynchronous Communication
The client opens a connection with the server by sending a single HTTP request to a known
address on the server. The server then sends a response that appears to never end, so that the
client never closes the connection. Whenever necessary, the server sends a “sub message” update
to the client over the open connection. The server may or may not terminate this connection. During
the time the connection is open, if the server has no real update to send, it sends "ping" messages
to the client to prevent the client from closing the connection for timeout reasons.
Note that push-type conversations are supported for Web (HTTP/HTML) protocol actions
inside Web (HTTP/HTML), Flex, Silverlight, and Web Services Vuser scripts, NOT for Flex_
amf_call steps in Flex Vuser scripts.
HP LoadRunner (12.00)
Page 445 of 1743
LoadRunner User Guide
Script Workflow
LoadRunner Support for Asynchronous
Communication - Overview
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
Web-based applications can exhibit synchronous behavior, asynchronous behavior, or a
combination of both. For an introduction to these behavior types, see "Synchronous and
Asynchronous Concepts" on page 443. LoadRunner enables you to build and run Vuser scripts that
emulate user activity for both synchronous and asynchronous applications. To build a Vuser script
for a synchronous application, follow the typical LoadRunner Vuser script building process.
However, to build a script for an asynchronous application, you must perform some additional tasks
- beyond the typical LoadRunner Vuser script building process. If you record and generate a script
for an application that performs asynchronous behavior - without performing the additional
asynchronous-related tasks, the script may not run successfully.
Building a Vuser script for an asynchronous application begins with recording the business
processes that produce the asynchronous communication. After the business processes are
recorded and the Vuser script is generated, VuGen scans the generated Vuser script and attempts
to locate the asynchronous communication. If asynchronous communication is detected, VuGen
modifies the script - inserting the appropriate asynchronous API functions.
HP LoadRunner (12.00)
Page 446 of 1743
LoadRunner User Guide
Script Workflow
Identifying Asynchronous Conversations
In order for VuGen to be able to successfully identify the asynchronous behavior in a Vuser script,
the asynchronous communication must contain at least the required minimum number of request
and response sequences.
l
Identifying a poll-type conversation
To enable VuGen to successfully identify a poll conversation, the recorded Vuser script must
contain at least 3 sequences with matching URLs and similar polling intervals.
l
Identifying a long-poll type conversation
To enable VuGen to successfully identify a long-poll conversation, the recorded Vuser script
must contain at least 3 sequences with matching URLs.
Note: VuGen will scan a script for asynchronous communication only if the Async Scan
recording option is selected. For details, see "How to Create an Asynchronous Vuser Script"
on the next page.
In some scenarios, the modifications that VuGen makes to the Vuser script are sufficient to enable
the script to run and emulate the required asynchronous behavior. In other scenarios, additional
"manual" modifications are required. For details, see "How VuGen Modifies a Vuser Script for
Asynchronous Communication" on page 451.
Note: the modifications that must be made to a generated Vuser script to enable the script to
emulate asynchronous behavior are dependent on the type of the asynchronous behavior:
push, polling, or long-polling. For details, see "Types of Asynchronous Communication" on
page 443.
Asynchronous communication in a Vuser script is divided into one or more conversations. The
individual asynchronous conversations that VuGen detects in a Vuser script are listed in the Async
tab of the Design Studio. Use this list of asynchronous conversations to systematically analyze
the modifications that VuGen made to the Vuser script to make sure that VuGen has correctly
identified the asynchronous behavior, and correctly modified the Vuser script to emulate the
required asynchronous behavior. For details on the Async tab of the Design Studio, see "Async
Tab [Design Studio]" on page 471.
After modifying a Vuser script to enable it to emulate asynchronous communication, it may be
necessary to perform correlation activities on the modified script. For details about correlation, see
"Correlating Asynchronous Vuser Scripts" on page 459.
Note: Async functionality is not supported when you replay a Vuser script in WinINet mode.
For details on how to build a Vuser script for an application that utilizes asynchronous
communication, see "How to Create an Asynchronous Vuser Script" on the next page.
HP LoadRunner (12.00)
Page 447 of 1743
LoadRunner User Guide
Script Workflow
How to Create an Asynchronous Vuser Script
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
To build a Vuser script for an asynchronous application, perform the following:
Create a new Vuser script
1. Click the New Script button on the VuGen toolbar.
2. Select Web - HTTP/HTML, or one of the other Vuser protocols that support asynchronous
communication.
3. Click Create. VuGen creates a basic Vuser script.
Enable Async Scan
1. Select Record > Recording Options.
2. Under General, select Code Generation.
3. Make sure that the Async Scan check box is selected. This instructs VuGen to scan the
Vuser script after recording, locate asynchronous communication, and insert the appropriate
asynchronous functionality.
Record the business processes using the typical VuGen recording
process
1. Click Record on the VuGen toolbar.
2. Enter the required information in the Start Recording dialog box, and then click Start
Recording.
3. Perform the business processes that the Vuser will emulate, and then click Stop Recording
on the floating toolbar.
Note that in order for VuGen to be able to successfully identify the asynchronous behavior
in a Vuser script, the asynchronous communication must contain at least the required
minimum number of client requests and server responses. For details, see "Types of
Asynchronous Communication" on page 443.
Generate, scan, and modify the Vuser script
1. After you click Stop Recording, VuGen generates the Vuser script.
HP LoadRunner (12.00)
Page 448 of 1743
LoadRunner User Guide
Script Workflow
2. After generating the script, VuGen scans the generated script to locate instances of
asynchronous communication.
3. If VuGen locates any instances of asynchronous communication, VuGen will modify the script
to enable the script to run and emulate the asynchronous behavior. For details, see "How
VuGen Modifies a Vuser Script for Asynchronous Communication" on page 451.
4. The Design Studio opens. Click the Async tab. The Async tab displays a list of all instances
of asynchronous communication that VuGen located in the Vuser script.
Review the modifications that VuGen made to the script
For each asynchronous conversation that appears in the Async tab of the Design Studio, perform
the following tasks:
1. Open the Vuser script in the Editor.
2. Locate the web_reg_async_attributes step that starts the asynchronous conversation.
Ensure that the web_reg_async_attributes step is located at the start of the asynchronous
conversation.
3. Make sure that the URL parameter in the web_reg_async_attributes step is the same as one
of the URLs that are specified in the action step that follows the web_reg_async_attributes
step.
For details on the web_reg_async_attributes step, see "Defining the Start of an
Asynchronous Conversation" on page 454.
4. Notice that the step comment before the web_reg_async_attributes step contains a TODO
token. The TODO token indicates that you should check the relevant callback implementations
in the AsyncCallbacks.c extra file.
5. Locate the web_stop_async step that ends the asynchronous conversation. Ensure that the
web_stop_async step is located at the end of the asynchronous conversation.
6. Make sure that the web_stop_async step runs as required. For details, see "Fine-Tuning the
End of an Asynchronous Conversation" on page 458.
For details on the web_stop_async step, see "Defining the End of an Asynchronous
Conversation" on page 456.
7. Review the callback implementation and make modifications to the script as required. For
details, see "Implementing Callbacks" on page 459.
8. Make sure that all counter and complex string parameters are set correctly. Notice that for
each such parameter, a TODO comment exists and has a matching task in the Tasks pane.
For details, see "Parsing URLs" on page 466.
9. Check the Tasks pane for specific actions that are required in order to complete the script
development process. Such actions may include verifying callback implementations, or
HP LoadRunner (12.00)
Page 449 of 1743
LoadRunner User Guide
Script Workflow
verifying the implementation of specific parameters.
10. Once all parameters are initialized correctly, run the script to make sure that the asynchronous
conversation runs as expected.
Note: Async functionality is not supported when you replay a Vuser script in WinINet mode.
Once you have reviewed the modified script and made sure that the asynchronous communication
has been implemented correctly, run the script. For details, see Enabling Asynchronous Scripts to
Run.
Asynchronous Communication API
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
The LoadRunner API includes several functions that enable Vuser scripts to emulate asynchronous
communication. These asynchronous communication functions are:
web_reg_async_attributes
This function registers the next action function as the beginning of an asynchronous conversation,
and defines the behavior of the asynchronous communication.
web_stop_async
This function cancels the specified asynchronous conversation, including all its active and future
tasks.
web_sync
This function suspends the Vuser script execution until the specified parameter is defined.
web_util_set_request_url
This function sets the specified string to be the request URL for the next request sent in the
conversation. This is applicable only when called from a callback.
web_util_set_request_body
This function sets the specified string to be the request body for the next request sent in the
conversation. This is applicable only when called from a callback.
web_util_set_formatted_request_body
This function is similar to the web_util_set_request_body function. However, this function is
included as part of a Flex protocol asynchronous conversation instead of a Web(HTTP/HTML)
protocol asynchronous conversation. This function expects an XML formatted request body, which
will be converted before the request is sent.
For details on the asynchronous API functions, see the Function Reference (Help > Function
Reference).
HP LoadRunner (12.00)
Page 450 of 1743
LoadRunner User Guide
Script Workflow
The web_reg_async_attributes function should be called before the step that starts the
asynchronous conversation. The web_reg_async_attributes function receives a number of
arguments that define the asynchronous conversation. One of these arguments is the URL of the
asynchronous conversation. As soon as the replay engine downloads this URL in the step that
follows the web_reg_async_attributes function, the asynchronous conversation begins. The
callbacks that are registered in the web_reg_async_attributes function enable the script developer
to control some of the characteristics of the asynchronous conversation (for example, to change the
URL). The asynchronous conversation continues until the web_stop_async step, or until the end of
the iteration. In a push-type conversation, the server may close the connection and thereby end the
conversation.
Note: Async functionality is not supported when you replay a Vuser script in WinINet mode.
For details on how the asynchronous functions differ from synchronous functions, see "How
Asynchronous Functions Differ from Synchronous Functions" below.
How Asynchronous Functions Differ from
Synchronous Functions
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
The LoadRunner API includes several functions that enable Vuser scripts to emulate asynchronous
communication. These asynchronous functions differ from the other API functions in the following
ways:
1. The network traffic that the asynchronous functions generate runs in parallel – simultaneously
– with the main flow in the Vuser script. This means that the asynchronous communication can
continue even when the synchronous steps end.
2. The asynchronous communication continues even during execution of non-web functions (e.g.
lr_think_time).
3. Some of the asynchronous communication API functions use callback functions. The user
needs to specify callbacks that are scheduled by the replay engine when a predefined event
occurs. For details on using callbacks with asynchronous functions, see "Implementing
Callbacks" on page 459.
How VuGen Modifies a Vuser Script for
Asynchronous Communication
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
HP LoadRunner (12.00)
Page 451 of 1743
LoadRunner User Guide
Script Workflow
After you create a Vuser script and record the required business processes, VuGen generates the
Vuser script. VuGen then scans the generated script to locate instances of asynchronous
communication. This process is called an Async scan. If VuGen locates any instances of
asynchronous communication in the Vuser script, VuGen modifies the script to enable the script to
run and emulate the required asynchronous behavior.
Note: VuGen will scan a script for asynchronous communication only if the Async Scan
recording option is selected. For details, see "How to Create an Asynchronous Vuser Script"
on page 448.
Asynchronous communication in a Vuser script is divided into one or more conversations. The
individual asynchronous conversations that VuGen detects in a Vuser script are listed in the Async
tab of the Design Studio. Use this list of asynchronous conversations to systematically analyze
the modifications that VuGen made to the Vuser script during the Async scan. Make sure that
VuGen has correctly identified the asynchronous behavior in the Vuser script, and correctly
modified the Vuser script to emulate the required asynchronous behavior. For details on the Async
tab of the Design Studio, see "Async Tab [Design Studio]" on page 471.
Note: After modifying a Vuser script to enable it to emulate asynchronous communication, it
may be necessary to perform correlation activities on the modified script. For details about
correlation, see "Correlating Asynchronous Vuser Scripts" on page 459.
How does VuGen modify a Vuser script?
Asynchronous behavior in a Vuser script is divided into one or more asynchronous conversations.
For each asynchronous conversation, VuGen performs the following tasks:
1. VuGen inserts a web_reg_async_attributes step before the start of the asynchronous
conversation. The web_reg_async_attributes step includes an ID for the asynchronous
conversation. This ID is used by a subsequent web_stop_async step to indicate the end of the
asynchronous conversation. The Pattern argument indicates the type of the asynchronous
behavior: push, poll, or long-poll.
web_reg_async_attributes("ID=Push_0",
"Pattern=Push",
"URL=http://push.example.com/example",
"RequestCB=Push_0_RequestCB",
"ResponseHeadersCB=Push_0_ResponseHeadersCB",
"ResponseBodyBufferCB=Push_0_ResponseBodyBufferCB",
"ResponseCB=Push_0_ResponseCB",
HP LoadRunner (12.00)
Page 452 of 1743
LoadRunner User Guide
Script Workflow
LAST);
For details on how a web_reg_async_attributes step is used at the start of an asynchronous
conversation, see "Defining the Start of an Asynchronous Conversation" on the next page.
For details on the web_reg_async_attributes function, see the Function Reference (Help >
Function Reference).
For details on the types of asynchronous behavior that are supported by LoadRunner, see
"Types of Asynchronous Communication" on page 443.
2. VuGen adds a comment before the inserted web_reg_async_attributes step. The comment
includes details about the asynchronous conversation, including:
a. The ID of the asynchronous conversation.
b. The URLs that are included in the conversation.
c. Suggested implementations for the callback functions that are declared in the web_reg_
async_attributes step. These implementations are added in AsyncCallbacks.c, one of the
script’s extra files.
/* Added by Async CodeGen.
ID=Push_0
ScanType = Recording
The following URLs are considered part of this conversation:
http://push.example.com/example
TODO - The following callbacks have been added to AsyncCallbacks.c.
Add your code to the callback implementations as necessary.
Push_0_RequestCB
Push_0_ResponseHeadersCB
Push_0_ResponseBodyBufferCB
Push_0_ResponseCB
*/
3. For push conversations, VuGen inserts asynchronous API functions into the Vuser script, but
HP LoadRunner (12.00)
Page 453 of 1743
LoadRunner User Guide
Script Workflow
does not remove any of the recorded code from the Vuser script. For polling and long-polling
conversations, VuGen may remove steps or step parameters from the generated Vuser script.
VuGen removes steps or step parameters in cases where the relevant URLs will be requested
by running the inserted asynchronous functions - and not by running the original steps that have
been removed.
Note: Removed steps are not deleted – they are commented out. You can "uncomment"
these steps if required.
4. When relevant, VuGen adds a web_stop_async step at the end of the asynchronous
conversation. The web_stop_async step marks the end of the asynchronous conversation.
For details on the web_stop_async step, see the Function Reference (Help > Function
Reference).
5. The recording snapshots are updated by grouping the tasks in the asynchronous conversation
under the step that started the conversation.
How VuGen modifies flex_amf_call steps
VuGen supports asynchronous polling and long-polling behavior in flex_amf_call steps. Flex
scripts that contain polling or long-polling in flex_amf_call steps are handled by VuGen just like
Web(HTTP/HTML) scripts, except for the following:
l
The RequestCB will contain a commented call to web_util_set_formatted_request_body,
which can be used to pass an XML formatted request body, which will be encoded and sent with
the request.
l
The aResponseBodyStr and aResponseBodyLen parameters of the ResponseCB give user
access to the XML representation of the response body.
Defining the Start of an Asynchronous Conversation
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
After VuGen scans a Vuser script for asynchronous communication, the Async tab of the Design
Studio lists the asynchronous conversations that VuGen found in the script. VuGen inserts a web_
reg_async_attributes into the Vuser script at the start of each asynchronous conversation that
was detected. Use VuGen's Step Navigator to find the associated web_reg_async_attributes
steps in the Vuser script. The web_reg_async_attributes steps should be located where the
asynchronous conversations start when the script runs.
A web_reg_async_attributes step that is added to a Vuser script includes the following
parameters:
HP LoadRunner (12.00)
Page 454 of 1743
LoadRunner User Guide
Script Workflow
l
ID
l
URL
l
Pattern
l
PollIntervalMS (for poll-type conversations only)
l
RequestCB
l
ResponseBodyBufferCB (for push-type conversations only)
l
ResponseHeadersCB (for push-type conversations only)
l
ResponseCB
The URL parameter in the web_reg_async_attributes step should be the same as one of the URLs
that are specified in the step that follows the web_reg_async_attributes step. For details on the
web_reg_async_attributes step, see the Function Reference (Help > Function Reference).
Inserting a Comment
When VuGen inserts a web_reg_async_attributes step into a script, VuGen inserts an associated
comment before the web_reg_async_attributes step. The inserted comment contains information
about the associated asynchronous conversation, such as the conversation ID, the communication
pattern (push, poll, or long-poll), a list of URLs that are part of the asynchronous communication,
and list of callbacks implemented in the AsyncCallbacks.c extra file.
Notice that the step comment contains a TODO token. The TODO token indicates that you should
check the relevant callback implementations in the AsyncCallbacks.c extra file.
For details on how an asynchronous conversation is terminated, see "Defining the End of an
Asynchronous Conversation" on the next page.
Example - web_reg_async_attributes
The sample code below shows a web_reg_async_attributes step that was added by VuGen.
Notice that the web_reg_async_attributes step was added before a web_url step, and that the
URL parameter in the web_reg_async_attributes step is the same as the URL parameter in the
web_url step.
HP LoadRunner (12.00)
Page 455 of 1743
LoadRunner User Guide
Script Workflow
Defining the End of an Asynchronous Conversation
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
After VuGen scans a Vuser script for asynchronous communication, the Async tab of the Design
Studio lists the asynchronous conversations that VuGen found in the script. A web_stop_async
step is inserted into the Vuser script at the end of each asynchronous conversation that was
detected. Use VuGen's Step Navigator to find the associated web_stop_async steps in the Vuser
script.
Note: In some cases VuGen will not add a web_stop_async step at the end of an
asynchronous conversation. This may occur when VuGen is not able to determine where the
asynchronous conversation ends. This can occur when the asynchronous conversation was
added due to a specific Async rule or when the asynchronous conversation was not ended
during the recording. For details on Async rules, see "Async Rules - Overview" on page 468.
After VuGen has inserted a web_stop_async step into a Vuser script, make sure the web_stop_
async step was added in the correct location in the script, that is – where the asynchronous
conversation should end when the Vuser script runs.
In order to make sure the asynchronous conversation ends correctly when the script runs, it may be
necessary to modify the details of the web_stop_async step in the Vuser script. For details, see
"Fine-Tuning the End of an Asynchronous Conversation" on page 458.
HP LoadRunner (12.00)
Page 456 of 1743
LoadRunner User Guide
Script Workflow
Note: All Async conversations are automatically terminated at the end of each iteration even if
the Simulate a new user each iteration run-time option is disabled.
For details on how an asynchronous conversation is started, see "Defining the Start of an
Asynchronous Conversation" on page 454.
Example - web_stop_async:
In the code sample below, VuGen added a web_stop_async step at the end of a poll conversation.
In this example, the original polling steps are commented out, and the lr_think_time steps that
separated them have been merged into one lr_think_time step in order to emulate the duration of
the entire poll conversation.
Using Asynchronous Request Thresholds
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
You can fine-tune some of VuGen's behavior when VuGen scans a Vuser script to locate
asynchronous communication. You use VuGen's asynchronous request thresholds to fine-tune
VuGen's behavior. Each of the thresholds is associated with only one of the types of asynchronous
conversations: push, poll, or long-poll.
l
Asynchronous request thresholds for push conversations
HP LoadRunner (12.00)
Page 457 of 1743
LoadRunner User Guide
Script Workflow
Minimum Response Size. Specify the minimum response content length (in bytes) for defining
push asynchronous conversations. If the server sent less than the specified value, VuGen will
not classify the conversation as a push-type asynchronous conversation.
Maximum Sub Message Size. Specify the maximum sub message size (in bytes) sent by the
server for defining push asynchronous conversations. If the server sent a sub message of size
greater than the specified value, VuGen will not classify the conversation as a push-type
asynchronous conversation.
Minimum Number of Sub Messages. Specify the minimum number of sub messages for
defining push asynchronous conversations. A push conversation in which less than the
specified number of sub messages was sent by the server will not be classified by VuGen as a
push-type asynchronous conversation.
l
Asynchronous request thresholds for poll conversations
Interval Tolerance. Specify the interval tolerance (in milliseconds) for classifying poll
asynchronous conversations. A conversation in which intervals differ from each other by more
than the specified value will not be classified by VuGen as a poll-type asynchronous
conversation.
l
Asynchronous request thresholds for long-poll conversations
Maximum Interval. Specify the maximum interval (in milliseconds) between the end of one
response and the start of a new request for classifying long-poll asynchronous conversations. A
conversation in which a request starts more than the specified value after the end of the previous
response will not be classified by VuGen as a long-poll type asynchronous conversation.
For details on the available asynchronous request thresholds, see "Asynchronous Options Dialog
Box" on page 473.
Fine-Tuning the End of an Asynchronous
Conversation
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
After VuGen scans a Vuser script for asynchronous communication, the Async tab of the Design
Studio lists the asynchronous conversations that were found in the script. A web_stop_async step
is inserted into the Vuser script at the end of each asynchronous conversation that was detected. In
order to make sure that each asynchronous conversation ends correctly when the script runs, it
may be necessary to perform one or more of the following tasks:
l
Remove the web_stop_async step so that the asynchronous conversation will be terminated at
the end of the iteration.
HP LoadRunner (12.00)
Page 458 of 1743
LoadRunner User Guide
Script Workflow
l
Move the web_stop_async step to a location that is after an existing action step or an existing
lr_think_time step, so the asynchronous conversation will end after that step is performed.
l
Add an lr_think_time step before the web_stop_async step, or change the time parameter in
an existing lr_think_time step. Make sure that think-time is enabled in the Run-Time Settings.
For details, see "General > Think Time Node" on page 350.
l
Add a web_sync step to stop the asynchronous conversation after a specified parameter
receives a value. Use the asynchronous conversation callbacks to make sure the parameter
receives a value only when you want to end the conversation.
Correlating Asynchronous Vuser Scripts
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
After modifying a Vuser script to enable it to emulate asynchronous communication, it may be
necessary to perform correlation activities on the modified script. Due to asynchronous nature,
dynamic values from asynchronous communication cannot be handled by Design Studio, and must
be correlated manually.
You can search for dynamic values inside Response callbacks functions using the lr_save_
param_regexp function. This function can be called from a callback to extract the necessary value
from server response (ResponseCB) or response buffer (ResponseBodyBufferCB), and assign
this value to a parameter. This parameter can then be used for correlations.
For details about the lr_save_param_regexp function, see the Function Reference (Help >
Function Reference).
Implementing Callbacks
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
After VuGen scans a Vuser script for asynchronous communication, the Async tab of the Design
Studio lists the asynchronous conversations that were found in the script. For each asynchronous
conversation found during the scan, VuGen adds the callback function signatures matching those
declared in the web_reg_async_attributes step. The signatures are added to the
AsyncCallbacks.c extra file.
The available callbacks are:
1. RequestCB
This callback is called before a request is sent.
2. ResponseBodyBufferCB
HP LoadRunner (12.00)
Page 459 of 1743
LoadRunner User Guide
Script Workflow
This callback is called when there is content in the response body buffer and at the end of the
response body. This callback is generated by VuGen automatically for push-type
conversations, but is available for poll and long-poll conversations as well.
3. ResponseCB
This callback is called after every response is received in the conversation.
l
The names of the callback functions start with the conversation ID of the asynchronous
conversation. For example, the RequestCB callback for an asynchronous conversation with ID
“LongPoll_0” will be LongPoll_0_RequestCB.
l
The names of the callback functions are declared in the web_reg_async_attributes step in the
script.
Example 1:
In the following sample code, the three callback functions are declared in the web_reg_async_
attributes step.
Example 2:
In the following sample code, the two callbacks are implemented in the AsyncCallbacks.c extra
file.
HP LoadRunner (12.00)
Page 460 of 1743
LoadRunner User Guide
Script Workflow
You can modify the callbacks to implement the required behavior. For details, see "Modifying
Callbacks" on the next page.
Example 3:
The following sample code shows an implementation of the ResponseHeader callback function,
including the three arguments: HTTP Status code, Accumulated headers string and Accumulated
headers string length.
int Push_0_ResponseHeadersCB(
int aHttpStatusCode,
const char * aAccumulatedHeadersStr,
int aAccumulatedHeadersLen)
{
//Enter your implementation for ResponseHeadersCB() here.
lr_output_message("Response status code is :[%d]", aHttpStatusCode);
lr_output_message("Response headers are :/n[%s]", aAccumulatedHeadersStr);
return WEB_ASYNC_CB_RC_OK;
HP LoadRunner (12.00)
Page 461 of 1743
LoadRunner User Guide
Script Workflow
}
A sample of the output from the above callback function is shown below:
Response status code is :[200]
Response headers are :
[HTTP/1.1 200 OK
Connection: close
Date: Tue, 25 Jun 2013 09:03:33 GMT
Server: Microsoft-IIS/6.0
Content-Type: text/html
Cache-control: private]
Modifying Callbacks
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
After VuGen scans a Vuser script for asynchronous communication, the Async tab of the Design
Studio lists the asynchronous conversations that were found in the script. For each asynchronous
conversation found during the scan, VuGen adds the required callback function declarations in the
AsyncCallbacks.c file. To implement the required behavior, you can modify the callbacks that
were added by VuGen. Modifying a callback includes:
Modifying the request URL in the RequestCB callback
In poll and long-poll conversations, requested URLs often change in each polling iteration. The
change is usually determined by client-side logic, usually implemented by JavaScript that is
executed by the browser. Parts of the URL may be determined by correlation of a known parameter,
such as a session ID. For details, see "Parsing URLs" on page 466.
Request URLs in an asynchronous conversation will be modified before the request is sent by
using the RequestCB and the web_util_set_request_url function.
HP LoadRunner (12.00)
Page 462 of 1743
LoadRunner User Guide
Script Workflow
Modifying the request body in the RequestCB callback
The request body in requests that are part of an asynchronous conversation may need to be
modified before the request is sent. You use the RequestCB and the web_util_set_request_body
util function to modify the request body.
Modifying the request body is useful in poll and long-poll conversations in which each new request
requires a different request body.
Each RequestCB that is generated by VuGen contains a commented snippet. You can
"uncomment" the snippet in order to use the web_util_set_request_body util function.
If VuGen finds that different requests have different body values in the recorded conversation, the
generated RequestCB will contain a comment that prompts you to check the recording in order to
implement the request body sent in each request when the script runs.
Modifying the response in the ResponseCB callback
You can modify the response callback in an asynchronous conversation to verify validity of the
responses, or to wait for a specific event. For example, you could check the response headers for
each response to determine if a specific value was received.
When the expected value has been received, you can use a web_stop_async step in the Action file
to end the asynchronous conversation.
HP LoadRunner (12.00)
Page 463 of 1743
LoadRunner User Guide
Script Workflow
The following code sample provides an example for ending a synchronized conversation. In this
example, in the AsyncCallback.c file, the scripts counts 10 iterations of the polling conversation,
after which it creates a new parameter, stopAsync.
int Poll_0_ResponseCB(
...{
//increment iteration counter for every response received.
static int iter = 0;
iter++;
//Once the desired number of responses has been reached,
//create and save the parameter.
if (iter > 10) {
lr_save_int(iter, "stopAsync");
}
return WEB_ASYNC_CB_RC_OK;
}
In the Action file, the web_sync step uses the generated parameter, stopAsync, to end the
conversation:
web_reg_async_attributes("ID=Poll_0","Pattern=Poll",
"URL=http://pumpkin:2080/nioamfpoll;AMFSessionId=6F8D6108-E309-38B2-3D65-963B4
31D0A38",
"PollIntervalMs=3000",
"RequestCB=Poll_0_RequestCB",
"ResponseCB=Poll_0_ResponseCB",
LAST);
web_custom_request("nioamfpoll;AMFSessionId=6F8D6108-E309-38B2-3D65-963B431D0A3
8_2",
"URL=http://pumpkin:2080/nioamfpoll;AMFSessionId=6F8D6108-E309-38B2-3D65-963B4
31D0A38",
"Method=POST",
"Resource=0",
"RecContentType=application/x-amf",
"Referer=http://pumpkin:8081/lcds-samples/traderdesktop/traderdesktop.swf/[[DY
NAMIC]]/3",
"Snapshot=t11.inf",
"Mode=HTML",
"EncType=application/x-amf",
"BodyBinary=\\x00\\x03\\x00\\x00\\x00\\x01\\x00\\x04null\\x00\\x02/6\\x00\\x00
\\x00Z\n\\x00\\x00\\x00\\x01\\x11\n\\x07\\x07DSC\\x8D\\x02\n\\x0B\\x01\\x01\\x06
\\x01\n\\x05\tDSId\\x06I6F8D611E-DC1C-9D0C-2BBA-36CC2AB8633B\\x01\\x0C!\\xC0\\xB
E\\xA6Z74\\xBE\\xC3\\xCF\\xC7\\xFA\\xE6\\xC3\t\\xE2\\x92\\x01\\x06\\x01\\x01\\x0
4\\x02",
LAST);
lr_think_time(30);
HP LoadRunner (12.00)
Page 464 of 1743
LoadRunner User Guide
Script Workflow
//suspend the script until the desired number
//of iterations have been performed.
web_sync("ParamCreated=stopAsync", "RetryIntervalMs=1000", "RetryTimeoutMs=30000
0", LAST);
web_stop_async("ID=Poll_0",LAST);
For more details about ending an asynchronous conversation, see "Defining the End of an
Asynchronous Conversation" on page 456.
Modifying callbacks in Flex Vuser scripts
For Flex asynchronous polling and long-polling conversations, the generated RequestCB in the
AsyncCallback.c file contains a call to web_util_set_formatted_request_body, which sets an XML
formatted request body for each request.
web_util_set_formatted_request_body("<AMFPacket AMF_version=\"3\">"
"<AMFHeaders />"
"<Messages>"
"<Message method=\"null\" target=\"/{Target_Poll_0}\">"
…
"</Message>"
"</Messages>"
"</AMFPacket>");
After uncommenting the commented code in the TODO section, and adding your callback code,
open the Script Design Studio to scan for correlations.
Note that code generation automatically parameterizes the Target parameter in the request body. It
also generates code for automatically incrementing this parameter before each polling iteration.
The generated RequestCB also contains a reminder to ensure that the counter initialization
parameter for Target_Poll_0 in the Action file matches the target attribute in the first Message
element in the first polling request.
lr_param_increment("Target_Poll_0", "{Target_Poll_0}");
web_util_set_formatted_request_body("<AMFPacket AMF_version=\"3\">"
"<AMFHeaders />"
"<Messages>"
"<Message method=\"null\" target=\"/{Target_Poll_0}\">"
…
In the Action file, make sure that you initialize the same polling parameter used in
AsyncCallbacks.c. In the following segment from the Action file, the polling parameter, Target_
Poll_0, matches the one used in AsyncCallbacks.c.
/* Initialize target parameter before sending first request. */
/* Notice that parameter will be incremented once before first request. */
lr_save_int(5, "Target_Poll_0");
HP LoadRunner (12.00)
Page 465 of 1743
LoadRunner User Guide
Script Workflow
For more details on using callback functions, see "Implementing Callbacks" on page 459.
Parsing URLs
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
URLs that are included in asynchronous conversations often include query strings that are derived
in a variety of ways. These strings may include:
l
Time-stamps
l
Counters
l
Complex strings
To enable a Vuser script to successfully perform asynchronous communication, VuGen must be
able to recreate the required URLs.
l
When the URL includes a time-stamp, VuGen is usually able to successfully create the required
URL.
l
When the URL includes a counter, VuGen is usually able to recreate the counter, but it may be
necessary to manually initialize the counter in the script.
l
When the URL includes more complex strings, the algorithms for generating the URLs must be
manually added to the code in the Vuser script.
Example:
The sample code below shows a set of URLs that are part of a long-poll conversation. The URLs
are included in the comment generated for a web_reg_async_attributes step:
If none of the parameters shown in the code sample above was found in VuGen's scan of the
recorded Vuser script, the RequestCB implementation will contain a snippet that may be
uncommented in order to set the URL for each response according to user defined code. For
details, see "Modifying Callbacks" on page 462.
HP LoadRunner (12.00)
Page 466 of 1743
LoadRunner User Guide
Script Workflow
If any or all of the parameters shown in the sample code above are found during VuGen's scan of
the recorded Vuser script, the RequestCB implementation will contain the following:
l
A comment prompting the user to call web_util_set_request_url. The comment will contain a
parameterized version of the URL.
l
For each time-stamp parameter found in the URL, a snippet for saving the time-stamp to a
parameter.
l
For each counter parameter found in the URL, a snippet for incrementing a counter parameter. A
matching step for initializing the counter parameter will also be added to the Action file. The
snippet will also contain examples of the URL token containing the counter parameter, as seen
during the recording.
l
For each complex string parameter found in the URL, a snippet for saving the string to a
parameter. It is up to the user to generate the correct string to be saved to the parameter to be
used in the URL. The snippet will also contain examples of the URL token that is considered an
unknown parameter, as seen during the recording.
l
A snippet for passing the parameterized version of the URL to the web_util_set_request_url
function.
Example: A snippet containing the parameterized version of a URL.
Example: A snippet prompting the user to set the value of an unknown parameter.
Example: A snippet for incrementing a counter parameter.
HP LoadRunner (12.00)
Page 467 of 1743
LoadRunner User Guide
Script Workflow
Example: A snippet for initializing a counter parameter.
Example: A snippet for saving a timestamp parameter.
Example: A snippet for passing the parameterized version of a URL to the web_util_set_request_
url function.
Async Rules - Overview
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
In some cases, when VuGen performs an Async scan, VuGen may fail to correctly identify some of
the asynchronous conversations that are included in the Vuser script. In other cases, VuGen may
erroneously classify regular synchronous steps as part of asynchronous conversations. To help
rectify both of these scenarios, you can define Async rules to determine how requests to specified
URLs are classified during an Async scan.
Async rules can be positive or negative.
l
Positive: When VuGen fails to identify asynchronous conversations that are included in a Vuser
script, implement a positive Async rule to enable VuGen to identify the asynchronous behavior.
HP LoadRunner (12.00)
Page 468 of 1743
LoadRunner User Guide
Script Workflow
Scenario: VuGen does not identify URLs under http://www.true-async.com/push_
example.aspx as push asynchronous conversations, and you know that they are part of push
asynchronous conversations. Add a positive rule to enable VuGen to correctly identify the push
asynchronous conversations. When you regenerate the script, the Async scan will apply the
added rule, and all URLs that start with http://www.true-async.com/push_example.aspx will
be included as part of push asynchronous conversations.
l
Negative: When VuGen erroneously classifies regular synchronous steps as part of an
asynchronous conversation, implement a negative Async rule to prevent VuGen from
erroneously identifying asynchronous behavior.
Scenario: VuGen identifies all URLs under http://www.not-async.com/ as asynchronous poll
conversations. You know that these are not asynchronous conversations. Implement a negative
Async rule to prevent VuGen from erroneously identifying asynchronous behavior. When you
regenerate the script, the Async scan will apply the added rule so that all URLs that start with
http://www.not-async.com/ will not be classified as part of asynchronous conversations.
For details on how to implement Async rules, see "Adding Async Rules" below.
Adding Async Rules
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
When VuGen scans a Vuser script after recording or regenerating the script, VuGen may fail to
identify asynchronous conversations that are included in the Vuser script. In other cases, VuGen
may erroneously classify a regular synchronous step as part of an asynchronous conversation.
You can define Async rules that determine how requests to specified URLs will be classified during
an Async scan. Async rules may be positive or negative. This topic describes how to implement
Async rules. For an introduction to Async rules, see "Async Rules - Overview" on the previous
page.
Adding a positive Async rule
1. Select Record > Recording Options > General > Code Generation and then click Async
Options. The Asynchronous Options dialog box opens.
2. Under Asynchronous Regular Expressions, click Add Async Rule
dialog box opens.
. The Add Rule
3. From the Type list, select Push, Poll, or Long Poll, as required.
4. In URL Regular Expression, enter a regular expression for URLs that should be considered
part of asynchronous conversations.
HP LoadRunner (12.00)
Page 469 of 1743
LoadRunner User Guide
Script Workflow
Special characters that you can include in a regular expression:
Note: To include characters such as “?” and “+” in the regular expression, insert a
backslash “\” before the required character.
5. Click OK. The new rule appears in the list of Async rules for the Vuser script.
Note: When you regenerate the script:
- For each push conversation that includes a URL that matches the regular expression, VuGen
inserts asynchronous API functions into the Vuser script, but does not remove any of the
recorded code from the Vuser script.
- For each polling or long-polling conversation that includes a URL that matches the regular
expression, VuGen inserts asynchronous API functions into the Vuser script, and may remove
steps or step parameters from the generated Vuser script. VuGen removes steps or step
parameters in cases where the relevant URLs will be requested by running the inserted
asynchronous functions - and not by running the original steps that have been removed.
For further details, see "How VuGen Modifies a Vuser Script for Asynchronous
Communication" on page 451.
Adding a negative Async rule
HP LoadRunner (12.00)
Page 470 of 1743
LoadRunner User Guide
Script Workflow
1. Select Record > Recording Options > General > Code Generation and then click Async
Options. The Asynchronous Options dialog box opens.
2. Under Synchronous Regular Expressions, click Add Async Rule
Asynchronous Rule dialog box opens.
. The Add
3. From the Rule Type list, select Not Async.
4. In URL Regular Expression, enter a regular expression for URLs that should not be
considered part of asynchronous conversations.
5. Click OK. The new rule appears in the list of Async rules for the Vuser script.
When you regenerate the script, steps that contain URLs that match the regular expression will
not be included in asynchronous conversations.
Async Tab [Design Studio]
The Async tab of the Design Studio lists all the occurrences of asynchronous communication that
VuGen detected in the Vuser script.
To access
Important
information
Relevant
tasks
l
Select Design > Design Studio, and then click the Async tab.
l
Click the
Design Studio button on the VuGen toolbar, and then click the
Async tab.
l
The Design Studio button is enabled only when you display a recorded Vuser
script in the Solution Explorer.
l
The Async tab enables you to only view the asynchronous communication that
is included in the Vuser script - you cannot edit any of the asynchronous details
from the Async tab. Changes to the asynchronous details must be made in the
Vuser script.
"How to Create an Asynchronous Vuser Script" on page 448
User interface elements are described below:
HP LoadRunner (12.00)
Page 471 of 1743
LoadRunner User Guide
Script Workflow
UI Element
Description
Type
Indicates the origin of the asynchronous code in the Vuser script:
Record. The asynchronous code was added by VuGen during an Async scan
that was performed after recording or regenerating the Vuser script.
Rule. The asynchronous code was added by VuGen due to a specific rule in the
Async rules file.
Manual. The asynchronous code was manually added by a user.
Action
The section of the Vuser script in which the asynchronous behavior is located.
Occurrences
l
For push-type conversations, Occurrences is always 1.
l
For poll and long-poll conversations, Occurrences indicates the number of
steps or extra resource attributes that were removed [commented-out] by
VuGen during the Async scan of the Vuser script.
Status
Always has the value Applied.
Async Type
The type of the asynchronous behavior that was detected: Push, Poll, or LongPoll.
URL
The URL in the web_reg_async_attributes step that starts the asynchronous
conversation.
Filter
Select which asynchronous conversations to display in the conversation list.
Details
Expands the dialog box to show details about the selected asynchronous
conversation.
Name
Always has the value web_reg_async_attributes.
Line
The line in the Vuser script that contains the web_reg_async_attributes step.
Action
Name
The section of the Vuser script in which the asynchronous behavior is located.
Description
The comment in the Vuser script that precedes the web_reg_async_attributes
step.
Occurrences
in Snapshot
l
For push-type conversations, displays the response body.
l
For poll and long-poll conversations, displays HTTP attributes associated
with the asynchronous conversation.
Options
Opens the Asynchronous Request Thresholds dialog box.
HP LoadRunner (12.00)
Page 472 of 1743
LoadRunner User Guide
Script Workflow
Asynchronous Options Dialog Box
This dialog box enables you to fine-tune some of VuGen's behavior when VuGen scans a Vuser
script to locate asynchronous communication.
To
access
VuGen > Record > Recording Options > General > Code Generation and then
click Async Options.
User interface elements are described below:
UI Element
Description
Minimum
Response
Size
Specify the minimum size (in bytes) of a server response for defining push
asynchronous conversations. If the server sent less than the specified value,
VuGen will not classify the conversation as a push-type asynchronous
conversation.
Maximum
Sub
Message
Size
Specify the maximum sub message size (in bytes) sent by the server for defining
push asynchronous conversations. If the server sent a sub message of size
greater than the specified value, VuGen will not classify the conversation as a
push-type asynchronous conversation.
Minimum
Number of
Sub
Messages
Specify the minimum number of valid sub messages for defining push
asynchronous conversations. A push conversation in which less than the
specified number of valid sub messages was sent by the server will not be
classified by VuGen as a push-type asynchronous conversation.
Interval
Tolerance
Specify the interval tolerance (in milliseconds) for classifying poll asynchronous
conversations. A conversation in which intervals differ from each other by more
than the specified value will not be classified by VuGen as a poll-type
asynchronous conversation.
Maximum
Interval
Specify the maximum interval (in milliseconds) between the end of one response
and the start of a new request for classifying long poll asynchronous
conversations. A conversation in which a request starts more than the specified
value after the end of the previous response will not be classified by VuGen as a
long-poll type asynchronous conversation.
Asynchronous Rules table
Rule Type
Push, Poll, and Long Poll are positive asynchronous rules. Not Async is a
negative rule. For details on the asynchronous rule types, see "Async Rules Overview" on page 468.
Regular
A regular expression for URLs that should be considered part of asynchronous
Expression conversations. For a list of the special characters that you can include in a regular
expression, see "Adding Async Rules" on page 469.
HP LoadRunner (12.00)
Page 473 of 1743
LoadRunner User Guide
Script Workflow
Asynchronous Example - Poll
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
The following example describes a Vuser script that includes a poll asynchronous conversation.
The application that is emulated by the Vuser is a demo of a “wiki” page. The browser displays the
wiki page, and sends requests to refresh the page at intervals of 5 seconds.
Note: You can modify VuGen's asynchronous request thresholds to assist VuGen in finding
poll-type conversations. For details, see "Using Asynchronous Request Thresholds" on page
HP LoadRunner (12.00)
Page 474 of 1743
LoadRunner User Guide
Script Workflow
457.
The above script was generated by VuGen after the required business processes were recorded.
An asynchronous scan was not performed on the script after the script was generated. Notice that
the script contains a series of web_url functions with a repeating URL, namely:
http://example.com/content.php?messages. These web_url functions are separated by lr_
think_time functions, indicating that the web_url functions repeat at intervals of 4 seconds.
When the Vuser script runs, requests for http://example.com/content.php?messages should be
sent repeatedly until the script is finished. Additionally, these requests should be sent in parallel
(simultaneously) with other actions performed in the Vuser script.
After VuGen performed an asynchronous scan on the script, the script looks as follows:
Notice that a web_reg_async_attributes function has been added to the script before the first
web_url function that calls http://example.com/content.php?messages.
Except for the first call to http://example.com/content.php?messages, all other web_url
functions that call the same URL have been commented-out by VuGen.
Notice that the lr_think_time functions have been merged into one lr_think_time function.
The Snapshot pane for the remaining web_url function shows that the snapshots for the removed
web_url functions now have Origin = Polling, and that they start at intervals of 5 seconds.
HP LoadRunner (12.00)
Page 475 of 1743
LoadRunner User Guide
Script Workflow
Since the requests also have a response time, the think time in lr_think_time functions between
the polling steps in the original script has been rounded down to 4 seconds.
Asynchronous Example - Push
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
The following example describes a Vuser script that is developed to emulate a browser displaying
an application that utilizes push-type asynchronous conversations. The application is a demo of a
“stock quote” page. The browser shows the page with the stock values, and then sends a request
and receives a response with updated stock values. The request remains open until it is closed by
the user. For as long as the page is displayed, the server will continue to send sub-messages as
part of the response - whenever the server has an update for the displayed stocks. Whenever such
a sub-message is received by the client, the client displays the updated stock values.
Note: You can modify VuGen's asynchronous request thresholds to assist VuGen in finding
push-type conversations. For details, see "Using Asynchronous Request Thresholds" on page
457.
If you attempt to run a script that calls a push url - without first performing an asynchronous scan the replay will halt while waiting for the response to the highlighted request. After two minutes,
VuGen will display an error similar to the following, in the Replay log:
Action.c(140): Error -27782: Timeout (120 seconds) exceeded while waiting to
receive data for URL "http://push.example.com" [MsgId: MERR-27782]
The error indicates that the response never finished.
Regenerating the script with Async Scan enabled will create a script similar to the following:
HP LoadRunner (12.00)
Page 476 of 1743
LoadRunner User Guide
Script Workflow
Notice that a web_reg_async_attributes function has been added before the web_url function that
starts the push conversation, and that a web_stop_async function has been added after the last
action step in the script. The script will now run successfully. The push conversation will remain
active – running in parallel with the other script functions – until the web_stop_async function, or
until the end of the script is reached.
Note that during the Async scan, VuGen did not remove (comment-out) any of the generated code
in the Vuser script.
Asynchronous Example - Long-Poll
Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and
Web Services Vuser scripts.
The following example describes a Vuser script that emulates an application that implements a
long-poll asynchronous conversation. The application is a demo of a “chat” page. A browser shows
HP LoadRunner (12.00)
Page 477 of 1743
LoadRunner User Guide
Script Workflow
the chat page, and sends a request that remains open until a new message is sent to the chat by
another user. After such a message is sent:
l
The response is finished.
l
The new message is shown in the browser.
l
The browser sends another request in order to listen for the next message sent to the chat.
Note: You can modify VuGen's asynchronous request thresholds to assist VuGen in finding
long-poll type conversations. For details, see "Using Asynchronous Request Thresholds" on
page 457.
The following is the Vuser script that VuGen generated after recording the application - before an
asynchronous scan was performed. The script contains a series of web_url functions with similar
URLs. Since new requests are sent as soon as the previous response is finished, no lr_think_time
functions are added between the web_url functions. This help to indicate that this is a long-poll
conversation and not a poll conversation.
When the Vuser script runs, requests to the chat application should be sent repeatedly every time a
response from the chat application is finished. In addition, requests should be sent in parallel
(simultaneously) with other actions performed in the script.
After VuGen performs an asynchronous scan on the script, the modified script looks as follows:
HP LoadRunner (12.00)
Page 478 of 1743
LoadRunner User Guide
Script Workflow
Notice that a web_reg_async_attributes function has been added before the first web_url function
that calls the chat application.
Except for the first call the chat application, all other web_url functions that call similar URLs have
been commented out.
A close look at the Snapshot pane for the remaining web_url function shows that the snapshots for
the removed steps now have origin = Polling. Notice that the response times vary greatly as the
responses arrive only when another user has sent a chat message. This helps to indicate that this
is a long-poll conversation, and not a poll conversation.
Viewing Replay Results
The Viewing Replay Results section explains how to view and customize the results of a Vuser
script replay.
HP LoadRunner (12.00)
Page 479 of 1743
LoadRunner User Guide
Script Workflow
Viewing Replay Results - Overview
Creating a Vuser script includes the steps shown below. This topic provides and overview of the
seventh step, viewing the results of the replay of a Vuser script.
To assist with debugging a Vuser script, you can view a report that summarizes the results of your
script run. VuGen generates the report during the Vuser script execution and you view the report
when script execution is complete.
The Test Results window displays all aspects of the test run and can include:
l
A high-level results overview report (pass/fail status)
l
The data used in all runs
l
An expandable tree of the steps, specifying exactly where application failures occurred
l
The exact locations in the script where failures occurred
l
A still image of the state of your application at a particular step
l
A movie clip of the state of your application at a particular step or of the entire test
l
Detailed explanations of each step and checkpoint pass or failure, at each stage of the test
Customizing the Test Results Display
Each result set is saved in a single .xml file (called results.xml). This .xml file stores information
on each of the test result nodes in the display. The information in these nodes is used to
dynamically create .htm files that are shown in the top-right pane of the Test Results window.
Each node in the run results tree is an element in the results.xml file. In addition, there are different
elements that represent different types of information displayed in the test results. You can take
test result information from the .xml file and use XSL to display the information you require in a
customized format (either when printing from within the Test Results window, when displaying test
results in your own customized results viewer, or when exporting the test results to an HTML file).
XSL provides you with the tools to describe exactly which test result information to display and
exactly where and how to display, print or export it. Using a XSL editor, you can modify the .css and
.xsl files in the results folder, to change the appearance of the report (fonts, colors, and so forth).
For example, in the results.xml file, one element tag contains the name of an action, and another
element tag contains information on the time at which the run was performed. Using XSL, you could
tell your customized editor that the action name should be displayed in a specific place on the page
and in a bold green font, and that the time information should not be displayed at all.
HP LoadRunner (12.00)
Page 480 of 1743
LoadRunner User Guide
Script Workflow
Connecting to Application Lifecycle Management
from the Test Results Window
To manually submit defects to Application Lifecycle Management from the Test Results window,
you must be connected to Application Lifecycle Management.
The connection process has two stages.
l
First, you connect to a local or remote Application Lifecycle Management server. This server
handles the connections between the Test Results and the Application Lifecycle Management
project.
l
Next, you log in and choose the project you want to access. The project stores tests and run
session information for the application you are testing.
Note: Application Lifecycle Management projects are password protected, so you must
provide a user name and a password.
For more information on connecting to an ALM project, see "How to Work with Scripts in ALM
Projects" on page 164.
How to Send Custom Information to the Report
In addition to the information sent automatically to the report, for Web Service Vusers, you can
send information to the report using the message functions lr_output_message or lr_error_
message.
For task details, see "How to Insert Steps into a Script" on page 406.
How to Configure the Appearance of the Test Results
Window
By default, the Test Results window has the same look and feel as the window, using the Microsoft
Office 2003 theme. You can change the look and feel of the Test Results window, as required.
To change these settings, select View > Window Theme and select the desired theme.
Note: You can apply the Microsoft Windows XP theme to the Tests Results window only if
your computer is set to use a Windows XP theme.
How to Open the Test Results of a Specific Run
This task describes how to open the test results window for a specific run.
HP LoadRunner (12.00)
Page 481 of 1743
LoadRunner User Guide
Script Workflow
1. Select File > Open from within the Test Results window.
2. Select a script file to display the test results for that file and select the desired test result file.
By default, result files for tests are stored in <Script>\<ResultName>.xml. If your script is
stored in Application Lifecycle Management, see below.
3. Select a results set and click Open.
Note: Results files for earlier versions were saved with a .qtp file extension. In the Select
Results File dialog box, only results files with an .xml extension are shown by default. To view
results files with a .qtp extension in the Select Results File dialog box, select Test Results
(*.qtp) in the Files of type box.
Select a Script Stored in Application Lifecycle Management
1. Click the Application Lifecycle Management Connection button
Application Lifecycle Management project.
and connect to your
2. In the Open Test Results dialog box, enter the path of the folder that contains the results file for
your test, or click the browse button to open the Open Test from ALM Project dialog box.
3. Select DB Vuser in the Test Type list.
4. Select the script whose test results you want to view, and click OK.
5. In the Open Test Results dialog box, highlight the test result set you want to view, and click
Open. The Test Results window displays the selected test results.
How to Find Steps in the Test Results
This task describes how to search the test results for steps of a particular type.
1. Select Tools > Find from within the Test Results window.
2. Select the type of step you wish to find. You can select multiple options.
3. Select Up or Down to indicate the direction of the search.
4. Select Find Next to find the next occurrence of the type of step you selected.
Test Results Window
This window displays a report that summarizes the results of your script run.
HP LoadRunner (12.00)
Page 482 of 1743
LoadRunner User Guide
Script Workflow
To access
Important
information
l
Opens automatically after running a script.
l
VuGen > Replay > Test Results...
l
You can configure the result settings from Tools > Options > Scripting >
Replay .
l
The Test Results window can show results with up to 300 levels in the tree
hierarchy. If you have results with more than 300 nested levels, you can view
the entire report by manually opening the results.xml file.
User interface elements are described below:
UI
Element
Description
Report
Tree
A graphical representation of the test results located in a pane on the left of the
window. You can collapse or expand a branch in the run results tree to change the
level of detail that the tree displays.
The icons next to the steps indicate the following information:
Indicates a step that succeeded.
Indicates a step that failed.
Indicates a warning, meaning that the step did not succeed, but it did not cause
the test to fail.
Indicates a step that failed unexpectedly.
You can expand and collapse all of the nodes from the View menu, or by clicking *.
HP LoadRunner (12.00)
Page 483 of 1743
LoadRunner User Guide
Script Workflow
, continued
Results
Details
Pane
(Results
Summary)
Screen
Recorder
Tab
Contains details of the test run which change depending on which part of the report
tree you select. When you select the top node of the tree, the Result Details tab
shows a summary of the results for your test. When you select a branch or step in
the tree, the Result Details tab contains the details for that step. The Result Details
tab may also include a still image of your application for the highlighted step.
l
Iterations, actions, and steps that contain checkpoints are marked Passed or
Failed in the right part of the Test Results window and are identified by icons in
the tree pane.
l
Iterations, actions, and steps that ran successfully, but do not contain
checkpoints, are marked Done in the right part of the Test Results window.
Contains the movie associated with your test results. If there is no movie
associated with your test results, the Screen Recorder tab contains the message:
No movie is associated with the results.
Opens the test results of a specific run. For more details, see "How to Open the
Test Results of a Specific Run" on page 481.
Opens the Print dialog box, enabling you to print the test results. For more
information, see "Print Dialog Box" on the next page.
Opens the Filters dialog box, enabling you to filter the test results. For more
information, see "Filters Dialog Box" below.
Opens the Find dialog box, enabling you to search the test results for steps of a
particular type. For more information, see "How to Find Steps in the Test Results"
on page 482.
Searches the test results for the previous step matching the criteria in the Find
dialog box.
Searches the test results for the next step matching the criteria specified in the Find
dialog box.
Selects the previous node.
Selects the next node.
Opens the product documentation.
Filters Dialog Box
This dialog box enables you to filter the test results in the test results window.
HP LoadRunner (12.00)
Page 484 of 1743
LoadRunner User Guide
Script Workflow
To access
"Test Results Window" on page 482 > View > Filters
User interface elements are described below:
UI
Element
Description
Iterations
l
All. Displays test results from all iterations.
l
Fromiteration X to Y. Displays the test results from a specified range of test
iterations.
l
Fail. Displays the results for the steps that failed.
l
Warning. Displays the results for the steps with the status Warning (steps that
did not pass, but did not cause the script to fail).
l
Pass. Displays the results for the steps that passed.
l
Done. Displays the results for the steps with the status Done (steps that were
performed successfully but did not receive a pass, fail, or warning status).
l
All. Displays all steps from all nodes in the test.
l
Show only actions. Displays the action nodes in the test (not the specific steps
in the action nodes).
Status
Content
Print Dialog Box
This dialog box enables you to print the test results.
HP LoadRunner (12.00)
Page 485 of 1743
LoadRunner User Guide
Script Workflow
To access
"Test Results Window" on page 482 > File > Print
User interface elements are described below:
UI
Description
Element
Print
range
l
All. Prints the results for the entire script.
l
Selection. Prints the results for the selected branch in the run results tree.
Copies
The number of copies to print.
Print
format
l
Short. Prints a summary line (when available) for each item in the run results tree.
This option is available only if you the print range is set to All.
l
Detailed. Prints all available information for each item in the run results tree, or for
the selected branch.
l
User-defined XSL. Enables you to browse to and select a customized .xsl file.
You can create a customized .xsl file that specifies the information to be included
in the printed report, and the way it should appear. For more information, see
"Customizing the Test Results Display" on page 480.
Print Preview Dialog Box
This dialog box enables you to view a print preview of the test results.
HP LoadRunner (12.00)
Page 486 of 1743
LoadRunner User Guide
Script Workflow
To access
"Test Results Window" on page 482 > File > Print Preview
Important
If some of the information is cut off in the preview, for example, if checkpoint
information names are too long to fit in the display, click the Page Setup button in the Print
Preview window and change the page orientation from Portrait to Landscape.
User interface elements are described below:
UI
Description
Element
Print
range
Print
format
l
All. Prints the results for the entire script.
l
Selection. Prints the results for the selected branch in the run results tree.
l
Short. Prints a summary line (when available) for each item in the run results tree.
This option is available only if you the print range is set to All.
l
Detailed. Prints all available information for each item in the run results tree, or for
the selected branch.
l
User-defined XSL. Enables you to browse to and select a customized .xsl file.
You can create a customized .xsl file that specifies the information to be included
in the printed report, and the way it should appear. For more information, see
"Customizing the Test Results Display" on page 480.
Export to HTML File Dialog Box
This dialog box enables you to export the test results to an HTML file. This enables you to view the
results even if the Test Results Viewer environment is unavailable. For example, you can send the
file containing the results in an e-mail to a third-party. You can select the type of report you want to
export, and you can also create and export a customized report.
HP LoadRunner (12.00)
Page 487 of 1743
LoadRunner User Guide
Script Workflow
To access
"Test Results Window" on page 482 > File > Export to HTML File
Important
In Test Result reports, you can only use the Export to HTML file utility for scripts
Information replayed in version 9.50 and later. To generate an HTML report for scripts created
with earlier versions, run the script again in the 9.50 version (or later) of the
product.
User interface elements are described below:
UI
Description
Element
Export
Range
Export
Format
l
All. Exports the results for the entire script.
l
Selection. Exports result information for the selected branch in the results tree.
l
Short. Prints a summary line (when available) for each item in the run results tree.
This option is available only if you the print range is set to All.
l
Detailed. Prints all available information for each item in the run results tree, or for
the selected branch.
l
User-defined XSL. Enables you to browse to and select a customized .xsl file.
You can create a customized .xsl file that specifies the information to be included
in the printed report, and the way it should appear. For more information, see
"Customizing the Test Results Display" on page 480.
HP LoadRunner (12.00)
Page 488 of 1743
LoadRunner User Guide
Protocols
Protocols
Protocol Support for Async, IPv6, and 64-bit
Recording
The following table shows the protocol support for Async, IPv6, and 64-bit recording:
Protocol
Async
IPv6
64-bit recording
DNS
No
Yes
No
Flex AMF
Yes
Yes
No
Flex RMTP
No
No
No
FTP
No
Yes
No
IMAP
No
Yes
No
Java Over HTTP
No
Yes
Yes
LDAP
No
No
Yes
Microsoft .NET
No
No
Yes
Mobile Applications HTTP/HTML
No
Yes
No
Windows Sockets (multi-protocol)
No
Yes
Yes
Oracle 2-Tier
No
No
Yes
Oracle NCA
No
Yes
Yes
POP3
No
Yes
No
RDP
No
Yes
Yes
SAP – Web
No
No
Yes
Siebel - Web
No
No
Yes
Silverlight
No
Yes
No
HP LoadRunner (12.00)
Page 489 of 1743
LoadRunner User Guide
Protocols
Protocol
Async
IPv6
64-bit recording
SMTP
No
Yes
No
TruClient Ajax - FireFox
No
Yes
No
TruClient Ajax - IE
No
Yes
No
TruClient Ajax - Mobile
No
Yes
No
Click & Script family (Ajax, SAP)
No
Yes
No
Web - HTTP/HTML
Yes
Yes
Yes
Web Services
Yes
Yes
Yes
Note: In all the protocols that support asynchronous sessions, recording will only be applied to
web_* steps.
Ajax - Click & Script Protocol
Ajax (Asynchronous JavaScript and XML) represents a group of technologies for creating
interactive Web applications. With Ajax, web pages exchange small packets of data with the
server, instead of reloading an entire page. This reduces the amount of time that a user needs to
wait when requesting data. It also increases the interactive capabilities and enhances the usability.
Using Ajax, developers can create fast Web pages using Javascript and asynchronous server
requests. The requests can originate from user actions, timer events, or other predefined triggers.
Ajax components, also known as Ajax controls, are GUI based controls that use the Ajax
technique—they send a request to the server when a trigger occurs.
For example, a popular Ajax control is a Reorder List control that lets you drag components to a
desired position in a list. VuGen's support for Ajax implementation is based on Microsoft's
ASP.NET Ajax Control Toolkit formerly known as Atlas.
Ajax (Click & Script) Protocol Overview
Ajax (Asynchronous JavaScript and XML) represents a group of technologies for creating
interactive Web applications. With Ajax, web pages exchange small packets of data with the
server, instead of reloading an entire page. This reduces the amount of time that a user needs to
wait when requesting data. It also increases the interactive capabilities and enhances the usability.
Using Ajax, developers can create fast Web pages using Javascript and asynchronous server
requests. The requests can originate from user actions, timer events, or other predefined triggers.
HP LoadRunner (12.00)
Page 490 of 1743
LoadRunner User Guide
Protocols
Ajax components, also known as Ajax controls, are GUI based controls that use the Ajax
technique—they send a request to the server when a trigger occurs.
For example, a popular Ajax control is a Reorder List control that lets you drag components to a
desired position in a list. VuGen's support for Ajax implementation is based on Microsoft's
ASP.NET Ajax Control Toolkit formerly known as Atlas.
For an overview on the Click and Script protocols, see "Click & Script Protocols - Overview" on
page 602.
Ajax (Click & Script) Supported Frameworks
The supported frameworks for Ajax Click & Script functions are:
l
Atlas 1.0.10920.0/ASP.NET Ajax—All controls
l
Scriptaculous 1.8—Autocomplete, Reorder List, and Slider
VuGen supports the following frameworks at the engine level. This implies that VuGen will create
standard Click & Script steps, but not Ajax specific functions:
l
Prototype 1.6
l
Google Web Toolkit (GWT) 1.4
Ajax (Click & Script) Example Script
VuGen uses the control handler layer to create the effect of an operation on a GUI control. During
recording, when encountering one of the supported Ajax controls, VuGen generates a function with
an ajax_xxx prefix.
In the following example, a user selected item number 1 (index=1) in an Accordion control. VuGen
generated an ajax_accordion function.
web_browser("Accordion.aspx",
DESCRIPTION,
ACTION,
"Navigate=http://labm1app08/AJAX/Accordion/.aspx",
LAST);
lr_think_time(5);
ajax_accordion("Accordion",
DESCRIPTION,
"Framework=atlas",
"ID=ctl00_SampleContent_MyAccordion",
ACTION,
"UserAction=SelectIndex",
"Index=1",
LAST);
web_edit_field("free_text_2",
"Snapshot=t18.inf",
HP LoadRunner (12.00)
Page 491 of 1743
LoadRunner User Guide
Protocols
DESCRIPTION,
"Type=text",
"Name=free_text",
ACTION,
"SetValue=FILE_PATH",
LAST);
Note: When you record an Ajax session, VuGen generates standard Click & Script functions
for objects that are not one of the supported Ajax controls. In the example above, the word
FILE_PATH was typed into an edit box.
Ajax (Click & Script) Recording Tips
This section lists tips for recording click-and-script Vuser scripts.
Note: Some of the items below apply to specific click-and-script protocols only.
Use the Mouse and not the Keyboard
It is preferable to click on an object with the mouse rather than using the keyboard. During
recording, use only GUI objects that are within the browser's pane. Do not use any browser icons,
controls, the Stop button, or menu items, such as View > Refresh. You may, however, use the
Refresh, Home, Back and Forward buttons and the address bar.
Do not Record Over an Existing Script
It is best to record into a newly created script—not an existing one.
Avoid Context Menus
Avoid using context menus during recording. Context menus are right-click menus which pop up
when clicking certain objects in a graphical user interface.
Avoid Working in Another Browser While Recording
While recording, do not work in any browser window other than the browser windows opened by
VuGen.
Wait for Downloads
Wait for all downloads to complete before doing any action, such as clicking on a button or filling in
a text field.
Wait for Pages to Load
During recording, it is best to wait for the page to load completely before doing the next step. If you
did not wait for all of the pages to load, record the script again.
Navigate to the Start Page
If the last page in an action does not contain the links and buttons that were available at the start of
the iteration, then the next iteration will fail. For example, if the first page has a text link Book A
HP LoadRunner (12.00)
Page 492 of 1743
LoadRunner User Guide
Protocols
Flight, make sure to navigate to the appropriate page at the end of your recording, so that the same
link will be visible at the end of the business process.
Use a Higher Event Configuration Level
Record the business process again using the High event configuration level. For more information
on changing the event configuration level, see "Click & Script Troubleshooting and Limitations" on
page 610.
Disable Socket Level Recording
In certain cases, the capturing of the socket level messages disrupts the application. For most
recordings, socket level data is not required. To prevent the recording of socket level data, disable
the option in the recording options. For more information, see "GUI Properties > Advanced Node"
on page 219.
Enable the "Record rendering-related property values" Option
If the client-side scripts of the application use a lot of styling activities, enable the Record
rendering-related property values option before recording the script. For example, enable this
option to record additional DOM properties such as offsetTop. Note that enabling this option may
decrease the recording speed. You can enable the option by selecting Recording Options > GUI
Properties > Advanced. For more information, see "GUI Properties > Advanced Node" on page
219.
Ajax (Click & Script) - Replay Tips
This section lists tips for replaying click-and-script Vuser scripts.
Note: Some of the items below apply to specific click-and-script protocols only.
Do not Reorder Statements in a Recorded Script
Do not change the order of the statements within a recorded script. Also, copying segments of code
from one Action to another is not recommended.
Convert non-ASCII Characters
If your links contain non-ASCII characters, you should instruct VuGen to convert the data to or from
the UTF-8 format.
Enable UTF-8 Conversion
1. Select Replay > Run-Time Settings and select the Internet Protocol > Preferences node.
2. Click Options to open the Advanced Options dialog box.
3. Locate the Convert from/to UTF-8 option and set it to Yes.
Alternatively, view the list of options that is displayed when a link is not found. Enter the displayed
text as-is, such as the hex escape sequences \xA0 or any other non-standard format.
HP LoadRunner (12.00)
Page 493 of 1743
LoadRunner User Guide
Protocols
Run the Same Sequence of Actions Twice
In some cases, you can perform a certain process only once—such as deleting a user from the
database. Replay will fail after the first iteration because the action is no longer valid. Verify that
your business process can be repeated more than once with the same data.
Set Unique Image Properties
In the Step Navigator, double click on the previous image step to open its properties. If the Id,
Name, and Alt properties are empty, provide further identification of the image, such as its file
name in the Src property.
Alternatively, you can add an Ordinal argument to specify the occurrence number of the image on
that page. The Ordinal argument uniquely identifies each image on the page where all other
identification arguments are not unique. For more information, see the Function Reference
(Help > Function Reference).
Check the Step's Description
If you receive a GUI Object is not found error, check the Output pane for a list of the objects in the
problematic step. In some cases, the object description changes slightly from run to run.
There are several solutions:
l
If the new value is stable, open the script in the Editor and manually modify the value of the
step's DESCRIPTION argument.
l
If the description changes from run to run, you can use a regular expression in the
DESCRIPTION argument. For more information, see the Function Reference (Help > Function
Reference).
l
Alternatively, replace the problematic object description property, such as Name, with the
Ordinal property. For more information, see the Function Reference (Help > Function
Reference).
ThreadingModel
Replay of COM script in VuGen fails when the dll registration is missing the ThreadingModel
string under the InprocServer32 folder of the GUID.
Ajax (Click & Script) Miscellaneous Tips
The following additional tips may help you in troubleshooting problems that you experience with
click-and-script Vuser scripts.
Note: Some of the items below apply to specific click-and-script protocols only.
Search for Warnings
Search for warnings or alerts in the Output pane.
Verify the Response
Verify the response of the previous step is correct using web_reg_find. For more information, see
HP LoadRunner (12.00)
Page 494 of 1743
LoadRunner User Guide
Protocols
the Function Reference (Help > Function Reference).
Use Alternate Navigation
For problematic steps or those using Java applets, use Alternative Navigation to replace the Web
step with an HTTP level step. Note that the HTTP level steps may require manual correlations. To
perform Alternative Navigation, select a step in the Step Navigator, or the text in Script View, and
select Replace with alternative navigation from the right-click menu.
Working with the Kerberos Protocol
If you are using the Kerberos Protocol for authentication, you must customize VuGen to properly
convene authorization sessions. Advanced users can attempt to perform this customization
themselves.
In order for the Kerberos Protocol to work properly, create a krb5.ini file and put it in an available
folder. Save the full path name of krb5.ini into the KRB5_CONFIG environment variable.
The krb5.ini file should contain detailed information about each domain (KDS and AS addresses)
and trust chains.
For more information, contact HP software support.
Click & Script Troubleshooting and Limitations
This section describes troubleshooting and limitations for click-and-script protocols.
Note: Some of the items below apply to specific click-and-script protocols only.
Recording Issues and Limitations
Browser support
l
Only Internet Explorer is supported for Web (Click & Script). To record browser activity on
Firefox, use the Web (HTTP/HTML) protocol.
l
Not supported for Internet Explorer 10.
l
For Click & Script protocols, VuGen may take an excessive amount of time to open the
Recording Options dialog box.
Language Support
l
Recording an application in a specific language (e.g., French, Japanese) must be performed on a
machine whose default locale (in Settings > Control Panel > Regional Options) is the same
language
l
Support of right-to-left languages is limited (e.g., bi-directional or reversed text may not be
processed as expected). This is defined by the default operating system translation table.
l
The locale of the load-generator machine, must be configured to be the same as that of the
recording machine. It cannot be assumed that the Linux default character set is the same as in
HP LoadRunner (12.00)
Page 495 of 1743
LoadRunner User Guide
Protocols
Windows, even for US-English machines, and this has to be explicitly verified. For example, the
default character set on Linux, is UTF-8.
Application behaves differently while being recorded
If your application behaves differently during recording, than it does without recording, you should
determine if the recording problem is unique to Web. The effect may be that a Web page will not
load, part of the content may be missing, a popup window will not open, and so forth.
Workaround: Create a new Web (HTTP/HTML) script and repeat the recording.
In the event that the recording fails in Web (HTTP/HTML), we recommend that you disable socket
level recording (see "Click & Script Recording Tips" on page 603).
The problem may be the result of an event listener. Use trial and error to disable event listeners in
the Web Event Configuration Recording Options, and then re-record your session as a Web
(HTTP/HTML) user.
Certain Click & Script steps do not generate properly
After recording a script, if not all steps are correctly generated, the problem may be due to the
Windows Component > Internet Explorer Enhanced Security Configuration.
Remove Internet Explorer Enhanced Security Configuration by selecting Control Panel >
Add or Remove Programs > Add or Remove Windows Components and re-record your
script.
Disable an Event Listener
1. Click Record > Recording Options to open the Recording Options dialog box.
2. Select the GUI Properties > Web Event Configuration node.
3. Click Custom Settings and expand the Web Objects node. Select an object.
4. Select Disabled from the list in the Record column for the relevant Web object. If the
recording still does not work, enable the listener you previously disabled, and try disabling
another one. Repeat these steps until your recording succeeds.
Dynamic menu navigation was not recorded
A dynamic menu is a menu that dynamically changes depending on where you select it. If the
dynamic menu navigation was not recorded, record again using "high" event configuration mode.
These settings can be found in the Recording Options > GUI Properties > Web Event
Configuration node.
Certain user actions were not recorded
Check if there is a Java applet running inside the browser. If not, record the script with the Web
(HTTP/HTML) protocol.
Replay Issues
GUI object not found
Does the error occur at the beginning of the second iteration?
HP LoadRunner (12.00)
Page 496 of 1743
LoadRunner User Guide
Protocols
If the error occurs at the beginning of the second iteration's Action section, it is probably the result
of a starting page that was present for the first iteration, but missing for the second one. If the last
page in an action does not contain the links and buttons that were available at the start of the
iteration, then the next iteration will fail. For example, if the first page has a text link Book A Flight,
make sure to navigate to the appropriate page, so that the same link will be visible at the end of the
business process.
Is it a text link containing non-ASCII characters?
If the problem occurs with non-ASCII characters, you should instruct VuGen to covert the data to a
suitable character set.
Enable Data Conversion on Windows Machines
1. Select Replay > Run-Time Settings and select the Internet Protocol > Preferences node.
2. Click Options to open the Advanced Options dialog box.
3. Locate Charset Conversions by HTTP in the Web (Click & Script) > General options, and set
it to Yes.
Enable UTF-8 conversion for Linux Machines
1. Select Replay > Run-Time Settings and select the Internet Protocol > Preferences node.
2. Click Options to open the Advanced Options dialog box.
3. Locate Convert from/to UTF-8 in the General options and set it to Yes
Alternatively, view the list of alternatives that are displayed when a link is not found. Enter the
displayed text as-is, such as hex escape sequences \xA0 or any other non-standard format.
Can you run the same sequence of actions twice in the application?
In some cases, you can only perform a certain process once, such as deleting a user from the
database. Replay will fail after the first iteration, because the action is no longer valid. Verify that
your business process can be repeated in the application more than once with the same data,
without recording again.
Were the image properties 'Id', 'Name' and 'Alt' empty?
In the Step Navigator, double click on the previous image step to open its properties. If the Id,
Name, and Alt properties are empty, provide further identification of the image, such as its file
name in the Src property.
Alternatively, you add an Ordinal argument to specify the occurrence number of the image on that
page. The Ordinal argument uniquely identifies each image on the page where all other
identification arguments are not unique. For more information, see the Function Reference (Help >
Function Reference).
Did the step's description change?
Check the Output pane for a list of the objects in the problematic step. In some cases, the object
description changes slightly from run to run.
HP LoadRunner (12.00)
Page 497 of 1743
LoadRunner User Guide
Protocols
There are several solutions:
l
If the new value is stable, open the Script View and manually modify the value of the step's
DESCRIPTION argument(s).
l
If the description changes from run to run, you can use a regular expression in the
DESCRIPTION argument(s). For more information, see the Function Reference (Help >
Function Reference).
l
Alternatively, replace the problematic object description property, such as Name, with the
Ordinal property For more information, see the Function Reference (Help > Function
Reference).
Did the page load completely during recording?
During recording, it is best to wait for the page to load completely before doing the next step. If you
did not wait for all of the pages to load, record the script again.
Replay failure
If the replay fails at a particular step, check the step description. VuGen may have interpreted a
single space as a double space. Make sure that there are no incorrect double spaces in the string.
Replay snapshots
Replay snapshots may differ from the actual Web page.
Miscellaneous Issues
Out of memory error in JavaScript
Increase the JavaScript memory in the run-time settings.
Increase the JavaScript Memory Size
1. Select Replay > Run-Time Settings and select the Internet Protocol > Preferences node.
2. Click Options to open the Advanced Options dialog box.
3. Locate the Memory Management JavaScript Runtime Memory Size (Kb) and Memory
Management JavaScript Stack Memory Size (Kb) options.
4. Increase the memory sizes to 512Kb or higher.
VuGen displays JavaScript errors
If VuGen displays JavaScript errors in the Output pane, enable IE (Internet Explorer) script
errors in order to verify that the Javascript itself does not contain errors.
Show Script Errors
1. Open Internet Explorer.
HP LoadRunner (12.00)
Page 498 of 1743
LoadRunner User Guide
Protocols
2. Select Tools > Internet Options and click the Advanced tab.
3. Under Browsing, select the Display a notification about every script error check box.
4. Rerun the application in IE. If IE displays script errors, then there is a problem with the
JavaScript application. If it is not possible to fix the application, you can safely ignore the
corresponding replay errors.
Problems following parameterization
If you encounter problems only after you have parameterized values, verify that the values are
valid for your application. Perform business process with the value of the parameter and verify
that the application accepts it.
Problems with applications that utilize styling actions
If the client-side scripts of the application use a lot of styling activities, you should record the
script again after enabling the Record rendering-related property values option. This enables
the recording of additional DOM objects.
Enable the "Record rendering-related property values" Option
1. Select Recording > Recording Options and select the GUI Properties > Advanced node.
2. Select the Record rendering-related property values check box.
Re-record the Vuser script.
l
ActiveX objects and Java applets are only supported on Windows platforms.
l
Not supported for Macromedia Flash or VB Script.
l
Click & Script protocols do not support pop-up windows.
TruClient Protocol
What is TruClient?
TruClient is a tool for recording complex web-based applications. The TruClient engine records your
actions as you navigate through your business process. It creates a script in real-time, allowing you
to see the steps as they are performed in a sidebar. Currently, you can select to record tests with
either the Mozilla Firefox or Internet Explorer browser.
Note: This section documents features available in both the Mozilla
browsers.
and Internet Explorer
Features that are supported only by a particular browser are indicated by the browser's icon.
HP LoadRunner (12.00)
Page 499 of 1743
LoadRunner User Guide
Protocols
The TruClient User Interface
The TruClient user interface is made up of the following sections:
1. TruClient Sidebar. The heart of the interface, containing all the tools you need to develop your
TruClient scripts.
2. TruClient Toolbox. The toolbox contains all of the steps that you can add to a TruClient
script. The toolbox opens and closes by clicking on the tab, and moves by dragging it up or
down.
3. Browser Navigation Bar. Enter the URL of the application for which you are developing a
script.
4. Application Browser Window.The window containing the browser where you develop and
replay your script interactively.
5. TruClient Sidebar Status Pane. A pane that displays status details about the active action in
the TruClient Sidebar.
You can watch a video demonstration about LR from the VuGen start page.
The TruClient Workflow For LoadRunner
The TruClient protocol workflow is different from the workflow for other VuGen protocols. The
following flowchart illustrates the basic TruClient workflow:
HP LoadRunner (12.00)
Page 500 of 1743
LoadRunner User Guide
Protocols
The following lists some of the main differences between the TruClient protocol and other VuGen
protocols:
HP LoadRunner (12.00)
Page 501 of 1743
LoadRunner User Guide
Protocols
l
The script is visible in VuGen’s script view but it is read only. The script is created and modified
in the TruClient sidebar in the browser (FF or IE).
l
TruClient scripts are asynchronous. Steps do not have to wait for previous steps to complete.
Each step defines an End Event which defines the point at which subsequent steps are allowed
to start running.
l
TruClient scripts are recorded on the user level, therefore there are no correlations, however ,the
main challenge becomes object identification.
l
TruClient scripts are replayed at the user level, therefore each Vuser requires a browser instance
with loaded DOM and JavaScript. This makes resource footprint larger than the Web (transport
based) protocol and also makes it dependent on the DOM and JavaScript of the application. For
details see, "How to Calculate the Number of Load Generators Required for TruClient Scripts"
on page 513.
l
All recorded events are saved in the script. Events deemed to be irrelevant are assigned to
different script levels and are not replayed unless the level is manually changed by the user.
l
TruClient transactions are defined by step events, not the steps themselves as in other
protocols. For example, a step's End Event may allow the script to continue, while a transaction
that ends on that step may continue until the step event that defines the transaction is reached.
l
The Run-Logic in TruClient scripts is controlled differently. There is only one action.
l
TruClient step arguments accept JavaScript code as values.
Most of the tasks involved in recording, replaying, and modifying scripts are done using the
TruClient Sidebar for Internet Explorer or Mozilla Firefox .
TruClient Step Structure
TruClient steps are comprised of a number of sections. The sections and elements within each
section vary depending on the type of step.
User interface elements are described below:
HP LoadRunner (12.00)
Page 502 of 1743
LoadRunner User Guide
Protocols
Step Structure
UI Element
Description
Drag Step. Enables you to arrange the order of your script by dragging the step
to a different location.
Expand Step. Displays the individual components of the steps which include
step, argument and object.
Script levels selector. Allows you to view and modify the script level of the
step. For more information, see "TruClient Script Levels" on page 515.
Replay. Replays this step only.
Disable/Enable Step. Steps that are disabled are not replayed. This feature
allows you to temporarily remove steps from the script without deleting them.
Optional Step. Marking a step as optional means that in the event that the
step can not find its object, the script continues without returning an error.
Alternative Steps. This icon indicates a step which can be redefined in
alternative ways. To redefine the step, click the icon, select the desired step
definition, and click Back. For more information, see "TruClient Alternative
Steps " on page 515.
HP LoadRunner (12.00)
Page 503 of 1743
LoadRunner User Guide
Protocols
Step Structure, continued
Step
l
Action. The action that defines the step. The list of relevant actions is
determined by the object roles.
l
Object Timeout. If the object does not appear before this time in seconds,
the step returns an error.
l
Step Timeout. If the End Event is not reached by this time in seconds, the
step returns an error. The way the script behaves when such an error occurs
can be configured in the Run-Time settings dialog box.
l
Minimum Time.The least time in seconds that the execution of the step
will take. The value of this field can be either 0, “as recorded” or another
manually set number.
The step execution will end immediately after the step’s end event if
minimum time is = 0.
A minimum time value greater than 0 forces TruClient to wait the additional
time (if not elapsed already) from the step's end event before moving on to
the next step.
TruClient records and stores the time that elapsed between recorded
actions and allows you to set the minimum time to “as recorded”.
l
End Event. TruClient defines when a End Event occurs during replay.
An End Event can be one of the following:
HP LoadRunner (12.00)
n
Automatic: Not Set Yet. The automatic end event has not yet been
determined.
n
Action Completed. Step ends when its action is completed. An
example of an action is a button click.
n
DOM content loaded. Step ends when the page's Document Object
Model (DOM) is ready. This means that the API for interacting with the
content, style and structure of a page is ready to receive requests from
your application client side code.
n
Step synchronous network completed. Step ends when all HTTP
requests have been completed excluding requests that are associated
with open connections that are not relevant to the step. Usually, these
requests are triggered by using XMLHttpRequest.
n
Document load. Step ends when the process of loading a document is
completed. This means that all scripts and stylesheets have finished
loading and have been executed, and all images have been downloaded
and displayed.
Page 504 of 1743
LoadRunner User Guide
Protocols
Step Structure, continued
n
Step network completed. Step ends when all HTTP requests have
completed including requests initiated by XMLHttpRequest.
n
Dialog opened. Step ends when a dialog box is opened.
For details, see "How to Synchronize TruClient Scripts Steps" on page 508
Arguments
Contains step arguments. These arguments differ for different step actions and
roles. For a list of the step arguments, see " TruClient Step Arguments" on
page 579.
Object
l
Roles. The functions that TruClient understands about an object. This
information is read-only and is updated dynamically depending on how the
object is used during recording. The list of available step actions is defined
by these roles.
l
Name. A logical name for the object. This does not affect replay and can be
modified to enhance readability.
l
ID Method. The method of identifying the object.
n Automatic. TruClient's default object identification method. If this
method does not successfully find the object during replay, click the
Improve Object Identification button, reselect the correct object from the
application, and replay the script again.
l
Transactions
n
XPath. Identifies the object based on its XPath expression that defines
the object in the DOM tree. When you select this option, the next edit box
in the display is labeled XPath and enables you to select an XPath to
define the object. See below for details.
n
JavaScript. JavaScript code that returns an object. When you select this
option, the next edit box in the display is labeled JavaScript and enables
you to define a JavaScript to define the object. See below for details.
Related Objects. Tool to enable TruClient to identify a target object in
relation to an anchor object. For details, see "How to Resolve Object
Identification Issues" on page 519.
Allows you to create, modify, and view transactions. For more information, see
"How to Enhance TruClient Scripts" on page 534.
XPath/JavaScript
HP LoadRunner (12.00)
Page 505 of 1743
LoadRunner User Guide
Protocols
Step Structure, continued
XPath
TruClient generates several possible XPaths, depending on the object. Click
the drop-down arrow next to the XPath edit box to select a suggested XPath for
the object. You can manually modify the suggested XPath. To revert to one of
the original expressions generated by TruClient, select one of the options from
the drop-down again.
You can also click the Regenerate expression button and select an object.
TruClient generates a new set of suggestions based on the selected object.
JavaScript
If TruClient can generate a suggested XPath for the object, that XPath is
entered as the argument in an evalXPath function in the JavaScipt field. The
evalXPath function returns an array of the objects defined by the XPath in the
argument.
You can modify the suggested XPath in the argument to return a different list of
objects, or you can enter a different JavaScript.For example:
document.getElementById("SearchButton") returns an element that has a
DOM ID attribute of "SearchButton".
TruClient also includes a random function that returns a random item from the
array that is provided as its argument. For example:random
(document.getElementsByTagName("a"))
Note: The evalXPath and random functions are available as object
identification methods only. They are not recognized in an Evaluate
JavaScript code step.
Understanding Step Events
A TruClient step contains an action, and for application related steps, additional activity. The
following diagram illustrates the sequence of events triggered as a result of step execution.
HP LoadRunner (12.00)
Page 506 of 1743
LoadRunner User Guide
Protocols
What is an End Event?
TruClient scripts are asynchronous. This means steps do not have to wait for previous steps to
complete. Each step has an event flow and the End Event defines the point at which subsequent
steps are allowed to start. During script replay, TruClient will determine each step's end event. For
details see, "How to Synchronize TruClient Scripts Steps".
A step can be thought of as a container including an action and additional application activity. Each
step execution differs and may go through a different event flow. The following examples illustrate
how step execution can differ:
l
Example 1: Getting parameters using EvaluateJS step
The step includes an Evaluate JS step with TC.getParam("Name"); code. In this step there is
no application related activity. Therefore, the end event is automatically set to Action completed.
The remaining events in the chain are not relevant.
l
Example 2: Click on a simple search box (no auto-suggest)
HP LoadRunner (12.00)
Page 507 of 1743
LoadRunner User Guide
Protocols
This step interacts with the application but it does not trigger any network or DOM activity.
Therefore, the end event is automatically set to Action completed. The remaining events in the
chain are not relevant.
l
Example 3: Click on a search button
This step interacts with the application and triggers both network and DOM activity. Therefore,
the end event is automatically set to one of the events that follows Action completed. The
event selected depends upon the specific application behavior.
When to manually change step end events
l
Case 1
The next step is not ready to be executed because the preceding end event is incorrect. For
details, see "How to Synchronize TruClient Scripts Steps".
l
Case 2
You have created a transaction that surrounds several steps. You are interested in measuring a
certain aspect of the transaction more accurately. For details, see "Transaction Editor Dialog
Box (TruClient)" on page 550.
How to Synchronize TruClient Scripts Steps
This task describes the process of synchronizing steps in TruClient Scripts.
Note: This task is part of a higher-level task. For details, see " How to Develop TruClient Scripts"
on page 511
1.
Interactively record the business process
TruClient scripts are asynchronous which means steps do not have to wait for previous steps
to complete. Each step has an End Event which defines the point at which subsequent steps
are allowed to start running. After the interactive recording, each End Event is set to
Automatic: Not Set Yet.
HP LoadRunner (12.00)
Page 508 of 1743
LoadRunner User Guide
Protocols
For details on developing a script in TruClient, see Step 5 of " How to Develop TruClient
Scripts" on page 511
2.
Identifying the End Event
Before enhancing an TruClient script, replay the script to synchronize the steps. During the
first script replay, TruClient will try to automatically identify the End Event for each step.
An End Event can be one of the following:
HP LoadRunner (12.00)
Page 509 of 1743
LoadRunner User Guide
Protocols
n
Automatic: Not Set Yet. The automatic end event has not yet been determined.
n
Action Completed. Step ends when its action is completed. An example of an action is a
button click.
n
DOM content loaded. Step ends when the page's Document Object Model (DOM) is
ready. This means that the API for interacting with the content, style and structure of a page
is ready to receive requests from your application client side code.
n
Step synchronous network completed. Step ends when all HTTP requests have been
completed excluding requests that are associated with open connections that are not
relevant to the step. Usually, these requests are triggered by using XMLHttpRequest.
n
Document load. Step ends when the process of loading a document is completed. This
means that all scripts and stylesheets have finished loading and have been executed, and
all images have been downloaded and displayed.
n
Step network completed. Step ends when all HTTP requests have completed including
requests initiated by XMLHttpRequest.
n
Dialog opened. Step ends when a dialog box is opened.
If during the first replay, a step initiates the Object Identification Assistant to resolve object
identification, the previous step's End Event will most likely be misidentified and TruClient will
automatically reset it to Automatic: Not Set Yet.
3.
Confirming the End Event
During the second script replay, TruClient confirm the Automatic End Event and will assigned
any step's End Event that had been reset to Automatic: Not Set Yet.
If TruClient is unable to assign an automatic End Event during replay, usually due to a network
timeout, a warning message will inform you that the End Event has been reset to
Automatic: Not Set Yet. Replay the script to automatically assign the End Event or assign
the End Event manually.
Note: You may need to replay the script several times until all steps have been accurately
synchronized.
HP LoadRunner (12.00)
Page 510 of 1743
LoadRunner User Guide
Developing TruClient Scripts
How to Develop TruClient Scripts
This task describes the basic steps involved in interactively developing an TruClient script.
1.
Create a TruClient script from the VuGen toolbar.
For information about creating a VuGen script see, "How to Create or Open a Vuser Script" on
page 162.
2.
Configure the General Browser Settings
The Browser Configuration settings allow you to configure settings that apply to all TruClient
scripts. The settings are imported to new scripts as they are created. To edit these settings
click the TruClient General Settings button
from the Record toolbar in the VuGen main
window and select the Browser Settings tab. For details, see "TruClient General Settings
Dialog Box" on page 562.
3.
Configure the Run-Time Settings
In VuGen configure the Run-Time settings before recording and performing a load test. To open
the Run-Time settings dialog box, click F4 or select the Run-Time Settings node from
VuGen's Solution Explorer. For more information, see "Run-Time Settings" on page 317.
4.
Start developing the script
Click
to open an interactive recording session in the TruClient Sidebar for
either the Mozilla Firefox browser or the TruClient browser for IE.
5.
Record interactively
Navigate to the desired starting website and click
Record button . All of your actions will
be recorded and displayed in the TruClient Sidebar on the left as you perform your business
process. You can stop recording by selecting the Stop button
from any point in the script.
. You can continue recording
To record into different section of the script, right-click a step and select Record > Record
after or Record > Record before to begin recording new steps into the desired location in the
script. If you are recording into a group step, select Record > Record into. For more
information on group steps, see"TruClient Home Tab" on page 553.
6.
Replay the script
It is strongly recommended that you replay the script at least two times, correcting any errors
that occur during the process. After two successful consecutive replays, you can move on to
the next step. If you continue to experience errors, see "How to Debug TruClient Scripts" on
HP LoadRunner (12.00)
Page 511 of 1743
LoadRunner User Guide
page 517.
During interactive replay, TruClient will animate each step progress according to its real
running progress by filling the step bar. The step running progress can be for example: finding
the test object, performing the action, or synchronizing the step on its end-event. For detail on
synchronizing script steps, see "How to Synchronize TruClient Scripts Steps" on page 508.
In addition, script action details can be seen the TruClient Sidebar Status Pane.
7.
Enhance the script
You can enhance your script in a number of ways such as inserting parameters, transaction,
loops, and verification steps. For task details, see "How to Enhance TruClient Scripts" on page
534.
8.
Stop developing
Click the Save button
window.
9.
to save the script. Close the browser window. Restore the VuGen
Replay the script in Load Mode
Before you run the script in a Controller scenario, run the script in VuGen's load mode. From
the VuGen main window, click the Replay button
to replay the script in Load Mode .
Progress can be monitored in the Replay log. The browser does not open, and snapshots are
not displayed.
For details on Load Generation, see "How to Calculate the Number of Load Generators
Required for TruClient Scripts" on the next page.
10.
General Tips Regarding Successful Interactive Replay
Do not resize the browser between record and replay and during replay. This can cause objects
to move and interfere with TruClient's ability to locate them.
Do not switch between applications during interactive replay. Keep the browser in focus.
Note: This is especially important when the Related Objects feature is used, as resizing
may change the relative position of the objects.
Note:
Any customizations (such as bookmarks) that you make within this instance of
Firefox will not be saved globally. This is because VuGen opens each script in a unique Firefox
profile. If you want to use Firefox for any use other than creating this script (such as browsing
the internet), we recommend that you open an additional Firefox window.
HP LoadRunner (12.00)
Page 512 of 1743
LoadRunner User Guide
How to Calculate the Number of Load Generators
Required for TruClient Scripts
This task describes how to calculate the number of load generators required to run multiple
TruClient Vusers in the Controller.
Note: This task is part of a higher-level task. For details, see " How to Develop TruClient Scripts"
on page 511. TruClient technology provides you with the ability to quickly and easily record complex business
processes. However, because TruClient records at the user level and requires a browser for replay,
the more complex an application's client logic is, the more CPU and memory is required to run a
Vuser.
Note: The TruClient footprint can be significantly larger than the footprints of other Vuser
protocols. This larger footprint will require more CPU and memory capacity than would be
required to run a similar business process recorded in another protocol.
Use the following method to determine the required number of load generators:
1. Record a script using TruClient. For details, see step 5 of " How to Develop TruClient Scripts"
on page 511. 2. Replay a single Vuser in Controller and check the average CPU and the peak memory
consumption of the mdrv.exe process by adding a counter for % Processor Time and Private
Bytes. For details on working with Windows Resource Monitors, see "Add Windows
Resources Measurements Dialog Box" on page 1277.
3. Based on your load generator hardware and the CPU and memory consumption of a single
Vuser, calculate the number of Vusers per machine.
For example:
Let us assume that each of our load generators has 8 core processors and 8GB of
memory.
Let us also assume that a single Vuser consumes 80MB of peak memory and 10% CPU
on average for the specific business process.
From a CPU perspective, if we limit the CPU consumption up to 70% utilization, we can
have 7 Vusers per core processor (70% /10%). If our load generator has a total of 8 cores
processors, 8 * 7 Vusers per processor equals 56 Vusers per load generator.
From a memory perspective, the load generator machine has 8GB memory of which 7GB
is available for the Vusers so approximately 87 Vusers per load generator machine (7GB /
80MB).
HP LoadRunner (12.00)
Page 513 of 1743
LoadRunner User Guide
Therefore, to meet both the CPU and memory capacity limits, we use the lower number of
Vusers and we calculate that for this business process, we can run approximately 56
Vusers per load generator.
HP LoadRunner (12.00)
Page 514 of 1743
LoadRunner User Guide
TruClient - Debugging a TruClient Script
TruClient Alternative Steps
Alternative steps allow you to substitute an existing step with another step that performs the same
action. This may be useful for debugging a script. For example, suppose your step selected an item
from a menu, specified by the menu item number. TruClient lets you provide an alternate step that
selects a menu item based on its name.
Steps that have alternative options are labeled with an alternative step symbol
. Click it to view
the alternative options for that step. Click the desired alternative and select Back.
Below is a snapshot of a step in which the second item in a listbox named "Desktop" was selected.
The alternative steps feature gives you the option of defining the step based on clicking the link
"Desktop", selecting the object "Desktop" from the listbox, or selecting the second item in the
listbox.
TruClient Script Levels
As part of the process of recording a business process, some steps that are performed by the user
while recording are not required during replay. TruClient removes steps it deems to be unnecessary
and places them in different script levels. For example, a click step that occurs in an area of the
application that has no effect is placed in level 2. TruClient assumes that this step is not significant
and will not help the user to emulate a business process on the application. The default view
displays level 1 steps only. To also review steps from levels 2 and 3, use the slide bar in the Home
tab. During the replay phase, only steps that are visible are run.
In certain cases, you may want to override TruClient's decisions and manually change the level of a
given step. This can happen in cases such as mouseover steps that are needed during replay.
TruClient generally views mouse over steps as unnecessary for replay and assigns them to level 3.
For more information, see "How to Debug TruClient Scripts" on page 517.
Note: Automatic leveling during replay
The level of a step is normally set during recording according to the importance of the events in
the business process. It can happen that an important step will look unimportant and will be
placed in a lower script level. This may cause the replay to fail, generating an “object not found”
HP LoadRunner (12.00)
Page 515 of 1743
LoadRunner User Guide
error. During replay,TruClient will check if there are steps in a lower level that can affect the
outcome of the current step. If found, the meaningful step will be moved to higher script level.
The following screen shot displays a small script. Note that the step numbers skip from 1 to 3. Step
2 is hidden in a different level.
After changing the display settings by using the slide bar, all steps are now displayed and will run if
replayed in interactive mode.
HP LoadRunner (12.00)
Page 516 of 1743
LoadRunner User Guide
TruClient Snapshots
Vuser scripts based on the TruClient protocol utilize VuGen's Snapshot pane.
l
For an introduction to the Snapshot pane, see "Snapshot Pane - Overview" on page 85.
l
For details on how to work with the Snapshot pane, see "How to Work with Snapshots" on page
88.
l
For details on the Snapshot pane UI, see "Snapshot Pane" on page 126.
TruClient generates snapshots during recording according to the snapshot generation settings.
These snapshots can be viewed by hovering the mouse over each step's icon. The snapshots are
taken before the step's action is implemented and they are saved as .png files. Click each snapshot
to display it in a new browser tab. Make sure that the correct tab is active before replay. Recording
snapshots are stored in the snapshot folder.
You can configure snapshot generation during recording and replay by clicking the General
Settings button
and selecting the Interactive Options tab. For details, see "TruClient General
Settings Dialog Box" on page 562.
Snapshots can be viewed in snapshot viewer in VuGen. For details, see "How to Work with
Snapshots" on page 88. You can also view snapshots in the TruClient snapshot viewer. For details,
see "TruClient Home Tab" on page 553.
TruClient can also generate snapshots during load mode according to your specifications in the runtime settings. For details, see "General > Replay Node" on page 343.
Replay snapshots are stored in the results folder and are organized according to the type of replay
(interactive or load), the script section, and the iteration.
How to Debug TruClient Scripts
This task describes different options to debug an TruClient Script.
View Replay Errors in the TruClient sidebar
If any steps failed during replay, they are marked with an error
icons to view descriptions of the errors.
icon. Hover the mouse over these
Run The Script Step by Step
You can run your script step by step to view the replay more slowly and in a controlled manner. To
run the script step by step, select the down arrow from the replay button in the browser and select
Replay step by step. Repeat this procedure after each step to continue the step by step replay.
View the Replay Logs
In the VuGen Output Pane, you can view details of your script's replay. Select Output Pane >
Replay or the Output Pane > Browser Replay logs . For details, see the "Output Pane" on page
124.
HP LoadRunner (12.00)
Page 517 of 1743
LoadRunner User Guide
Insert Toggle Breakpoints
Breakpoints instruct the script to stop running during a replay when in interactive mode. They can
be used to help debug your script. To insert a toggle breakpoint, select the desired step and click
the Breakpoints
button.
Debug Scripts Using Snapshots
You can use the snapshots generated during replay to debug scripts by viewing the snapshots of
the failed step(s).
1. Select the
button on the TruClient Sidebar and select the Interactive Options tab. Set
the Replay Snapshots Generation to On Error.
2. Replay the script from the TruClient Sidebar.
3. Look in the Output Pane > Replay or the Output Pane > Browser Replay logs for errors.
Note the step numbers of the steps that had errors.
4. To view the snapshots from the TruClient Sidebar, select a step with an error, and select the
button.
or
To view the snapshots from VuGen, select View > Snapshot Pane.
You now have a group of snapshots in which errors occurred in the script.
Modify and view script levels
Sometimes, steps that were recorded and are necessary for replay are placed in levels 2 and 3. In
this case, you need to manually modify the level of those steps to level 1.
l
To modify a the script's replay level, drag the slider in the toolbar to the desired level. Dragging
the slider to level 3 displays and replays the steps on levels 1, 2, and 3.
l
To move a step to a different level, open the step and click on the step section. Move the slider
to the desired level. If the step is part of a group step, both the group step and the individual step
must be modified.
For more information, see "TruClient Script Levels" on page 515.
Insert Wait steps
Sometimes a script will fail to replay because an object in a step is not available when the previous
step has finished. You can resolve this by inserting Wait Steps into your script which pause the
script replay before continuing to the next step. There are two different types of Wait Steps:
l
The Wait step pauses the script for a specified amount of time before continuing to the next
step.
HP LoadRunner (12.00)
Page 518 of 1743
LoadRunner User Guide
l
The Wait for Object step pauses the script until a specified object is loaded before continuing to
the next step.
Wait Steps begin after the End Event of the previous step. This means that the previous step may
continue to run after the Wait Step has been reached.
To insert a Wait Step, select Toolbox > Functions and drag the Wait or Wait for Object icon to
the desired location in your script. If you add a Wait step, configure the interval in the argument
section of the step. If you add a Wait for Object step, select the Click to choose an object
button to select the target object in the application.
Note: Wait Steps differ from Think Time steps in other protocols. Think time controls the
time that a VuGen waits between actions. Wait Steps pause a script replay until either a
specified time elapses or an specified object is loaded.
Additional Script Debugging Tips
Alert Function
Since all the TruClient arguments support JavaScript, you use the Alert function to display
information during script development. You can also reference any DOM element using regular
functions, such as location.
Firebug for IE or Dom Inspector for FF
To further improve debugging capabilities, you can install plug-ins such as DOM Inspector and
Firebug that can provide additional information on the application object properties.
For more information on Firebug Lite, see "TruClient Browser for IE" on page 561
Resolving Step Timeouts
Steps may timeout due to several reasons:
l
Application is responding slowly, possibly under load. This is actually an important test result.
l
Step Timeout is incorrect and should be modified via the Step section of the step properties.
l
The end event of the step is incorrect and the step is waiting for an event that does not occur.
The end event should be changed via the Step section of the step properties.
How to Resolve Object Identification Issues
Object identification presents one of the biggest challenges with recording and replaying Web 2.0
applications because objects which have been recorded can move or change content. When
recorded objects change dynamically during replay, TruClient can lose the ability to automatically
locate the object.
HP LoadRunner (12.00)
Page 519 of 1743
LoadRunner User Guide
TruClient includes sophisticated mechanisms to overcome this challenge including the Highlight,
Improve Object Identification, Replace Object and Related Object, and Object Identification
Assistant options. The following steps describe the ways to use these mechanisms.
Note:
When identifying objects for applications that have been recorded in multiple
windows, make sure that the correct window is selected in the TruClient Sidebar > Window
Tab > Replay Window.
Highlight, Improve Identification, Replace, and Related Objects all require the user to select an
object in the application. There are cases in which various actions are required in the application to
make the object visible such as mouse over and mouse click. In these cases use the CTRL+ALT+F4
to suspend the TruClient object selection mode until you've brought the object into view and press
CTRL+ALT+F4 again to select the object.
Tip: After you perform any of the changes, replay the single failed step in question and only
afterwards replay the whole script again. This will help verify whether the change has solved
the issue you encountered.
The following steps describe the ways to resolve object identification issues.
Highlighting an object
Regardless of which method of object identification is used, you can use the highlight
button,
located in the Object section of the step, to check if an object is visible in the application at any
time. If the object is not found this may be an issue of pacing and timing. If the object cannot be
found, an error message is displayed.
Improve Object Identification
If the Highlight option fails, use the Improve Object Identification.
This option is located in the Object section of the step, next to the ID Method drop-down. This will
let TruClient relearn the properties of the object and compare them to the properties learned during
recording. Based on the differences, the necessary adjustments can be made. Depending on how
dynamic the application is, you may need to use the Improve Object Identification function more
than once.
Once you have done this, try replaying the step again to verify that the problem has been solved.
Alternative Steps
Alternative steps allow you to view instances in which there are multiple ways to perform the same
HP LoadRunner (12.00)
Page 520 of 1743
LoadRunner User Guide
action in a step. If Improve Object Identification fails, try using one of the alternative steps.
For example, you may be clicking on an option in a drop-down list in which the text changes based
on some value.
If you try to click based on the text, the step may fail.
If you use an alternative step that selects the item in the list based on the ordinal value of the option
within the list, the click will succeed regardless of the text.
Note: Before selecting one of the alternatives, try highlighting the object used by the
alternative step and replaying it. This way you can make sure the alternative step is replaying
the necessary action.
Modify the Object Identification Method
You can modify the way TruClient identifies the object by modifying the object identification method
in the Object section of the step properties. The following options are available:
l
Automatic. TruClient's default object identification method. The Automatic method allows
TruClient to use its internal advanced algorithms to locate the object. If this method does not
successfully find the object during replay, click the Improve Object Identification button and
replay the script again.
l
XPath. If Automatic identification fails, even after using Improve Identification or Related
Objects (described below), try using the XPath identification method. This method identifies the
object based on an XPath expression that defines the object in the DOM tree. Click the dropdown arrow next to the XPath edit box to select a suggested XPath for the object. You can
manually modify the suggested path. To revert to one of the original expressions generated by
TruClient, select one of the options from the drop-down again.
For example, if you need to select the first search result, regardless of the term being searched
for, using XPath identification may help.
l
JavaScript. JavaScript code that returns an object. For example: document.getElementById
("SearchButton") returns an element that has a DOM ID attribute of "SearchButton".
Using the JavaScript identification method you can write JavaScript code that references the
returned document and can use CSS selectors and other standard functions.
For example, the page returned by the server contains multiple links with the same "title" attribute
(search results) and we want the script to randomly click on one of the available links.
Object identification for this case, using the JavaScript identification method, may look something
like this:
var my_results = document.querySelectorAll('a[title="SearchResult"]');
random(my_results);
Modify the script timing
Sometimes objects may not be found because of timing and synchronization issues. For example,
HP LoadRunner (12.00)
Page 521 of 1743
LoadRunner User Guide
the script may be looking for an object that was in the application, but the script replayed too quickly
and already progressed to another page. If you suspect that the object is not being found because of
a timing or synchronization issue, you can insert Wait steps. For more information, see "How to
Debug TruClient Scripts" on page 517.
Relating objects to other objects
If the Improve Object Identification function does not solve the issue and neither do any of the
alternative steps, try using the Related Objects option.
If an object becomes difficult to identify on its own, you can label the object based on a different,
more stable object. For example, you can select an object which is not dynamic and "relate it" to the
target object. Relations are defined visually, relating objects according to their distance in pixels
from other objects. Relations are defined per ID method, per object. If more than one relation is
defined for an ID method of a given object, both relations must locate the same object for the step to
pass. TruClient then uses this object to help locate the target object. To use this function, expand
the step, select Object > Related Objects, and click the add button . Follow the directions to
create a relation. Verify that it has worked by highlighting both the object and its related object.
Tips:
l
Use this feature only if other identification methods have failed as it may be more resource
intensive.
l
Use the minimum search area to improve performance.
l
Related Objects are sensitive to window sizing. Resizing may alter object positions and
relationships. This should be taken into account.
l
Each identification method (Automatic, XPath, and JavaScript) has its own set of related
objects. These related objects are not shared between identification methods.
l
If several relations exist they all need to be found in order for the identification to succeed.
Replacing an object
If you selected the wrong object during recording, or an object has permanently changed, you can
replace it with a different object without replacing the step. This effectively resets the step, deleting
changes made to the original step such as relations. Expand the step, select Object, and click the
Replace button
. Select the new object and replay the script.
Replace Object will tell TruClient that the object currently referenced in the step is incorrect.
TruClient will remove any current knowledge of the object and learn the object you select.
Therefore, you should only use the Replace Object option if the object you used during recording
was the wrong one.
Object Identification Assistant
Object identification can fail during replay for several reasons. For each reason, TruClient will
launch the object identification assistant to try to resolve failed identification.
HP LoadRunner (12.00)
Page 522 of 1743
LoadRunner User Guide
Cannot confirm object
TruClient suspects a specific object to be the desired object but it cannot be positively identified.
The suspected object is highlighted on the screen, and the following assistant dialog box appears:
Options:
l
l
l
Yes. The suspected (and highlighted) object is the correct object.
Locate. The suspected object is not the right object. You will need to identify the correct object
in the application.
Cancel. Stop the replay.
Multiple objects found
TruClient found several objects that match the identification of the desired object. All suspected
objects will be highlighted on the screen, and the following assistant dialog box will appear:
HP LoadRunner (12.00)
Page 523 of 1743
LoadRunner User Guide
Options:
l
The correct object is one of the marked objects. Click the object in the application to specify the
correct one.
l
Locate. The suspected object is not one of the highlighted objects.You will then need to highlight
the correct object in the application.
l
Cancel. Stop the replay.
Object not found
TruClient could not find the desired object. The following assistant dialog box will appear:
Options:
HP LoadRunner (12.00)
Page 524 of 1743
LoadRunner User Guide
l
Locate. Locate the object. You will need to highlight the correct object in the application.
l
Cancel. Stop the replay.
Wrong level on step
TruClient found that a step in a higher level is needed for the identification of the object of current
step. This is common for mouse over steps that are usually recorded in level 3 but might be needed
for click steps that are recorded in level 1.
When TruClient recognizes this dependency during recording, the mouse over will move
automatically to level 1.
When TruClient recognizes this dependency during replay, the following assistant will appear:
Options:
l
l
Yes. Move the needed step to level 1.
Cancel. Stop the replay.
Troubleshooting Object Identification Issues
How Related Objects Can Help the XPath and JavaScript Identification
Methods
The XPath and JavaScript identification methods may return multiple elements depending on the
expression used.
For example, if the XPath value is //button, and the web page in question includes multiple button
elements, multiple objects will be returned.
To return a single object you can add a Related Object that will narrow down the identification.
HP LoadRunner (12.00)
Page 525 of 1743
LoadRunner User Guide
Interactive Replay Fails with Object Not Found Error
If replay stops with an error that says the object was not found try the following:
l
Select the failed step and press Highlight. If the correct object is not highlight use Improve
Identification to improve object identification.
l
If the object is highlighted it may be that step was reached before the object appeared. Add a
Wait or Wait for Object step before the problematic step.
Sometimes you may need to choose an Alternative Step that is provided in order to solve the issue.
For example, you may be clicking on an option in a drop-down list in which the text changes based
on some value. If you try to click based on the text, the step may fail.If you use an alternative step
that selects the item in the list based on the ordinal value of this option within the list, the click will
succeed regardless of the text.
Interactive Replay Fails Due to Object Not Found Although Highlight
Locates the Object
If the replay fails even though the Highlight option finds the correct object, this may be a case of
pacing.
The object takes a little longer to load and the step is executed faster. Therefore, during execution
the step cannot locate the object although, during debugging, the Highlight option on the failed step
finds the object.
In this case it is recommended to "slow down" the script so there is enough time for the object to
load. Use one of the following options to do this:
l
Change the Object Timeout of the failing step. This is available via the Step section on the
step's properties.
l
Add a Wait or Wait for Object step before the failed step.
Replay Fails to Select an Item from a List
One of the common reasons for this is that the names of the items in the list are dynamic.
For example, the list may include a list of cities based on the text entered so far (auto-complete).
Based on the text types the list constantly changes.
There are two ways to solve this issue:
l
Use an alternative step that selects an item from the list using the ordinal identifier instead of the
text of the actual item.
l
If the text is only partially dynamic you can use a regular expression to locate the required item
based on partial text matching.
HP LoadRunner (12.00)
Page 526 of 1743
LoadRunner User Guide
Troubleshooting TruClient Scripts
How to Check for Specific Text Including Branching
One option is to add a Verify step from the Functions section of the Toolbox. In this step you can
select various validation settings such as the object, the text to look for, and so on.
When you want to perform certain actions based on whether a validation succeeded or failed you
add a Catch Error step from the Flow Control section of the Toolbox.
This way you can make sure the step continues even if the validation failed and within the Catch
Error group you can define the set of steps that should be executed if the validation fails.
You can also take a more programmatic approach to validations. Using JavaScript you can access
the DOM and validate any property you wish to verify. You can then add a conditional Break or Exit
step (available via the Flow Control section of the Toolbox) based on this verification.
You can also check for the required text directly from the IF statement. The 'condition' argument of
the IF statement is simply JavaScript code. You can use JavaScript code that accesses the
window global object of the application under test. This can be done by referring to window.
Then you can manually verify if the text exists within the current page. For example, assuming a
single frame application, you can write something like:
window.document.body.textContent.indexOf("Off") == -1
Where "Off" is the text you're looking for and -1 indicates that the text was not found.
The code in question is application specific.
You can optimize the code if you have further knowledge of the application (by getting the specific
element).
How to Check for Specific Text that is Case Insensitive
By default, the Verify step is case sensitive. For example, looking for 'Test' will fail if 'test' is found.
If you would like the Verify step to be case insensitive do the following:
l
In the Verify step set the Condition argument to "Regular Expression"
l
To check if the string 'test' is contained in the text regardless to case you can use:
RegExp("test", "i")
How to Select a Random Option from a List
Set the Ordinal argument to 0. TruClient will automatically select a random option from the list.
For example, let's assume you have an auto-complete list that shows a list of cities based on the
typed text. You've currently selected the second option and the step is: Select option #2 from City
autocomplete.
All you need to do is open the Arguments section of the step properties and change the Ordinal
argument to 0. The step will now be: Select a random option from City autocomplete.
HP LoadRunner (12.00)
Page 527 of 1743
LoadRunner User Guide
This option is very important when the typed text is a parameter and therefore you have no easy
way of knowing in advance what values exist in the list and how many there are.
How to Use External Functions in the Script
Add your JavaScript and C functions to the JS-Function.js and C-functions.c files that are part of
the script and appear in the left navigation pane in VuGen.
JavaScript functions can be called directly from the TruClient script, as all arguments and
parameters support JavaScript. You can also add an Evaluate JavaScript or LR.evalC step from
the Toolbox for this purpose.
To call C functions add an Evaluate C step from the Toolbox.
Some of the Events and Actions do not Appear in the Recorded Script
Try solving this in one of the following ways:
TruClient records all the events in the application. The event you're looking for may be in a
different script level from the one being displayed.
l
n
You can tell that additional steps exist in other script levels if the steps in the viewed level are
not numbered consecutively.
n
The current script level is set using the slider in the toolbar:
Try looking for the missing event or step in the other levels by changing the slider value.
n
Once you have found the required event, you can change its level and make it part of level 1.
n
Change the script level back to level 1 and try to replay it again.
You can manually add a step to the script.
l
n
From the toolbox select the Generic Object Action and customize the step to perform the
required action.
Dragging of a Slider or a Map does not Replay Correctly
If drag does not work (e.g. set option of slider, drag of map) and the result does not bring the control
to the appropriate place try the following:
l
Try using one of the Alternative Steps.
l
Set the values manually until they meet your needs (e.g. the precise number of pixels you would
like to drag in each of the relevant directions).
l
Try using the "Drag to" capability (by changing the Action of the Drag step in the Step section of
the step properties). This way you can drag your object to a relative position from another object.
Polling for an Object
Create a loop that includes the following steps:
HP LoadRunner (12.00)
Page 528 of 1743
LoadRunner User Guide
l
A step that performs an action on an object.
l
A Catch Error section that includes a Continue step.
l
A Break step.
The Catch Error section will make the loop continue until the object is found and the step succeeds.
How do I Create a WHILE Loop
A "For" loop has 3 arguments: Init, Condition, and Increment.
A "While" is basically a "For" loop with only the Condition argument.
To create a while loop add a "For" loop (using the context menu or the toolbox), delete the Init and
Increment arguments and specify the Condition.
HP LoadRunner (12.00)
Page 529 of 1743
LoadRunner User Guide
HP LoadRunner (12.00)
Page 530 of 1743
LoadRunner User Guide
TruClient - Enhancing a TruClient Script
TruClient Event Handlers
Event handlers are designed to manage events that can occur at any time during the run of the
script. The event trigger is set to an object appearing in the application with or without an additional
specified property. The handler (action) of the event is a function selected from the script’s function
libraries.
During the replay of the script, when moving from one step to the next, TruClient checks to see if a
defined event occurs and if it does, it runs the function associated with the event.
The flowchart below illustrates the Event Handler workflow using the business process example of
buying and selling of stocks.
HP LoadRunner (12.00)
Page 531 of 1743
LoadRunner User Guide
For details, see :
HP LoadRunner (12.00)
Page 532 of 1743
LoadRunner User Guide
l
" How To Use The Events Handler" on page 536
l
" TruClient Events Handler Editor Dialog Box" on page 544
TruClient Functions and Function Libraries
A TruClient function is a group of steps, such as a login, that you define as a function. Functions are
stored in libraries that can be reused multiple times in a script. Each library can contain multiple
functions.
Each library can be either local or global. A local library can be accessed by the script that created
it. A global library can be accessed by all TruClient scripts. Additionally, a global library can be
saved on the network and shared between many users.
For details on creating and using function and function libraries, see "How To Create and Use
Function and Libraries" on page 542.
Working With JavaScript in TruClient Scripts
The following section contains tips for recording TruClient scripts.
JavaScript Support
The arguments listed in the Arguments section of each step are all JavaScript based and can
accept JavaScript expressions which will be evaluated during script replay. It is important to
remember that to provide a string value, quotation marks are required. For example: City will be
interpreted as a variable whereas "City" or 'City' will be evaluated as a string.
All other sections such as Step, Object, Transactions, are not JavaScript based, are not evaluated
as JavaScript, and do not support JavaScript expressions. The only exception is object
identification using JavaScript.
However, object identification variables and step variables do not share the same context.
Variables that are defined in one context are not recognized in the other. To use a variable in object
identification that is defined in a step, add the prefix ArgsContext before the variable name. For
example, if the variable firstname is defined as a value for an argument of a step, it cannot be used
in object identification. To use the firstname variable in object identification, refer to the variable as
ArgsContext.firstname.
How Can I Learn More about JavaScript
JavaScript is the scripting language of the Web. JavaScript is used in millions of Web pages to add
functionality, validate forms, detect browsers, and much more. The Internet is full of resources for
learning JavaScript and can be located using search engines.
An example of some tutorials and references:
HP LoadRunner (12.00)
Page 533 of 1743
LoadRunner User Guide
http://www.javascriptkit.com/jsref/
http://www.w3schools.com
http://www.learn-javascript-tutorial.com/
Using Regular Expressions
To use regular expressions, there are two options:
l
Use the '/' notation: Replace the quotation marks of a string with a slash.
For example:
/LoadRunner/ is a regular expression that will match any string that contains the word
"LoadRunner" in it.
l
If you need to dynamically create a regular expression (e.g. using a parameter), you can use the
regular expression constructor and specify the string. For example, the equivalent of the above
example is RegExp("LoadRunner").
The full list of supported regular expressions can be found here:
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
How to Enhance TruClient Scripts
There are a number of optional enhancements that can be added to scripts beyond the basic
workflow. This task describes the enhancements and how to use them.
Modify Steps
Modify step arguments and objects by selecting the desired step and expanding the options. This
expands the step and allows you to modify the objects and properties. For a detailed list of the step
structure, see "TruClient Toolbox" on page 558.
l
Insert Flow Control Steps
Loops repeat selected portions of the script until certain criteria is met or for a specified number
of times. To insert a loop, select Toolbox > Flow Control > For loop. For more information,
see " How to Insert and Modify Loops" on page 538.
l
Insert If blocks or If-else blocks and exit steps
To conditionalize a portion of the script, you can insert If or If-else blocks. To insert an If block,
select Toolbox > Flow Control > If block. To add an else condition, click the Add else link
next to the If step title. For more details, see " TruClient Step Arguments" on page 579.
Exit steps cause a script to exit the iteration or the entire script. These can be used with If
statements to exit a script or iteration when a specified condition occurs. To insert an exit step,
select Toolbox > Flow Control > Exit.
HP LoadRunner (12.00)
Page 534 of 1743
LoadRunner User Guide
Insert comments
You can insert comments into your script by selecting Toolbox > Misc and dragging the Comment
icon to the desired location.
Insert Transactions
You can add transactions by using the Transaction Editor. To open the Transaction Editor click the
Transaction Editor
button from the Home Tab or click Ctrl + Alt + F7. TruClient transactions
function differently from other protocols because of the asynchronous nature of TruClient steps.
Transactions are defined based on start and end steps and step events. Due to this definition, a
transaction's end can be triggered before the true end of a step.
If Run-time settings > Replay > enable profiling is selected, client side breakdown information
is display in the private browser for each transaction after the script is successfully replayed. For
details, see "TruClient Client Side Breakdown Data" on page 547.
Create Parameters
Parameters for TruClient scripts can be created in the standard method as for all protocols.
Parameters can be referenced and created within step arguments or Eval JavaScript steps.
To parametrize a value:
1. Select a field in the step Arguments area.
2. Highlight either the entire string or part of the string.
3. Right-click and select Replace with a Parameter.
4. In the Enter Parameter Name dialog box, enter the name of a new or existing parameter.
If the parameter does not exist in the Parameter List, it is created and the default parameter type is
set to File. You can go to the Parameter List to add or delete values for the specified parameter.
By default, the original value is included in the list of values for the new parameter. For details, see
"How to Work with Existing Parameters" on page 416.
The following is an example of how to use a parameter in your script. This string can be used as the
Argument in an Evaluate JavaScript step:
During replay it returns the current value of the parameter paramname.
LR.getParam("paramname")
During replay it assigns the parameter paramname the value value1.
LR.setParam("paramname", "value1")
For example, let us assume we have an auto-complete list that has a different set of values based
on the text that's typed.
Trying to select an option in the list based on the text of the option is bound to fail once the typed
text is defined by a parameter. The options are changed every time the parameter value is updated.
In these cases the step that uses an ordinal value is more appropriate.
HP LoadRunner (12.00)
Page 535 of 1743
LoadRunner User Guide
For more details on parameters, see the section on "Parameters" on page 408.
Insert Catch Error Steps
Catch error steps are group steps that run their contents if the previous step contains an error.
Additionally, the error is "caught" and is not returned. You can define catch error steps to catch any
error, or a specific type of error. If there are two catch error steps in a row, they both apply to the
same step. To insert a catch error step, select Toolbox > Flow Control > Catch Error.
Verify that an objects exist
To verify that a string or object exists in the application, you can insert a verify step:
1. Select Toolbox > Functions and drag the Verify icon to the desired location.
2. Click the object in the verify step.
3. Select the object you want to verify.
Insert Generic Steps
You can insert a blank step and manually configure it. To insert a generic step, select Toolbox >
Functions > Generic Object/Browser Action,drag and drop the step to the desired location.
Next, expand the step, and enter the desired step properties. Generic Object Actions perform an
unspecified action on an object. Generic Browser Actions perform an unspecified action on the
browser such as go back, reload and switch tabs.
How To Use The Events Handler
This task describes how to create and use events with the Global Events Handler. For an
illustration, see " TruClient Event Handlers" on page 531.
Prerequisites
The Global Events Handler runs functions if a certain event occurs during the replay of the script.
Before you create handlers, you must create the associated functions. For details, see "How To
Create and Use Function and Libraries" on page 542.
Create an Event Handler
1. Click the
button from the TruClient Toolbar. This will open the Event Handler Editor
HP LoadRunner (12.00)
Page 536 of 1743
LoadRunner User Guide
.
2. Click the
button from the Event Handler pane.
3. Define the properties of the handler.
You can specify if you want the handler to run at any time during the script or only between
certain steps. For details on this and other properties, see " TruClient Events Handler Editor
Dialog Box" on page 544.
Define object associated with event
Select the object in the application with the
occur.
button on which the event will
For example, select the text box for the widget StockPrice if you wish to trigger the function
SellStock, if the stock prices rises over $99.99.
Once the object is selected you can select the
button to verify that the correct object
was selected. Additionally, you can select the
button to replace the selected object with
another one. For details, see "How to Resolve Object Identification Issues" on page 519.
HP LoadRunner (12.00)
Page 537 of 1743
LoadRunner User Guide
Define the event
You can select to run the handler if the object exists or if, object's properties meet specific
conditions. For details, see " TruClient Events Handler Editor Dialog Box" on page 544.
Assign handler to the event
Select the function library, the function and specify argument values. For details, see " TruClient
Events Handler Editor Dialog Box" on page 544.
Enable the handler
To enable the handler during script replay, select the check box next to the handler in the Event
Handler Pane.
How to Insert and Modify Loops
Loops repeat selected portions of the script until certain criteria is met or for a specified number of
iterations. You can insert loops and loop modifiers from the Flow control section of the Toolbox.
.
For Loops
For loops perform the steps surrounded by the loop until the end condition is met or the code
reaches a break statement. Loops arguments use JavaScript syntax. To insert a for loop, select
Toolbox > Flow Control >Functions > For Loop.
Break statements
Break statements indicate that the current loop should end immediately. For example, if a break
statement is encountered in the second of five iteration in a for loop, the loop will end immediately
without completing the remaining iterations. To insert a break statement, select Toolbox >
Functions > Flow Control > Break.
Continue statements
Continue statements indicate that the current loop iteration should end immediately. The loop
condition is then checked to see if the entire loop should end as well. For example, if a continue
statement is encountered in the second of five iterations in a for loop, the second iteration will end
immediately and the third iteration will begin. To insert a continue statement, select Toolbox >
Functions > Flow Control > Continue.
HP LoadRunner (12.00)
Page 538 of 1743
LoadRunner User Guide
How to Insert Custom JavaScript and C Code into
TruClient Scripts
This task describes how to insert code into an TruClient script. You can insert code into a preexisting step as part of a step argument or insert steps that are completely comprised of external
code (C or JavaScript).
1.
Insert code into a pre-existing step
You can insert JavaScript code into pre-existing steps in the arguments fields of most steps.
This allows you to perform multiple customizations.
2.
Insert steps composed entirely of code
You can insert steps comprised entirely of code into your script. To do so, select Toolbox >
Miscellaneous and drag the Eval Javascript, Eval C, or Eval JS on Object icon to the
desired location. The Eval JS on Object step runs the JavaScript code after the specified
Object has loaded. We recommend avoiding Eval C and using JavaScript instead wherever
possible. You can refer to this object as the variable "object" in the JavaScript code within the
step.
Example:
The following code creates a variable called amount that generates a random number between
1 and 5. You can then use this variable in the argument fields of other steps.
var amount=Math.floor(Math.random()*5)+1;
How to Use VTS in TruClient
This task describes an example of how to use VTS in a TruClient script.
What is VTS?
l
HP LoadRunner Virtual Table Server - or VTS for short - is a web-based application that is
built to work with LoadRunner Vuser scripts. VTS offers an alternative to standard
LoadRunner parameterization.
l
When you use standard LoadRunner parameterization, each Vuser is assigned parameter
values from a dedicated set of values - parameter values are not shared between Vusers. In
contrast, VTS enables you to assign parameter values from a single set of parameter
values to multiple Vusers. This may enable you to more accurately emulate a real-user
environment.
l
VTS includes a table that contains parameter values that can be used by your Vuser
scripts. The VTS table is composed of columns and rows. Each column represents a set of
values that can be used by a specific parameter in your Vuser scripts. The cells within a
column contain the actual values of the parameter.
HP LoadRunner (12.00)
Page 539 of 1743
LoadRunner User Guide
How to connect/disconnect to a VTS server
1. Select Toolbox > Miscellaneous and add a
step to your script.
2. To connect to a VTS, enter TC.vtcConnect(“server”,port,"alias") in the Arguments >
Code section of the step.
You can identify the server either by name or by ip address.
Example: TC.vtcConnect("myServer",8888,"myVTS");
3. To disconnect from a VTS, enter TC.vtcDisonnect("alias") in the Arguments > Code section
of the step.
Tips:
l
Before you replay the script, play the TC.vtcConnect step (from within the step) to verify
the connection to the VTS server.
l
Once you have established a connection to the VTS server, you can play other VTS API
steps, modify them and replay again.
l
Replaying the entire script will automatically disconnect the VTS even if there is no
disconnect step in your script.
Examples of connecting and disconnecting to a server:
l
Using a server name and alias
TC.vtcConnect(“MyServer”,8888,”UsersTableVts”);
TC.vtcDiscconect(“UsersTableVts”);
For details on the use of aliases, see "How to Use VTS in TruClient" on the previous page .
l
Using the server ip address and alias
TC.vtcConnect(“192.168.1.133”,8888,”WorkersTableVts”);
TC.vtcDiscconect(“WorkersTableVts”);
l
Using the server name without an alias
TC.vtcConnect(“MyServer”,8888);
TC.vtcDiscconect();
l
Using the server ip address without an alias
HP LoadRunner (12.00)
Page 540 of 1743
LoadRunner User Guide
TC.vtcConnect(“192.168.1.133”,8888);
TC.vtcDiscconect();
Why do you need an alias for your VTS server?
If you are using more than one server, creating an alias for each server will simplify identifying
which VTS your are referencing in your code.
Examples:
In the connect statement below, "UserTableVts" is an alias for "MyServer".
TC.vtcConnect(“MyServer”,8888,”UsersTableVts”);
In the example below, we are connecting to two VTS servers and disconnecting, by alias, to
the first one:
TC. vtcConnect("MyServer", 8888, "UsersTableVts");
TC.vtcConnect("MyServer1",8888, "ScriptDataVts");
TC.vtcDisconnect("UsersTableVts");
How to use Eval JavaScript code step to pass VTS parameters to another
step.
You can use the Eval JavaScript code step to pass VTS parameters to another step in your script.
The example below shows you how to parametrize a URL.
1. Connect to a VTS server
a. Select Toolbox > Miscellaneous and add an
step to your script.
b. To connect to a VTS, enter TC.vtcConnect(“server”,port,"alias") in the Arguments
> Code section of the step.
2. Create a step that contains a variable.
a. Select Toolbox > Miscellaneous and add an
step to your script.
b. In Argument > Code section enter define your variable.
For example, to get data from the server enter var ws = TC.vtcGetCell("Web
Sites",1,"alias");
3. Select Toolbox > Functions and add a Generic Browser Action to your script.
4. Enter the variable you defined in Step 2 in Argument > Location .
How to use a VTS API function directly in a step.
You can use the Eval JavaScript code step implement a VTS API in your script. The example
HP LoadRunner (12.00)
Page 541 of 1743
LoadRunner User Guide
below shows you how to parametrize a URL.
1. Connect to a VTS server
a. Select Toolbox > Miscellaneous and add an
step to your script.
b. To connect to a VTS, enter TC.vtcConnect(“server”,port,"alias") in the Arguments
> Code section of the step.
2. Select Toolbox > Functions and add a Generic Browser Action to your script.
3. Enter TC.vtcGetCell("Web Sites",1,"alias");in the Argument > Location section of the
script..
How To Create and Use Function and Libraries
This task describes how to create and use function libraries and functions in TruClient Scripts.
Create a function library and function from the TruClient sidebar
1. Select Functions from the drop-down list in the TruClient tab.
2. Select an existing library from the
drop-down or click the
button
from the Function toolbar to create a new library.
3. Click the
4. Click the
button to create a new function. This will insert a new unspecified function.
button to expand the function.
5. Define the step including function name and end event.
6. Define the function arguments using the Argument Editor. Argument names should be
meaningful so that when you are using the function it is clear what value you need to specify.
7. Define the transaction using the Transaction Editor. For details, "Transaction Editor Dialog
Box (TruClient)" on page 550.
Create a function within a script
1. Highlight the steps in the script to include in the function. To select multiple steps, press CTRL.
2. Right-click on a highlighted step and select Group Into > Function which opens the Create a
New Function dialog box. For details, see "Create New Function Dialog Box" on page 549.
3. To assign steps that contain arguments, expand the argument section, and insert the function
FuncArgs.<argument name>. .
HP LoadRunner (12.00)
Page 542 of 1743
LoadRunner User Guide
Tip: To insert javascript as the argument value, click the
Javascript editor.
button to access the
Create a global library
1. Select Function Libraries from the drop-down from the TruClient Sidebar.
2. Select an existing library from the
drop-down in the TruClient
Sidebar.
3. Click the
button to export the library to a location on your file directory as an xml file.
Using the copy paste operation in global libraries
Pasting steps that contain test objects from a local script or a local library to a global library creates
separate test object that refer to the same UI element. If you change or update one of the test
objects in the global library or in the script, you will need to manually update the other test object
that refers to the same UI element.
Examples:
1. Global library “GlobLib” contains step A with a test object “Foo” that relates to the application.
Script also contains step B with a test object “Foo” that relates to the application.
If you copy step B and paste it too “GlobLib there are two different test objects in “GlobLib” that
related to “Foo”. Therefore, if you change or update one of them you should consider changing
the other one manually.
2. Global library “GlobLib” contains Step A with a test object “Foo” that relates to the application.
Script has steps B and C with a test objects "Foo" that relates to the application. If you copy
steps B and C to “GlobLib” there are two different test objects in “GlobLib” that relate to “Foo”.
Note:
l
When working with a global library, you can save changes to the library by clicking the
button.
l
If you save the library to a network location, other users can click the
the library.
l
Click the
button to disconnect the library from global mode. Any changes that you make
in local mode are saved within the script.
button to import
Use a function in the script
HP LoadRunner (12.00)
Page 543 of 1743
LoadRunner User Guide
1. Click the TruClient Toolbox tab.
2. Select the Functions tab.
3. Drag and drop Call Function to the correct location in your script.
4. Click the Call Function link to expand the function.
5. Specify the library and the function in the step section.
6. Specify the arguments' values in the augments section. For details, see "Create a function
within a script" on page 542. (Optional)
7. Specify transactions in the transaction section. (Optional) For details, see "Transaction Editor
Dialog Box (TruClient)" on page 550.
How to Display Client Side Breakdown Data for
TruClient Scripts
This task describes how to display client side breakdown data associated with transactions in a
TruClient Script.
1.
Enable Profiling
Select Run-time Settings > Replay > Enable Profiling
2.
Create and record a FireFox TruClient script
For details, see" How to Develop TruClient Scripts" on page 511
3.
Insert transactions
You can add transactions by using the Transaction Editor. To open the Transaction Editor click
the Transaction Editor
button from the Home Tab or click Ctrl + Alt + F7."Transaction Editor
Dialog Box (TruClient)" on page 550
4. Replay script
Results
A browser window opens displaying the client side breakdown data. For details see, "TruClient
Client Side Breakdown Data" on page 547
TruClient Events Handler Editor Dialog Box
This dialog box enables you to define events handlers and its properties.
HP LoadRunner (12.00)
Page 544 of 1743
LoadRunner User Guide
To access
Click the
button from the TruClient sidebar.
Important
information
Events handlers are designed to handle events that can occur at any time
during script replay.
Relevant tasks
" How To Use The Events Handler" on page 536
"How To Create and Use Function and Libraries" on page 542
See Also
" TruClient Event Handlers" on page 531
User interface elements are described below:
UI
Element
Event
Handler
Pane
Description
Add Event Handler. Add an event to the event handler.
Delete Event Handler. Delete an event from the event handler.
HP LoadRunner (12.00)
Page 545 of 1743
LoadRunner User Guide
UI
Element
Description
Properties General
l
Name. Enables you to name the event.
l
Execute only once. Execute the event once.
l
Allow other handlers to interrupt. Select check box to enable other events to
run during the run of this event.
You can select either:
l
Event can be triggered during the entire script. Enable event to be triggered
during entire script.
or
l
Start Step. Enables you to select a start step from which point the event handler
can be triggered.
l
End Step. Enables you to select a end step after which the event handler
cannot be triggered.
Object
l
Enables you to select an object from your
application that will trigger the event handler.
l
Roles. Displays the roles which determines what operations can be done on the
object. For example, an “element” role has operations like “click” and “mouse
over". The “textbox” role will also have a “type” operation.
Other roles: element, foucasable, textbox, check box, filebox, radiogroup,
listbox, multi_listbox, slider, datepicker, video, audio, browser.
l
Name. Enables you to specify the name of the object.
l
ID Method
Automatic (Recommended). Enable TruClient to resolve object identification.
XPath. Enables you to insert an xpath query to identify the object
JavaScript. Enables you to insert JavaScript code to identify the object.
l
Related objects. Enables you to associate your object with another object in
your application that facilitates object identification during replay.
HP LoadRunner (12.00)
Page 546 of 1743
LoadRunner User Guide
UI
Element
Description
Event
Event type
l
You can select between two event types:
Object Exists. If object exists during replay, the event handler is triggered.
Property exists on Object. If the property of an object meets the defined
criteria, the event handler is triggered.
Handler
l
Library. Enables you to select the library containing the function.
l
Function. Enables you to select the function.
l
Arguments. Enables you to specify the argument values.
TruClient Client Side Breakdown Data
The browser window displays client side breakdown information in interactive mode for each
transaction in your script.
Important
Information
Relevant
tasks
l
Select Run-time settings > Replay > Enabling profiling before you replay
your script.
l
If you create a Controller scenario with your script, the Client Side Breakdown
results can be viewed in Analysis. For details, see "Client Side Breakdown
(Over Time) Graph" on page 1519 or "Client Side Java Script Breakdown (Over
Time) Graph" on page 1520
"How to Display Client Side Breakdown Data for TruClient Scripts " on page 544
User interface elements are described below:
Client Side Breakdown
UI Element
HP LoadRunner (12.00)
Description
Page 547 of 1743
LoadRunner User Guide
Client Side Breakdown, continued
JS Time
Measured JavaScript run time
The following data elements are returned for
each transaction:
Name. The function name.
File.The name of the JS file where the function
exists.
Calls. Log of the execution stack and drill down
to the function calls during the transaction.
Total Execution Time. Time elapsed after each
function call including its inner function calls.
Total Own Execution Time. Time elapsed after
each function call excluding its inner function
calls.
Max Recurse Depth. Function's maximum
calling stack depth.
Min Execution Time. Function's minimum run
time including its inner function calls.
Max Execution Time. Function's maximum run
time including its inner function calls.
Min Own Execution Time. Function's
minimum run time excluding its inner function
calls.
Max Own Execution Time. Function's
maximum run time excluding its inner function
calls.
Network Time
Measured network activity
The following data elements are returned:
URL. The URL of the page resource.
Start Time. Start time of the transaction on the
network
End Time. End time of the transaction on the
network.
Duration. Total duration of the transaction on
the network.
HP LoadRunner (12.00)
Page 548 of 1743
LoadRunner User Guide
Client Side Breakdown, continued
Wait Time
Wait time during transaction
Wait time is defined as pacing + minimum time +
wait step.
The following data elements are returned for
each transaction:
Start. Start time of wait time.
Type. Either pacing, minimum time, or wait
step.
End. End time of wait time.
Duration. Total wait time duration measured in
milliseconds.
Total Time
Total transaction time (in milliseconds) = JS +
Network + Wait
Note: JS + Network or Network + Wait can
overlap so, Total Time it might not be the
sum of JS + Network + Wait.
Create New Function Dialog Box
This dialog box enables you create a new function and assign the function to a library.
To access
Right click on a highlighted step in the script, and then select Group Into > New
Function.
Relevant
tasks
"How To Create and Use Function and Libraries" on page 542
HP LoadRunner (12.00)
Page 549 of 1743
LoadRunner User Guide
User interface elements are described below:
UI Element
Description
Function Name
Enables you to specify a function name.
Add to library
l
Select Existing. Save new function to an existing library.
l
Create New. Save new function to a new library.
Replace steps with
function call
If selected, TruClient will automatically insert a call function in
place of steps.
Transaction Editor Dialog Box (TruClient)
This dialog box enables you to manage transactions in TruClient Vuser scripts.
To access
Click on the
from the TruClient Sidebar
Important
If you add a wait step inside a transaction in an TruClient Script, the log will detail
information think time which is equal to wait time + pacing time + max(minimum time).
User interface elements are described below:
UI
Eleme
nt
Description
Adds a new transaction or deletes the selected transaction.
HP LoadRunner (12.00)
Page 550 of 1743
LoadRunner User Guide
Genera Enables you to edit the name of the transaction.
l
Start
Point
The step and the event which marks the start of the transaction.
An event can be one of the following:
l
Step started. The first event triggered when a step starts running. The event
triggered before the step action has started running and before any other activity
takes place.
l
Action started. This event occurs immediately after the Step started event and
signifies that the action to be performed has started. For example, the action might
be navigation to a URL or a button click.
l
Action completed. This event is triggered when the action to be performed has
completed. However, the step may not have ended yet. For example, for steps
related to the application, there might be additional network or DOM activity.
l
Step synchronous network completed. Step ends when all HTTP requests have
been completed excluding requests that are associated with open connections that
are not relevant to the step. Usually, these requests are triggered by using
XMLHttpRequest.
l
DOM content loaded. Step ends when the page's Document Object Model (DOM)
is ready. This means that the API for interacting with the content, style and
structure of a page is ready to receive requests from your application client side
code.
l
Document load. Step ends when the process of loading a document is completed.
This means that all scripts and stylesheets have finished loading and have been
executed, and all images have been downloaded and displayed.
l
Dialog opened. Step ends when a dialog box is opened.
l
Step completed.This event is triggered as soon as the work inside the step
container has completed. It is triggered only if the step completed successfully.
l
After step ended. The last event in the events chain, it occurs after Step
completed, but unlike Step completed it will be triggered regardless if the step
was completed successfully or not.
HP LoadRunner (12.00)
Page 551 of 1743
LoadRunner User Guide
End
Point
The step and the event which marks the end of the transaction.
An event can be one of the following:
l
Step started. The first event triggered when a step starts running. The event
triggered before the step action has started running and before any other activity
takes place.
l
Action started. This event occurs immediately after the Step started event and
signifies that the action to be performed has started. For example, the action might
be navigation to a URL or a button click.
l
Action completed. This event is triggered when the action to be performed has
completed. However, the step may not have ended yet. For example, for steps
related to the application, there might be additional network or DOM activity.
l
Step synchronous network completed. Step ends when all HTTP requests have
been completed excluding requests that are associated with open connections that
are not relevant to the step. Usually, these requests are triggered by using
XMLHttpRequest.
l
DOM content loaded. Step ends when the page's Document Object Model (DOM)
is ready. This means that the API for interacting with the content, style and
structure of a page is ready to receive requests from your application client side
code.
l
Document load. Step ends when the process of loading a document is completed.
This means that all scripts and stylesheets have finished loading and have been
executed, and all images have been downloaded and displayed.
l
Dialog opened. Step ends when a dialog box is opened.
l
Step completed.This event is triggered as soon as the work inside the step
container has completed. It is triggered only if the step completed successfully.
l
After step ended. The last event in the events chain, it occurs after Step
completed, but unlike Step completed it will be triggered regardless if the step
was completed successfully or not.
HP LoadRunner (12.00)
Page 552 of 1743
LoadRunner User Guide
The TruClient Sidebar
TruClient Home Tab
This tab enables you to control the basic flow of the recording process for TruClient scripts.
Actions
To access
Select Action from the drop-down list on the TruClient sidebar.
Relevant tasks
"TruClient Step Structure" on page 502
User interface elements are described below:
UI Element
Description
Record. Starts recording the script. Additionally, you can use the arrow to
specify whether to record before or after the selected step.
Play. Replays the script. Additionally, you can use the arrow to specify
whether to play the selected step only, or to run the script step by step.
Running the script step by step pauses the replay after each step. For more
information, see "How to Debug TruClient Scripts" on page 517.
Stop. Stops recording or replaying the script.
Toggle Breakpoint. Toggles breakpoints on the selected step.
Script Level. Modifies the script levels that are visible and replayed in the
script. For more information, see "TruClient Script Levels" on page 515.
/
Start/End Transaction. Inserts a starting or ending point for a transaction.
Transaction Editor. Opens the Transaction Editor, allowing you to define new
transactions and modify existing ones.
Save. Saves the script.
General Settings. Opens the General Settings dialog box. For details, see
"TruClient General Settings Dialog Box" on page 562.
HP LoadRunner (12.00)
Page 553 of 1743
LoadRunner User Guide
Snapshot View. Displays the Snapshot view in the right pane. Adds the
following elements to the right pane:
l
l
Snapshot Type. These buttons enable you to view snapshots taken during
different modes:
n Recording. Display snapshots that were taken for a specific step during
recording.
n
Interactive Replay. Display snapshots that were taken for a specific
step during interactive replay.
n
Load Mode Replay. Display snapshots that were taken for a specific
step during load mode replay
n
Play Slide Show. Display snapshots as a slide show.
n
Stop Slide Show.
View. You can select from the following views:
n
Single. Displays the snapshot for a single step.
n
Compare. Splits the screen so you can compare snapshots from
different modes. Use the Snapshot View buttons in each pane to select
which snapshots to view. Click the Synchronize Scrolling button
to synchronize scrolling between the panes. The snapshot error icon
indicates that the snapshot is not current for the step.
n
l
Thumbnails. Displays the snapshots in thumbnails view.
Previous/Next. Navigates to the screenshot for the previous or next
step. The corresponding step is highlighted in the script.
Opens the Event Handler Editor box. For details, see " TruClient Events
Handler Editor Dialog Box" on page 544
Functions
To access
Select Functions from the drop-down list on the TruClient Sidebar
Relevant tasks
"How To Create and Use Function and Libraries" on page 542
User interface elements are described below:
UI Element
HP LoadRunner (12.00)
Description
Page 554 of 1743
LoadRunner User Guide
Enables you to select the active library.
New Library. Enables you to create a new library.
Import Library. Import a function library from an xml file.
Export Library. Export a function library to an xml file.
Delete Library. Delete a function library.
New Function. Enables you to create a new function. For details,
see "How To Create and Use Function and Libraries" on page 542
Context Menu
To access
Select a step and right click to display the context menu.
Relevant tasks
"TruClient Step Structure" on page 502
UI Element
Description
<Replay
Actions>
Play This Step. Replay the selected step only.
<Record>
l
Before step. Insert the next set of recorded steps before the selected
step.
l
Into Step. Insert the next set of recorded steps into the selected group.
l
After Step. Insert the next set of recorded steps after the selected step.
Play From This Step. Replay the script from the selected step.
Toggle
Breakpoint
Insert/Remove a toggle breakpoint.
<Transaction
Steps>
l
Start Transaction. Insert a Start Transaction step into the script.
l
Surround With Transaction. Insert a Start Transaction and End
Transaction steps around a single or multiple steps into the scripts.
l
End Transaction. Insert an End Transaction step into your script.
HP LoadRunner (12.00)
Page 555 of 1743
LoadRunner User Guide
<Group
Actions>
Group Steps Multiple steps are grouped together as a single step.
Group Into Multiple steps are group into:
<Edit Actions>
Delete
l
If Clause. A logical structure that controls the flow of your script.
l
For Loop Clause . A logical structure that repeats the steps contained in
the loop a specified number of times.
l
New Function. A group of steps, such as a login, that you define as a
function
l
Cut. Cut select step from the script.
l
Copy. Copy selected step in the script.
l
Paste. Paste selected step into the script.
Delete a step from the script.
Disable/Enable Toggle between disabling or enabling a step during replay.
Edit Step
Expand the step to display step, argument and transaction properties.
Show
Step Numbers. Display step numbers.
Animations. Enable/disable step animation in the TruClient sidebar.
TruClient Edit Tab
This tab enables you to cut, copy, and paste steps and data in TruClient scripts.
To access
Select the Edit tab from the TruClient sidebar.
User interface elements are described below:
UI
Description
Element
Cut the selected data or step.
Copy the selected step or data.
HP LoadRunner (12.00)
Page 556 of 1743
LoadRunner User Guide
Pastes before the selected step.
Pastes after the selected step.
Pastes into the selected step.
Deletes the selected step
Opens the Find dialog box, allowing you to search the script for steps by step name or
number.
Note: You can create a step that is a group of sub-steps. If you are searching for
step that is a sub-step, you need to specify both the step group number and substep number. For example, enter 4.1 to search for the first sub-step in the fourth
(group) step .
Go to the specified step.
The following actions can be undone:
l
Cut
l
Copy
l
Paste
l
Delete
l
Group • Drag & drop (step)
l
Add step from the toolbox
The following actions can be redone:
l
Cut
l
Copy
l
Paste
l
Delete
l
Group • Drag & drop (step)
l
Add step from the toolbox
HP LoadRunner (12.00)
Page 557 of 1743
LoadRunner User Guide
Window Tab
This tab enables you to control multiple browser windows for the same script. Select the window
that contains the application that you want to bring to focus. This is needed for the debugging phase
of script development, for example, when attempting to highlight a step object.
TruClient Toolbox
The toolbox contains all of the steps that you can add to a TruClient script. The toolbox opens and
closes by clicking on the tab, and moves by dragging it up or down.
User interface elements are described below:
UI Element
Description
HP LoadRunner (12.00)
Page 558 of 1743
LoadRunner User Guide
Functions
Flow Control
l
Verify. Verify that an object exists in the application.
l
Wait. Wait for a specified number of seconds before continuing with the
next step.
l
Wait for Object. Wait for an object to load before continuing with the next
step.
l
Generic Object/Browser Action. Blank steps that can be inserted and
manually configured.
l
Call Function. Insert a custom function in the script. For details, see "How
To Create and Use Function and Libraries" on page 542.
l
For Loop. A logical structure that repeats the steps contained in the loop a
specified number of times.
l
If Block. A logical structure that runs the steps contained in the block if the
condition is met.
l
Add else. Click the Add else link to add an else section to your If block. If
the condition is not met, the steps included in the else section run.
l
Remove else. Removes the else section from the If block.
Note: If the else section contains steps and you click Remove else, the
steps are deleted. Copy and paste them into the main body of your script
to save them.
l
If exists. A combination of “If Block” and “Verify”, a logical structure that
runs the steps contained in the block if the condition on a property of the
selected object is met.
l
If verify. A logical structure that runs the steps contained in the block if the
selected object exists in the application.
l
Break. Causes the loop to end immediately without completing the current
or remaining iterations.
l
Continue.. Causes the current loop iteration to end immediately. The script
continues with the next iteration.
l
Catch Error. Catches an error in the step immediately preceding and runs
the contents of the catch error step. For more information, see "How to
Enhance TruClient Scripts" on page 534.
l
Exit. Exits the iteration or the entire script depending on the specified
setting.
HP LoadRunner (12.00)
Page 559 of 1743
LoadRunner User Guide
Miscellaneous
l
Evaluate JavaScript. Runs the JavaScript code contained in the step.
l
Evaluate JS on Object. Runs the JavaScript code contained in the step
after the specified object is loaded in the application.
l
Evaluate C. Runs the C code contained in the step.
l
Comment. A blank step which allows you to write comments in your script.
l
Rendezvous. Synchronize all Vusers in a Controller scenario to run a
specified step at the same time. For example, you may want to test the
impact of several users logging into your application at the same time.
Note: To insert a rendezvous step, drag it from the toolbox and place it
above the step you want to synchronize.
Browsers in TruClient
This section includes:
General Browser Settings (TruClient)
Each TruClient script is opened in a browser with a different profile. The browser profile saves user
data such as cookies, client certificates, history, cache, and so on. Make the changes in the
browser when interactively developing the script using TruClient. These changes will only apply to
the current script.
Browser options that affect interactive mode can be modified in the TruClient General Settings
dialog box. All of the settings in this dialog box are imported to each new script as it is created, but
only affect interactive mode. When the script is saved, these settings are also copied to the runtime settings as well.
Scripts that are run in load mode use the settings defined in the Load > Browser Settings node of
Run-time Settings dialog box. For details, see " Load > Browser Settings Node (Ajax TruClient)"
on page 338.
The Firefox extensions settings are imported to each script every time a script is opened in Firefox.
For details, see "TruClient General Settings Dialog Box" on page 562.
Some standard browser options are disabled. These include, but are not limited to, some File,
Bookmark, Tools, and Help options. To save bookmarks for use in your scripts, use the "TruClient
General Settings Dialog Box" on page 562.
Private Browsing (TruClient)
Private Browsing is a browser mode which allows you to browse without saving information about
your session. Some examples of items which are not saved are passwords, cookies, and history.
HP LoadRunner (12.00)
Page 560 of 1743
LoadRunner User Guide
To more accurately emulate real users,TruClient replays scripts in private browsing mode. This
ensures that the browser does not use saved session information when running a script more than
one time.
TruClient Browser for IE
The TruClient Browser for IE simulates the functionality of an IE browser. This enables you to
record and replay scripts as if you were working in an IE environment.
Note: The TruClient for IE protocol is designed to work with applications running in standard
mode only.
The TruClient engine depends on specific browser features, available in IE 9 or higher
versions, that are not supported by Internet Explorer prior to version 9 and are also not
supported in IE9 if backward compatibility mechanisms are in use.
For details on document and browser modes, see Browser modes.
Note: The TruClient browser for IE also requires read access to the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer
Firebug Lite
Firebug Lite is a third-party utility that provides many valuable development tools. You can edit,
debug, and monitor CSS, HTML, and JavaScript live in any web page. You can access this utility
by selecting Advanced > FireBug Lite or by pressing F12 while in TruClient's IE browser.
For details on FireBug Lite's features, see What is Firebug?
Enforce Standard Mode
TruClient for IE can only record and replay application in standard mode. TruClient enforces this
mode on all pages that you navigate to while you are recording and replaying.
If you wish to explore how pages are rendered in a non-standard IE mode, you can temporarily
deactivate enforcement by deselecting Advanced > Enforce Standard Mode. When deselected
the following message appears in the Sidebar:
HP LoadRunner (12.00)
Page 561 of 1743
LoadRunner User Guide
While in the mode you will not be able to develop or edit scripts in the TruClient IE browser. Click
the Enforce button in the message box or select Advanced > Enforce Standard Mode, to
continue recording and replaying in the TruClient for IE browser.
TruClient General Settings Dialog Box
This dialog box enables you to set many options that affect the browser as you develop your scripts
in interactive mode.
General settings
To access
TruClient General Settings button
Important
information
The TruClient General Settings dialog box can be accessed from the VuGen
window or the TruClient sidebar in interactive mode.
Relevant
tasks
" How to Develop TruClient Scripts" on page 511
Browsing Settings Tab
This tab enables you to configure settings for the TruClient browser for scripts that you run in
interactive mode.
The settings available in the Browser Settings tab are the same settings that are available in
VuGen's Run-Time Settings > Load > Browser Settings node. For a description of the available
options, " Load > Browser Settings Node (Ajax TruClient)" on page 338.
Settings that you modify in the Browsing Settings tab affect interactive mode only and apply to all
TruClient scripts. When you save your script in interactive mode, any settings that you modified in
the Browsing Settings tab are applied to the Load Mode Browser settings.
Firefox Options
Tab
HP LoadRunner (12.00)
Page 562 of 1743
LoadRunner User Guide
Interactive Options
Tab
UI Element
Description
Action on
Error
Abort Script. Abort script on error.
Continue to the next iteration. Stop iteration on
error and continue to next iteration.
Snapshots
generation
Recording snapshots generation
l
Never. Never generate snapshots during
recording.
l
Always. Always generate snapshots during
recording.
n Maximum Level. Enables you to select the
script level to generate snapshots (1-3).
Replay snapshots generation
l
Never. Never generate snapshots during replay.
l
On error. Generate snapshots during replay on
error.
l
Always. Always generate snapshots during
replay.
Object
Enable. If selected, enables the object identification
Identification assistant.
The object identification assistant facilitates
Assistant
resolving identification errors during replay. For
details, see "How to Resolve Object Identification
Issues" on page 519.
Server
Parameter
Replace server with parameter. If selected, server
domain name in navigation steps will be
automatically replaced by a parameter.
Console
Settings
Display log messages. Display console's log
messages during replay.
Debug
Settings
Disable Step Into Functions. Disable display steps
of functions during interactive replay.
Encryption Tab
For configuration details, see Mozilla Support for Encryption .
Extension Tab
For configuration details, see Mozilla Support for Extensions
Internet Explorer Options
Interactive Options Tab
HP LoadRunner (12.00)
Page 563 of 1743
LoadRunner User Guide
User interface elements are described below:
UI Element
Action on
Error
Snapshots
generation
Description
Abort Script Abort script on error.
Continue to the next iteration. Stop iteration on error and continue to next
iteration.
Recording snapshots generation
l
Never. Never generate snapshots during recording.
l
Always. Always generate snapshots during recording.
n Maximum Level. Enables you to select the script level to generate
snapshots (1-3).
Replay snapshots generation
l
Never. Never generate snapshots during replay.
l
On error. Generate snapshots during replay on error.
l
Always. Always generate snapshots during replay.
Object
Identification
Assistant
Enable. If selected, enables the object identification assistant.
Server
Parameter
Replace server with parameter. If selected, server domain name in
navigation steps will be automatically replaced by a parameter.
The object identification assistant facilitates resolving identification errors
during replay. For details, see "How to Resolve Object Identification Issues" on
page 519.
Client Certificate Tab
Enables you to manually export the client certificate to the script folder .
TruClient - Troubleshooting and Limitations
(General)
This section describes troubleshooting and limitations for TruClient scripts and other fun things.
HP LoadRunner (12.00)
Page 564 of 1743
LoadRunner User Guide
Troubleshooting Communication between VuGen and
TruClient
Error message: VuGen cannot open the TruClient browser because the
port range is busy or invalid.
Recommendation: In order to open a server, a free port is needed. The server is open on the
http://127.0.0.1:<free_port>/ url.
The free port can be configured in the following xml files :
%APPDATA%\Hewlett-Packard\LoadRunner\Data\Settings\VuGenProperties.xml
<VuGenProperties>
<BrowserCommunicationServerEndPort value="8090" />
<BrowserCommunicationServerStartPort value="8080" />
The default port range is between 8080 through 8090. If there is a problem with the ports (all ports
are busy or the start port is bigger than the end port) you can change the range in the configuration
file.
If you are unable to resolve this issue contact HP software support.
Error Message: VuGen cannot open the TruClient browser.This error has
occurred because you do not have the proper permissions to establish
communication between VuGen and the TruClient browser.
Recommendation: Ask your administrator or a power user to run this command:
netsh http add urlacl url=http://127.0.0.1:<port_given_in_the_error_message>/
user=<DOMAIN>\<USER_NAME>
Example: netsh http add urlacl url=http://127.0.0.1:8080/ user=DOMAIN\john
Word Verification Function in the Business Process
Many web sites use special Word Verification fields that display some text that the user must enter
in order to validate that an actual user is filling out the form.
This is designed to block crawlers, spiders and so on from using the site and taking up valuable
system resources.
These fields are especially designed to block automatic tools such as LoadRunner.
In order to complete your business process automatically you must cancel this function on the web
site against which you are running the load.
HP LoadRunner (12.00)
Page 565 of 1743
LoadRunner User Guide
Protocol Limitations
McAfee Anti-virus causes Vusers to stop running in Load Mode
Issue: Newer versions of McAfee Anti-virus may cause network hook collision with the TruClient
for IE protocol. You may experience unexpected behavior during load. For example, some of your
Vusers may stop running. As a result, an error message will appear in the Controller > Scenario
Status > Errors pane and the Vuser status displays as Failed.
Steps to resolve: Disable McAfee.
Flash, Silverlight, ActiveX limitation for TruClient IE
User actions on UI elements that are based on Flash, Silverlight, ActiveX in general and Java
applets technologies are currently not recorded and replayed.
Java applets and Silverlight limitation for TruClient FF
User actions on UI elements that are based on Java applets and Silverlight technologies are
currently not supported for record and replay.
l
When you view Web page component breakdown graphs for TruClient Vusers, TruClient
measurements might not be available or might be less accurate than those of other protocols.
For example the Time to First Buffer Breakdown graph, and measurements such as SSL
Handshake, and Client/Error Time might not be available.
l
TruClient is a UI based protocol therefore while running a TruClient script in Controller you might
encounter an exception: "Failed to Initialize. Reason TimeOut". It is recommend to
increase the Init time out. (Controller > Tools > Options)to provide the Vusers with
additional time to finalize the initialization stage.
l
After opening TruClient by clicking Develop Script, and subsequently closing it, VuGen may still
display the yellow banner of Develop mode. Workarounds: If working with a proxy, you must
specify "bypass local connections". If working with a PAC file, the PAC must specify a direct
connection for 127.0.0.1
l
If you edit a TruClient script using a later version of LoadRunner than the one on which you
recorded the script, it may fail to replay in some cases.
Before modifying the script, save a backup copy of the script. Workaround: If the replay fails,
re-record the script using the latest version of the TruClient protocol.
l
TruClient for will not record "mouse overs" when the element has a CSS rule of "Mouse Hover".
Workaround: Instead of mouse hovering, click the elements to open the drop down (the clicks
are recorded).
l
TruClient protocol step types and arguments are not localized.
l
TruClient General Strings are not localized in the Japanese version.
TruClient - IE Protocol
HP LoadRunner (12.00)
Page 566 of 1743
LoadRunner User Guide
l
The TruClient - IE protocol does not support Diagnostics for J2EE/.NET.
l
When recording a script in TruClient -IE protocol, a keyboard event together with the Ctrl key is
not supported and therefore not recorded.
l
TruClient - IE protocol requires Internet Explorer 9 or 10 to be installed on the load generator.
l
Due to Internet Explorer 9 behavior, when using TruClient - IE protocol with Internet Explorer 9,
and you have a JRE plug-in that is older than version 7, the browser may crash when you visit
web pages that are rendered and contain applets that need to instantiate the plug-in.
Workaround: Install the JRE 7 plug-in or a later version.
l
TruClient supports only IE9 or IE10 Standard modes.
TruClient - Firefox Protocol
l
Security warning dialog boxes are not displayed in TruClient during script development.
l
If you encounter problems when running TruClient - Firefox Vusers in load mode, modify the
Pacing settings (Replay > Run-Time Settings > General > Pacing) as follows: Select either
After the previous iteration ends, or At <fixed/random> intervals.
l
The TruClient - Firefox protocol can only be used with applications that support the Mozilla
Firefox browser.
l
TruClient - Firefox does not support Kerberos authentication. If the server also supports NTLM,
TruClient will automatically move the authentication to NTLM and continue working.
Converting a TruClient Script to a Web HTTP/HTML
Script
Combine the advantage of fast script development and the advantage of running many Vusers by
converting a TruClient script to a Web HTTP/HTML script.
Note:
You will need to have an understanding of the Web HTTP/HTML protocol to successfully
replay the script.
During the conversion, comments and APIs are added to the Web HTTP/HTML protocol script
that document the conversion process.
1. Create a TruClient script. For details, see" How to Develop TruClient Scripts" on page 511
2. Save the script and close the TruClient Side Bar.
HP LoadRunner (12.00)
Page 567 of 1743
LoadRunner User Guide
3. From VuGen toolbar, click the
button to convert the script.
4. After the script is generated, review the script, keeping in mind that the Web HTTP/HTML
protocol records on the transport level. For example, you may need to address correlation or
parameter issues in your converted script. For details, see Web (HTTP/HTML) Protocol Overview.
Limitations
Conversion of TruClient scripts to Web HTTP/HTML scripts does not support converting steps that
call 127.0.0.1 (localhost) address.
LR Function Reference
This section includes:
TruClient Functions
The following functions can be inserted as values in TruClient step elements.
Method
Description
The arguments in this row
can be used in all methods
Arguments
l
object. The step's object as
defined in the application.
l
window. Points to the global
window object of the application.
l
document. The global document
object of the application.
IO.createDir(path)
Creates the specified folder. If needed, creates
all the folders necessary to complete the path.
path. The absolute path of the folder.
IO.delete(path)
Deletes the specified folder or file. If a folder is
specified, deletes all the files in the folder,
including sub-directories.
path. The absolute path of the folder
or file.
IO.isExist(path)
Returns True if the specified folder or file exists
and False if it does not. Returns False for a
disconnected or unauthenticated mapped drive.
path. The absolute path of the folder
or file.
IO.read(path, charset)
Returns all the data from the specified file.
Converts the data from the specified charset to
unicode.
path. The absolute path to the file.
charset. The charset of the file, if it is
not UTF 8.
HP LoadRunner (12.00)
Page 568 of 1743
LoadRunner User Guide
Method
Description
Arguments
IO.write(path, string,
append, charset)
Writes the string to the specified file. If the file
does not exist it is created.
absolute path. The absolute path to
the file.
string. The string to write to the file.
append. Boolean.
True. (default) Append the string to
the end of the file.
False. Overwrite the file with the
string.
charset. The charset of the file, if it is
not UTF 8.
LR.advanceParam
(parameter)
Advances the specified parameter to the next
value in the file.
parameter. The name of the
parameter to advance. Must be a
parameter of type file or unique
number.
LR.getUserIP
Returns the IP address when IP spoofing is
enabled and the script is running in load mode in
Controller.
LR.setParam(name,
value)
Saves a string to a parameter, creating the
parameter if it does not exist.
name. The name of the parameter in
which to save the value.
value. The value.
LR.crossTransactionStart
(name,value)
Begins a transaction in a Vuser script that will be
ended in another Vuser script.
name.The name of the transaction.
value.A pointer to a parameter list.
LR.crossTransactionEnd
(name,value,status)
Ends a transaction in a Vuser script that has
been started in another Vuser script.
name. The name of the transaction.
value. A pointer to a parameter list.
status. One of the following:"Pass"
or "Fail".
LR.transactionDuration
(name)
Returns the duration of a specific transaction.
name. The name of the transaction
LR.getParam(name)
Returns the value of the specified parameter.
name. The parameter name.
LR.getLRAttr(name)
Returns the value of the specified mdrv
command parameter.
name. The name of the commandline parameter.
LR.evalC(funcname)
Runs the specified function whose definition is
found in the specified file.
funcname. The function name.
Use the #include command to
include the file where the
function is defined.
HP LoadRunner (12.00)
Page 569 of 1743
LoadRunner User Guide
Method
Description
Arguments
LR.log(text, level)
Logs a message.
text. The message.
level. One of the following:
l
"Error",
l
"Warning",
l
"Standard",
l
"Extended",
l
"Status". The LR.log level= Status
sends a string to the Status area
of the Controller. It also sends the
string to the Vuser log. When run
from VuGen, the message is sent
to output.txt.
example: LR.log("text", "Error");
LR.decrypt(text)
Returns the text after decryption.
text. The encrypted text.
LR.userDataPoint(name,
value)
Records a user-defined data point for analysis.
name. The name of the data point.
Do not begin a data-point name with
any of these strings: HTTP, NON_
HTTP, RETRY, mic_, stream_,
mms_
value. The numeric value.
evalXPath(XPath)
Returns an array of the objects defined by the
XPath in the argument.
xpath. The xpath query.
LR.startTransaction
(name)
Starts a LoadRunner transaction.
name. The name of the transaction to
start.
LR.endTransaction
(name, status)
Ends a LoadRunner transaction.
l
name. The name of the
transaction to end
l
status. One of the following
values: “Pass”, “Fail”, “Auto”
LR.vuserStatusMessage
(string)
Indicates which Vuser is handling a specific
script.
string. Any string.
Example:
LR.vuserStatusMessage
("FlightStatus")
Utils.clearCookies()
Removes all cookies currently stored by the
Vuser.
Utils.clearCache()
Clears the contents of the cache simulator.
Utils.getEnv(name)
Returns the value of the specified environment
variable. Returns an empty string if the specified
variable does not exist.
HP LoadRunner (12.00)
name. The name of the environment
variable.
Page 570 of 1743
LoadRunner User Guide
Method
Description
Arguments
Utils.import(path)
Evaluates the specified JavaScript file in the
arguments context.
path. The absolute path to the
JavaScript file.
Utils.isEnvExists(name)
Returns True if the specified environment
variable exists and False if it does not exist.
name. The name of the environment
variable.
Utils.setEnv(name, value)
Sets the named environment variable to the
specified value. If the variable already has a
value it is overwritten.
l
name. The name of the
environment variable.
l
value. The value to set the
environment variable to.
Adding a filter to one of the black list or white list
lists of URLs. The URL of each HTTP request
will be checked against those lists – first the black
list, and if not empty, the white list. HTTP
requests that do not pass the check will be
blocked.
l
filter. String representing the
URL.
l
isInclude. True value indicates
the white list, false otherwise.
Remove a filter from one of the black list or white
list lists of URLs.
l
filter. String representing the
URL.
l
isInclude. True value indicates
the white list, false otherwise.
l
header. The name of the header
to be added.
l
value. The value of the header to
be added.
l
merge. True value indicates
to merge the value with an
existing header by the same
name, false indicates to overwrite
it.
Utils.addAutoFilter(filter,
isIncluded
Utils.removeAutoFilter
(filter, isIncluded
Utils.cleanupAutoFilters ()
Remove all filters from both the black list and
white list lists of URLs.
Utils.addAutoHeader
(header, value, merge)
Adding an HTTP header to every consecutive
HTTP requests following this function call.
Utils.removeAutoHeader
(header)
Stops the adding of an HTTP header to every
consecutive HTTP request following this
function call.
header. The name of the header to
be stopped from being added.
Utils.cleanupAutoHeaders Removes all HTTP headers and stops adding
()
HTTP headers to every consecutive HTTP
request following this function call.
TruClient VTS Functions
The following functions can be inserted as values in TruClient step elements.
HP LoadRunner (12.00)
Page 571 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
Arguments
LR.vtcAddCell(colName,
value, VtsName)
Sets the last
field of a
column to a
value.
colName.The
name of the
column.
value.The value
as a string.
If the column specified in the
argument does not exist, the
column will be created and
the cell content is set to the
argument value.
VtsName.The
alias of the VTS
server.
HP LoadRunner (12.00)
Page 572 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
LR.vtcAddCells
Sets the data
(colNames, values,option, in multiple
VtsName)
columns.
If option
selected is 2,
returns a value
of 0 if value
inserted.
Returns a
value of 1 if
the value
already exists.
Arguments
ColNames.The
column names
delimited by a
semi-colon.
values.The values
as a string
delimited by a
semi-colon.
If the columns specified in
the argument do not exist, the
columns will be created and
the cell contents are set to
the argument values.
option..Define
how the values are
added
0. Add as same
row in all columns
based on the
column with the
highest row count.
The created row
will be n+1 for all
columns.
1. Add as stack last row in every
column.
2. Add as unique
stack - last row in
every column only
if the value is
unique in the
column.
VtsName.The
alias of the VTS
server.
HP LoadRunner (12.00)
Page 573 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
Arguments
LR.vtcAddUniqueCell
(colName, value,
VtsName)
Sets the last
field of a
column to a
value if the
value does not
exist in the
column.
ColName.The
name of the
column.
Returns a
value of 0 if a
value is
inserted.
value.The value.
If the column specified in the
argument does not exist, the
column will be created and
the cell content is set to the
argument value.
VtsName.The
alias of the VTS
server.
Returns a
value of 1 if
the value
already exists.
LR.vtcClearColumn
(colName,VtsName)
Clears all data
in a column.
colName.The
name of the
column.
VtsName.The
alias of the VTS
server.
LR.vtcClearCell
(colName,rowIndex,VtsN
ame)
Clears the
data in a field.
colName. The
name of the
column.
rowIndex.The
index number of
the field as an
integer. 1 is the
first field in the
column.
If the column specified in the
argument does not exist, the
step will run without returning
an error and no data in the
VTS is changed.
If the column or the row index
specified in the argument
does not exist, the step will
run without returning an error
and no data in the VTS will be
changed.
VtsName.The
alias of the VTS
server.
HP LoadRunner (12.00)
Page 574 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
Arguments
LR.vtcColumnSize
(colName, VtsName)
Returns the
number of
fields that
contain data in
a column.
colName.The
name of the
column.
Creates a
connection to
the server.
serverName.
Either the IP or
server name.
LR.vtcConnect
(serverName, port,
VtsName)
VtsName.The
alias of the VTS
server.
If the column specified in the
argument does not exist, the
step will run without returning
an error and the return value
is 0.
port.The port
number
VtsName..The
alias of the VTS
server.
LR.vtcDisconnect
(VtsName)
Disconnects
from the
server.
VtsName.The
alias of the VTS
server.
LR.vtcDropIndex
(colName,VtsName)
Deletes the
index on a
column.
colName.The
column name.
LR.vtcEnsureIndex
(colName,VtsName)
Creates an
index on a
column.
VtsName.The
alias of the VTS
server.
colName.The
name of the
column.
VtsName.The
alias of the VTS
server.
HP LoadRunner (12.00)
If the column specified in the
argument does not exist, the
step will run without returning
an error.
In addition, if the index has
already been dropped on the
column, the step will run
without returning and error.
If the column specified in the
argument does not exist, the
step will run without returning
an error.
In addition, if the index has
already been created on the
column, the step will run
without returning and error.
Page 575 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
Arguments
LR.vtcIncrement
(colName,rowIndex,value
,VtsName)
Increments a
counter stored
in a field.
colName.The
name of the
column.
rowIndex.The
index number of
the field as an
integer. 1 is the
first field in the
column.
value.The value
as a string.
VtsName.The
alias of the VTS
server.
LR.vtcGeLRell
(colName,rowIndex,VtsN
ame)
Returns the
data in a field.
colName.The
name of the
column.
rowIndex.The
index number of
the field as an
integer. 1 is the
first field in the
column.
If the column name specified
in the argument does not
exist, the column will be
created and the cell
referenced by the index will
be set to the argument value.
If the index specified in the
argument exceeds the
column size, the cell is
created by the specified
index and the cell contents is
set to the argument value.
If the column referenced by
the index contains a string,
the cell contents are replaced
with the value argument.
If the column name or index
name specified in the
argument does not exist, a
null value will be returned.
VtsName.The
alias of the VTS
server.
LR.vtcGetRowCells
(rowIndex,VtsName)
HP LoadRunner (12.00)
Returns the
data in a row
as a javascript
object. The
properties of
the object will
be set to the
column
names.
rowIndex.The
index number of
the field . 1 is the
first field in the
column.
If the column specified in the
argument does not exist, a
null value will be returned for
every column.
VtsName..The
alias of the VTS
server.
Page 576 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
Arguments
LR.vtcPopCell
(colName,VtsName)
Pops the first
field from a
column.
colName.The
name of the
column.
VtsName.The
alias of the VTS
server.
LR.vtcPopMultipleCells
(colNames,VtsName)
LR.vtcUpdateCell
(colName,rowIndex,value
,VtsName)
Pops the first
fields from
specified
columns.
Returned as a
javascript
object. The
properties of
the object will
be set to the
column
names.
colNames.The
names of the
columns.
Replaces the
data in a field.
colName.The
name of the
column.
VtsName.The
alias of the VTS
server.
rowIndex.The
index number of
the field as an
integer. 1 is the
first field in the
column.
If the column name specified
in the argument does not
exist, a null value will be
returned.
If the column names
specified in the argument
does not exist, a null value
will be returned.
If the column name or index
does not exist, the column
and/ or the cell referenced by
the index will be created and
the cell contents set to the
argument value.
value.The value
as a string.
VtsName.The
alias of the VTS
server.
HP LoadRunner (12.00)
Page 577 of 1743
LoadRunner User Guide
Notes about function
behavior
Method
Description
Arguments
LR.vtcUpdateEqualsCell
(colName,rowIndex,value
,comparedValue,VtsNam
e)
Replaces the
data in a field if
the current
data equals a
given value.
colName.The
name of the
column.
Returns a
value of 0 if
the value is
updated.
LR.vtcUpdateRowCells
(colNames,rowIndex,valu
es,VtsName)
rowIndex.The
index number of
the field as an
integer. 1 is the
first field in the
column.
Returns a
value of 1 if
the value does
not maLRh the
compare
value.
value.The value
as a string.
Replaces the
data in a row.
colNames.The
name of the
columns.
If the column name or index
does not exist, the column
and/ or the cell pointed to by
the row index will be created
and the cell contents set to
the argument value.
comparedValue.
VtsName.The
alias of the VTS
server.
rowIndex.The
index number of
the field as an
integer. 1 is the
first field in the
column.
If the column names or index
does not exist, the columns
and/ or the cells referenced
by the index will be created
and the cells contents are set
to the argument values.
values.The values
as a string
delimited by semicolons.
VtsName.The
alias of the VTS
server.
TruClient Properties
These properties can be used as arguments in TruClient functions.
HP LoadRunner (12.00)
Page 578 of 1743
LoadRunner User Guide
Property
Description
LR.userId
The user ID as it appears in the MDRV command line. MDRV is the main
process that runs all protocols.
LR.groupName The group name as it appears in the MDRV command line. MDRV is the main
process that runs all protocols. If the process was started by VuGen its value is
0.
LR.scenarioId
The scenario ID as it appears in the MDRV command line. MDRV is the main
process that runs all protocols. The scenario ID exists only if MDRV was
started by Controller, if it was started by VuGen its value is 0.
LR.outputDir
The user output folder that contains all the output for the script. For VuGen the
output folder and script folder are the same. For Controller they are different.
The returned path includes the last folder separator.
LR.scriptDir
The user script folder. You can store external files in the script folder such that
when you want to include them in your script, you can append the filename of
your external file to LR.scriptDir.
TruClient Step Arguments
The following table displays the step arguments categorized by role. Mandatory arguments are
marked with a red star to the left of the argument name in the user interface. All arguments can
accept JavaScript code and LoadRunner functions as values. For a list of LoadRunner functions,
see TruClient Functions.
Role
Action
Arguments
element
Evaluate JavaScript
Code: JavaScript code
HP LoadRunner (12.00)
Page 579 of 1743
LoadRunner User Guide
Role
Action
Arguments
element
Mouse Actions:
Mouse Down,
Mouse Up, Mouse
Over, Click, Double
Click
l
Button. The mouse button that is clicked.
l
X Coordinate. The offset location of the action relative to
the upper left corner of the object. This number must be
positive. If not specified, the default is the center of the
object.
l
Y Coordinate. The offset location of the action relative to
the upper left corner of the object. If not specified, the
default is the center of the object.
l
Ctrl Key. Whether or not this key is pressed during the
action.
l
Alt Key. Whether or not this key is pressed during the
action.
l
Shift Key. Whether or not this key is pressed during the
action.
l
Button. The mouse button that is clicked.
l
X Offset. The amount of pixels to drag the object on the x
axis. A positive number indicates a drag to the right.
l
Y Offset. The amount of pixels to drag the object on the y
axis. A positive number indicates a drag down.
l
Path. List of coordinates representing user drag path. Do
not modify this argument.
l
Target Object. The step object is dragged to this target
object.
l
X Offset. The offset from the top left of the target object in
the x axis. This number must be positive.
l
Y Offset. The offset from the top left of the target object in
the y axis. This number must be positive.
element
element
Drag
Drag To
HP LoadRunner (12.00)
Page 580 of 1743
LoadRunner User Guide
Role
Action
Arguments
element
Get Property
l
Property. The property whose value will be stored in the
specified variable. The list of properties available depends
on all the roles of the object.
The following are the default properties available for all
objects:
n Visible text. The visible text of the item, corresponding
to the DOM textContent property.
element
Verify
n
All text. The entire text of the item, corresponding to the
DOM textContent property.
n
Inner HTML. The inner html markup of the object,
corresponding to the DOM innerHTML property.
n
Variable. The name of the variable in which to store the
specified property value.
l
Value. The string or number to verify.
l
Property. The object property whose value will be
verified. The list of properties available to verify depends
on all the roles of the object.
The following are the default properties available for
verification on all objects:
n Visible text. Items that are visible in the application.
HP LoadRunner (12.00)
n
All text. Items that are in the application but are not
necessarily visible. Items in this category are contained
in DOM property textContent.
n
Inner HTML. Items contained in the DOM property
innerHTML.
n
Condition. The relationship between the value and
property arguments.
Page 581 of 1743
LoadRunner User Guide
Role
Action
Arguments
element
Wait for Property
l
Value. The value of the specified property that the step
will wait for, before the step passes.
l
Property. The object property whose value the script will
wait for. The list of properties available for which to wait,
depends on all the roles of the object.
The following are the default properties available for all
objects:
n Visible text. Items that are visible in the application.
n
All text. Items that are in the application but are not
necessarily visible. Items in this category are contained
in DOM property textContent.
n
Inner HTML. Items contained in the DOM property
innerHTML.
n
Condition. The relationship between the value and
property arguments.
focusable
Press Key
l
Key name. Enter or Space.
text box
Type
l
Value. What is typed.
l
Clear. Clear the text box before typing. The default is
true.
l
Typing Interval. The average time in milliseconds
between keystrokes.
check box
Set
l
Checked. Set the check box to either checked (T) or
unchecked (F).
listbox
Select
l
Text. The selected string.
l
Ordinal. The order of the selected item in the list. If the
text argument is also specified, than this argument refers
to the instance of the specified text value in the listbox.
An ordinal of 0 generates a random value.
l
Text. The selected string.
l
Ordinal. The order of the selected item in the list. If the
text argument is also specified, than this argument refers
to the instance of the specified text value in the listbox.
An ordinal of 0 generates a random value.
l
Path. The selected path.
radiogroup Select
filebox
Set
HP LoadRunner (12.00)
Page 582 of 1743
LoadRunner User Guide
Role
Action
Arguments
slider
Set
l
Value. The value that the slider is set to.
datepicker Set Day
l
Day. An integer between 1-31 representing the day of the
month.
browser
Activate
l
Ordinal. Defined as an integer. Moves the specified
browser window to the foreground.
browser
Activate Tab
l
Ordinal. Which tab (integer) to activate.
browser
Close Tab
l
Ordinal. Which tab (integer) to close.
browser
Add Tab
l
Location. The URL to navigate to in the newly opened
tab.
browser
Navigate
l
Location. The URL to navigate to.
browser
Go Back
l
Count. The number of pages to go back.
browser
Go Forward
l
Count. The number of pages to go forward.
browser
Resize
l
Width. The new width. Leaving this blank means do not
resize the width.
l
Height. The new height. Leaving this blank means do not
resize the height.
l
X Coordinate. The new x coordinate. Leaving this blank
means do not scroll along the x axis.
l
Y Coordinate. The new y coordinate. Leaving this blank
means do not scroll along the y axis.
browser
Scroll
browser
Dialog - Confirm
l
Button. Ok or Cancel.
browser
Dialog Prompt
l
Value. The string to enter.
l
Button. Ok or Cancel.
l
Username. The username to enter.
l
Password. The password to enter.
l
Domain. The domain to enter.
l
Button. Ok or Cancel.
browser
Dialog Authentication
HP LoadRunner (12.00)
Page 583 of 1743
LoadRunner User Guide
Role
Action
Arguments
browser
Verify
l
Value. The value of the property to verify.
l
Property. The property to verify. You can verify the
following properties of a browser object:
l
Title. The title of the browser window.
l
Location. The location of the browser window.
l
Condition. The relationship between the value and
property arguments.
Citrix Protocol
Citrix Protocol - Overview
Citrix Vuser scripts emulate Citrix ICA protocol communication between a Citrix client and server.
VuGen records all activity during the communication and creates a Vuser script.
When you perform actions on the remote server, VuGen generates functions that describe these
actions. Each function begins with a ctrx prefix. These functions emulate the analog movements of
the mouse and keyboard. In addition, the ctrx functions allow you to synchronize the replay of the
actions, by waiting for specific windows to open.
VuGen also allows you to record a Citrix NFUSE session. With Citrix NFUSE, the client is
installed, but your interface is a browser instead of a client interface. To record NFUSE sessions,
you must perform a multi-protocol recording for Citrix and Web Vusers. In multi-protocol mode,
VuGen generates functions from both Citrix and Web protocols during recording.
In the following example, ctrx_mouse_click simulates a mouse click on the left button.
ctrx_mouse_click(44, 318, LEFT_BUTTON, 0, CTRX_LAST);
For more information about the syntax and parameters, see the Function Reference (Help >
Function Reference).
Citrix Recording Tips
When recording a Citrix Vuser script, be sure to follow these guidelines in order to create an
effective script.
Single vs. Multi-Protocol Scripts
When creating a new script, you may create a single protocol or multi-protocol script. If you plan to
record a simple Citrix ICA session, use a single protocol script. When recording an NFUSE Web
Access session, however, you must create a multi-protocol script for Citrix ICA and Web (HTML/HTTP), to enable the recording of both protocols.
HP LoadRunner (12.00)
Page 584 of 1743
LoadRunner User Guide
Record into Appropriate Sections
Record the connection process into the vuser_init section, and the closing process into the vuser_
end section. This will prevent you from performing iterations on the connecting and disconnecting.
For more information about recording into sections, see "Vuser Script Sections" on page 255.
Run a Clean Session
When recording a session, make sure to perform the complete business process, starting with the
connection and ending with the cleanup. End your session at a point from where you could start the
entire process from the beginning. Do not leave any client or application windows open.
Explicit Clicks
When opening expanded menu options, click explicitly on each option—do not depend on the
expanding menu. For example, when choosing Start > All Programs > Microsoft Word, be sure
to click on the line All Programs.
Do not Resize Windows
Although VuGen supports the resizing of windows during recording the session, we recommend
that you do not move or resize them while recording. To change the size or position of a window,
double-click on the relevant Sync on Window step in the Step Navigator and modify the
window's coordinates.
Make Sure Resolution Settings are Consistent
To insure successful bitmap synchronization, make sure that the resolution settings match. On the
recording machine, check the settings of the ICA client, the Recording Options, and the Run Time
settings. On the load generators, check the settings of the ICA client, and make sure that they are
consistent between all load generators and recording machines. If there is an inconsistency
between the resolutions, the server traffic increases in order to make the necessary adjustments.
Add Manual Synchronization Points
While waiting for an event during recording, such as the opening of an application, we recommend
that you add manual synchronization points, such as Sync on Bitmap or Sync on Text. For
details, see "Citrix - Automatic Synchronization" on page 587.
Disable Client Updates
Disable client updates when prompted by the Citrix client. This will prevent forward compatibility
issues between VuGen and newer Citrix clients that were not yet tested.
Windows Style
For Sync on Bitmap steps, record windows in the "classic" windows style—not the XP style.
Change the Windows Style to "classic"
1. Click in the desktop area.
2. Select Properties from the right-click menu.
3. Click the Theme tab.
HP LoadRunner (12.00)
Page 585 of 1743
LoadRunner User Guide
4. From the Theme list, select Windows Classic.
5. Click OK.
Citrix Replaying Tips
Wildcards
You can use wildcards (*) in defining window names. This is especially useful where the window
name may change during replay, by its suffix or prefix.
In the following example, the title of the Microsoft Internet Explorer window was modified with a
wildcard.
ctrx_mouse_click(573, 61, LEFT_BUTTON, 0,
"Welcome to MSN.com - Microsoft Internet Explorer");ctrx_mouse_click(573, 61, LE
FT_BUTTON, 0,
"* - Microsoft Internet Explorer");
For more information, see the Function Reference (Help > Function Reference).
Set Initialization Quota
To prevent overloading by multiple Vusers while connecting, set an initialization quota of 4 to 10
Vusers (depending on the capacity of the server) or apply ramp-up initialization using the Scheduler.
Enable Think Time
For best results, do not disable think time in the run-time settings. Think time is especially relevant
before the ctrx_sync_on_window and ctrx_sync_on_bitmap functions, which require time to
stabilize.
Regenerate Script
During recording, VuGen saves all of the agent information together with the script. By default, it
also includes this information in the script, excluding the Sync On Text steps. If you encounter text
synchronization issues, then you can regenerate the script to include the text synchronization
steps.
In addition, if you disabled the generation of agent information in the Recording options, you can
regenerate the script to include them.
Regenerating scripts is also useful for scripts that you manually modified. When you regenerate the
script, VuGen discards all of your manual changes and reverts back to the originally recorded
version.
To regenerate a script, select Record > Regenerate Script and select the desired options. For
more information about regenerating scripts, see "How to Regenerate a Vuser Script" on page 266.
Set Consistency Between Machines
If you intend to replay the script on another machine, make sure that the following items are
consistent between the record and replay machines: Window Size (resolution), Window Colors,
System Font and the other Default Options settings for the Citrix client. These settings affect the
hash value of bitmaps, and inconsistencies may cause replay to fail. To view the Citrix Client
HP LoadRunner (12.00)
Page 586 of 1743
LoadRunner User Guide
settings, select an item from the Citrix program group and select Application Set Settings or
Custom Connection Settings from the right-click menu. Select the Default Options tab.
Increasing the Number of Vusers per Load Generator Machine
Load Generator machines running Citrix Vusers may be limited in the number of Vusers that can
run, due to the graphic resources available to that machine, also known as the GDI (Graphics
Device Interface). To increase the number of Vusers per machine, you can open a terminal server
session on the machine which acts as an additional load generator.
The GDI count is Operating System dependent. The actual GDI (Graphics Device Interface) count
for a heavily loaded machine using LoadRunner is approximately 7,500. The maximum available
GDI on Windows 2000 machines is 16,384.
For more information on creating a terminal server session, see "Terminal Services Overview" on
page 1146.
Note: By default, sessions on a terminal server use a 256-color set. If you intend to use a
terminal session for load testing, make sure to record on machines with a 256-color set.
Citrix Synchronization
Synchronization refers to waiting for windows and objects to become available before executing an
action. This is necessary when recording Citrix scripts because, for example, if a step in a script
opens a window, and the next step performs an action in that window, the second step cannot be
implemented until the window opens. In order to ensure that VuGen does not replay the script
incorrectly, it automatically generates functions that synchronize the script by waiting for windows
or objects to become available. In addition, you can add synchronization functions manually.
For information about automatic synchronization, see "Citrix - Automatic Synchronization" below.
For information about manually adding synchronization points, see "How to Synchronize Citrix
Scripts Manually" on page 594.
Citrix - Automatic Synchronization
During recording, VuGen automatically generates steps that help synchronize the Vuser's replay of
the script:
Sync on Window
The Sync On Window step instructs the Vuser to wait for a specific event before resuming replay.
The available events are Create and Active. The Create event waits until the window is created.
The Active event waits until the window is created and then activated (in focus). Usually VuGen
generates a function with a create event. If, however, the next instruction is a keyboard event,
VuGen generates a function with an active event.
In the Editor, the corresponding function call to the Sync On Window step is ctrx_sync_on_
window.
HP LoadRunner (12.00)
Page 587 of 1743
LoadRunner User Guide
Sync on Obj Info
The Sync On Obj Info step instructs the Vuser to wait for a specific object property before
resuming replay. The available attributes are Enabled, Visible, Focused, Text, Checked, Lines,
or Item. The Enabled, Visible, Focused, and Checked attributes are boolean values that can
receive the values true or false. The other attributes require a textual or numerical object value.
A primary objective of this step is to wait for an object to be in focus before performing an action
upon it.
VuGen automatically generates sync_on_obj_info steps when the Citrix agent is installed and the
Use Citrix Agent Input in Code Generation option is enabled in the Recording options. By default,
this Recording option is enabled. For more information, see "Citrix > Code Generation" on page
177.
ctrx_sync_on_obj_info("Run=snapshot9", 120, 144, TEXT, "OK",
CTRX_LAST);
Sync on Text
The Text Synchronization step, Sync On Text, instructs the Vuser to wait for a text string to appear
at the specified position before continuing. When replaying Sync On Text, Vusers search for the
text in the rectangle whose modifiable coordinates are specified in the step's properties.
Caution: The maximum allowable length of a text string is 255 characters.
With an agent installation (see "Agent for Citrix Presentation Server - Overview" on page 590), you
can instruct VuGen to automatically generate a text synchronization step before each mouse click
or double-click. By default, automatic text synchronization is disabled. For more information, see
"Citrix > Code Generation" on page 177.
Note, that even if you record a script with the option disabled, if you enable the option and
regenerate the script, VuGen will insert text synchronization calls throughout the entire script.
In the Editor, the corresponding function call to the Sync On Text step is ctrx_sync_on_text_ex.
The following segment shows a ctrx_sync_on_text_ex function that was recorded during a Citrix
recording with the HP Citrix Agent installed and text synchronization enabled.
ctrx_sync_on_window ("ICA Seamless Host Agent", ACTIVATE, 0, 0,391,224, "snapsho
t1", CTRX_LAST);
ctrx_sync_on_text_ex (196, 198, 44, 14, "OK", "ICA Seamless Host Agent=snapshot
2", CTRX_LAST);
ctrx_obj_mouse_click ("<class=Button text=OK>", 196, 198, LEFT_BUTTON, 0, "ICA S
eamless Host Agent=snapshot2", CTRX_LAST);
For more information on this function, see the Function Reference (Help > Function Reference).
See "Citrix Alternate Synchronization" below for additional information.
Citrix Alternate Synchronization
In addition to automatic synchronization in Citric Vuser scripts, you can add several other steps
that affect the synchronization indirectly:
HP LoadRunner (12.00)
Page 588 of 1743
LoadRunner User Guide
Setting the Waiting Time
The Set Waiting Time step sets a waiting time for the other Citrix synchronization functions. This
setting applies to all functions that follow it within the script. For example, if your Sync on Window
steps are timing out, you can increase the default timeout from 60 seconds to 180 seconds.
To insert this step, select Insert > Add Step > Set Waiting Time.
Checking if a Window Exists or Closed
The ctrx_win_exist step checks if a window is visible in the Citrix client. By adding control flow
statements, you can use this function to check for a window that does not always open, such as a
warning dialog box. In the following example, ctrx_win_exist checks whether a browser was
launched. The second argument indicates how long to wait for the browser window to open. If it did
not open in the specified time, it double-clicks its icon.
if (!ctrx_win_exist("Welcome",6, CTRX_LAST))
ctrx_mouse_double_click(34, 325, LEFT_BUTTON, 0, CTRX_LAST)
To insert this step, select Insert > Add Step > Win Exist.
Another useful application for this step is to check if a window has been closed. If you need to wait
for a window to close, you should use a synchronization step such as UnSet Window or ctrx_
unset_window.
For detailed information about these functions, see the Function Reference (Help > Function
Reference).
Waiting for a Bitmap Change
In certain cases, you do not know what data or image will be displayed in an area, but you do expect
it to change. To emulate this, you can use the Sync on Bitmap Change step or its corresponding
function, ctrx_sync_on_bitmap_change. Right-click in the snapshot, and select Insert Sync on
Bitmap from the right-click menu. VuGen inserts the step or function at the location of the cursor.
The syntax of the functions is as follows:
ctrx_sync_on_bitmap (x_start, y_start, width, height, hash, CTRX_LAST);
ctrx_sync_on_bitmap_change (x_start, y_start, width, height,
[initial_wait_time,] [timeout,]
[initial_bitmap_value,] CTRX_LAST);
The following optional arguments are available for ctrx_sync_on_bitmap_change:
l
initial wait time value—when to begin checking for a change.
l
a timeout—the amount of time in seconds to wait for a change to occur before failing.
l
initial bitmap value—the initial hash value of the bitmap. Vusers wait until the hash value is
different from the specified initial bitmap value.
In the following example, the recorded function was modified and assigned an initial waiting time of
300 seconds and a timeout of 400 seconds.
HP LoadRunner (12.00)
Page 589 of 1743
LoadRunner User Guide
ctrx_sync_on_bitmap_change(93, 227, 78, 52,
300,400, "66de3122a58baade89e63698d1c0d5dfa",CTRX_LAS
T);
Note: If you are using Sync on Bitmap, make sure that the Configuration settings in the
Controller, Load Generator machine, and screen are the same. Otherwise, VuGen may be
unable to find the correct bitmaps during replay. For information on how to configure the client
settings, see "Recording Options" on page 176.
Agent for Citrix Presentation Server - Overview
The Agent for Citrix Presentation Server, or Citrix Agent, is an optional utility that you can install on
the Citrix server. It provides enhancements to the normal Citrix functionality. The following sections
describe these enhancements.
It is provided in the product's installation disk and you can install it on any Citrix server. For more
information about installing the Citrix Agent, see "How to Install and Uninstall the Citrix Agent" on
page 595.
Object Detail Recording
When the Agent for Citrix Presentation Server is installed, VuGen records specific information
about the active object instead of general information about the action. For example, VuGen
generates Obj Mouse Click and Obj Mouse Double Click steps instead of Mouse Click and
Mouse Double Click that it generates without the agent.
The following example shows the same mouse-click action recorded with and without the agent
installation. Note that with an agent, VuGen generates ctrx_obj_xxx functions for all of the mouse
actions, such as click, double-click and release.
/* WIthout Agent Installation */
ctrx_mouse_click(573, 61, LEFT_BUTTON, 0, test3.txt - Notepad);
/* WIth Agent Installation */
ctrx_obj_mouse_click("<text=test3.txt - Notepad class=Notepad>" 573,
61, LEFT_BUTTON, 0, test3.txt - Notepad=snapshot21, CTRX_LAST);
In the example above, the first argument of the ctrx_obj_mouse_click function contains the text of
the window's title and the class, Notepad. Note that although the agent provides additional
information about each object, Vusers only access objects by their window name and its
coordinates.
Active Object Recognition
The agent installation lets you see which objects in the client window are detected by VuGen. This
includes all Windows Basic Objects such as edit boxes, buttons, and item lists in the current
window.
To see which objects were detected, you move your mouse through the snapshot. VuGen
highlights the borders of the detected objects as the mouse passes over them.
In the following example, the Yes button is one of the detected objects.
HP LoadRunner (12.00)
Page 590 of 1743
LoadRunner User Guide
Expanded Right-Click Menu
When you click within a snapshot, you can insert several functions into the script using the rightclick menu. When no agent is installed, you are limited to the Insert Mouse Click, Insert Mouse
Double Click, Insert Sync on Bitmap and Insert Get Bitmap Value. If you are using a 256-color
set, the Insert Sync on Bitmap and Get Bitmap Value steps are not available from the right-click
menu.
When the Agent for Citrix Presentation Server is installed, the following additional options are
available from the right-click menu of window in focus:
l
Obj Get Info and Sync on Obj Info. Provide information about the state of the object:
ENABLED, FOCUSED, VISIBLE, TEXT, CHECKED, and LINES.
l
Insert Sync on Obj Info. Instructs VuGen to wait for a certain state before continuing. This is
generated as a ctrx_sync_on_obj_info function.
l
Insert Obj Get Info. Retrieves the current state of any object property. This is generated as a
ctrx_get_obj_info function.
l
Insert Sync on Text and Get Text. These are discussed in the section Agent for Citrix
Presentation Server - Overview.
These commands are interactive—when you insert them into the script, you mark the object or text
area in the snapshot.
HP LoadRunner (12.00)
Page 591 of 1743
LoadRunner User Guide
In the following example, the ctrx_sync_on_obj_info function provides synchronization by waiting
for the Font dialog box to come into focus.
ctrx_sync_on_obj_info("Font", 31, 59, FOCUSED, "TRUE", CTRX_LAST);
Utilizing VuGen's ability to detect objects, you can perform actions on specific objects
interactively, from within the snapshot.
Insert a Function Interactively Using the Agent Capabilities
1. Click at a point within the Step Navigator to insert the new step. Make sure that a snapshot is
visible.
2. Click within the snapshot.
3. To mark a bitmap, right-click on it and select Insert Sync on Bitmap.
VuGen issues a message indicating that you need to mark the desired area by dragging the
cursor. Click OK and drag the cursor diagonally across the bitmap that you want to select.
When you release the mouse, VuGen inserts the step into the script after the currently selected
step.
4. For all other steps, move your mouse over snapshot objects to determine which items are
active—VuGen highlights the borders of active objects as the mouse passes over them.
Right-click and select one of the Insert commands. A dialog box opens with the step's
properties.
Set the desired properties and click OK. VuGen inserts the step into your script.
Text Retrieval
With the agent installed, VuGen lets you save standard text to a buffer. Note that VuGen can only
save true text—not a graphical representation of text in the form of an image.
You save the text using the Sync On Text step either during or after recording.
HP LoadRunner (12.00)
Page 592 of 1743
LoadRunner User Guide
For task details, see "How to Synchronize Citrix Scripts Manually" on the next page.
Troubleshooting XenApp 5.0
When recording with XenApp 5.0 using a Citrix and Web multi-protocol script, manual modifications
are needed to ensure proper recording.
Record using XenApp 5.0
1. Modify XenApp Settings:
a. Connect to the XenApp server through a web interface.
b. Select Preferences > Session Settings and set Window Size to No Preference.
2. Update Correlation Rules
3. Modify Recording Options
a. Open the General > Recording node of the Recording Options dialog box.
b. Select Advanced HTML to open the Advanced HTML dialog box.
c. Select A script containing explicit URL's only.
4. Manually Modify Script
How to Configure the Citrix Client and Server
Before creating a script, make sure you have a supported Citrix client installed on your machine,
and that your server is properly configured.
Configure the Citrix client
In order to run your script, you must install a Citrix client on each Load Generator machine. If you do
not have a client installed, you can download one from the Citrix website www.citrix.com under the
download section.
VuGen supports all Citrix clients with the exception of versions 8.00, version 6.30.1060 and earlier,
and Citrix Web clients.
Install the MetaFrame server
Make sure the MetaFrame server (3, 4, or 4.5) is installed. To check the version of the server,
select Citrix Connection Configuration on the server's console toolbar and select Help >
About.
Configure the MetaFrame server
Configure the Citrix server to completely close a session. After a Citrix client closes the
connection, the server is configured, by default, to save the session for the next time that client
opens a new connection. Consequently, a new connection by the same client will face the same
workspace from which it disconnected previously. It is preferable to allow each new test run to use
HP LoadRunner (12.00)
Page 593 of 1743
LoadRunner User Guide
a clean workspace.
The make sure that you have a clean workspace for each test, you must configure the Citrix server
not to save the previous session. Instead, it should reset the connection by disconnecting from the
client each time the client times-out or breaks the connection.
Configure the server
1. Open the Citrix Connection Configuration dialog box. Select All Programs > Citrix >
Administration Tools > Citrix Connection Configuration Tool.
2. Select the ica-tcp connection name and select Connection > Edit. Alternatively, double-click
on the connection. The Edit Connection dialog box opens.
3. Click Advanced. The Advanced Connection Settings dialog box opens.
4. In the bottom section of the dialog box, clear the inherit user config check box adjacent to the
On a broken or timed-out connection list. Change the entry for this list box to reset.
How to Synchronize Citrix Scripts Manually
In addition to the automatic synchronization, you can manually add synchronization both during and
after recording. A common use of this capability is where the actual window did not change, but an
object within the window changed. Since the window did not change, VuGen did not detect or
record a Sync on Window.
For example, if you want the replay to wait for a specific graphic image in a browser window, you
insert manual synchronization. Or, if you are recording a large window with several tabs, you can
insert a synchronization step to wait for the new tab's content to open.
Synchronize manually during recording
To add synchronization during recording, you use the floating toolbar. The Sync On Bitmap and
Sync on Text functions lets you to mark an area or text within the client window that needs to be in
focus before resuming replay.
l
To insert a Sync on Bitmap step, click the InsertSync on Bitmap
and mark a rectangle around the desired area.
button on the toolbar
l
To insert a Synch on Text step (Citrix Agent required), click the Insert Sync On Text
button on the toolbar and mark a rectangle around the desired text.
Synchronize manually after recording
You can also add synchronization after the recording session. To add a synchronization step, rightclick in the Snapshot pane, and select a synchronization option:
l
Sync on Bitmap. Waits until a bitmap appears
l
Sync on Obj Info. Waits until an object's attributes have the specified values (agent
HP LoadRunner (12.00)
Page 594 of 1743
LoadRunner User Guide
installations only)
l
Sync on Text. Waits until the specified text is displayed (agent installations only)
How to Install and Uninstall the Citrix Agent
The installation file for the Agent for Citrix Presentation Server is located on the LoadRunner
installation disk, under the Additional Components\ Agent for Citrix Presentation Server
folder.
Note that the agent should be installed on your Citrix server machine only—not on Load
Generator machines.
Install the Agent for Citrix Presentation Server
1. If you are upgrading the agent, make sure to uninstall the previous version before installing the
next one.
2. If your server requires administrator permissions to install software, log in as an administrator
to the server.
3. Locate the installation file, SetupCitrixAgent<arch>.exe, on the product installation disk in
the Additional Components\ Agent for Citrix Presentation Server\Win32 or Win64
folder.
4. Follow the installation wizard to completion.
Note: After installation the agent will only be active for LoadRunner invoked Citrix
sessions—it will not be active for users who start a Citrix session without LoadRunner.
Uninstall the Agent for Citrix Presentation Server
1. If your server requires administrator privileges to remove software, log in as an administrator to
the server.
2. Open Add/Remove Programs in the server machine's Control Panel. Select HP Software
Agent for Citrix Presentation Server 32 or 64 and click Change/Remove.
Citrix Functions
During a Citrix recording session, VuGen generates functions that emulate the communication
between a client and a remote server. The generated functions have a ctrx prefix. For example,
ctrx_obj_mouse_click emulates a mouse click for a specific object. You can manually edit or add
any of the functions into your Vuser script after the recording session.
For more information about the ctrx functions, see the Function Reference (Help > Function
Reference).
HP LoadRunner (12.00)
Page 595 of 1743
LoadRunner User Guide
Note that for the functions that specify a window name, you can use the wildcard symbol, an
asterisk (*). You can place the wildcard at the beginning, middle, or end of the string.
Citrix - Understanding ICA Files
Citrix ICA client files are text files that contain configuration information for the applications
accessed through the Citrix client. These files must have an .ica extension and must conform to the
following format:
[WFClient]
Version=
TcpBrowserAddress=
[ApplicationServers]
AppName1=
[AppName1]
Address=
InitialProgram=#
ClientAudio=
AudioBandwidthLimit=
Compress=
DesiredHRES=
DesiredVRES=
DesiredColor=
TransportDriver=
WinStationDriver=
Username=
Domain=
ClearPassword=
Note: When you load an ICA file using the Recording Options, VuGen saves the file together
with your script, eliminating the need to copy the ICA file to each load generator machine.
The following example shows a sample ICA file for using Microsoft Word on a remote machine
through the Citrix client:
[WFClient]
Version=2
TcpBrowserAddress=235.119.93.56
[ApplicationServers]
Word=
[Word]
Address=Word
InitialProgram=#Word
ClientAudio=On
HP LoadRunner (12.00)
Page 596 of 1743
LoadRunner User Guide
AudioBandwidthLimit=2
Compress=On
DesiredHRES=800
DesiredVRES=600
DesiredColor=2
TransportDriver=TCP/IP
WinStationDriver=ICA 3.0
Username=test
Domain=user_lab
ClearPassword=test
For more information, see the Citrix website www.citrix.com.
Failed Bitmap Synchronization Dialog Box
This dialog box enables you to decide what to do when a bitmap synchronization fails.
To
This dialog box opens automatically during replay when there is a mismatch between
access the record snapshot and the replay snapshot in a bitmap synchronization step.
User interface elements are described below:
UI
Element
Description
Continue
Accept the mismatch and use both the original and new snapshots as a basis for
comparison between screens during future replays. If replay returns either one of
the bitmaps, the Vuser will not fail.
Recording A view of the recording snapshot.
Snapshot
Replay
Snapshot
A view of the replay snapshot.
Stop
Consider the mismatch between the snapshots to be an error. This error will be
handled like all other errors and halt the execution by default. Alternatively, you can
specify Continue on Error for a specific function as described in "Citrix Troubleshooting and Limitations" below.
Citrix - Troubleshooting and Limitations
This section describes troubleshooting and limitations for Citrix Vusers.
General limitations
l
Installation of the registry patch is required for the support of all version of Citrix clients over
10.x. Additionally, you need to install Enable_Citrix_API.reg from the LoadRunner\dat folder on
VuGen or Load Generator machines if a Citrix Client will be installed after installing LoadRunner.
HP LoadRunner (12.00)
Page 597 of 1743
LoadRunner User Guide
l
Running Citrix Vusers on virtual machines may adversely affect performance due to the sharing
of physical resources.
l
Citrix XenApp Desktop cannot be recorded with Citrix Web Access (formerly known as Citrix
NFuse) if Desktop View (Desktop Toolbar) is enabled.
l
Text recognition may not work correctly for overlapped applications on Windows 2012 servers.
l
When recording Citrix Web Access (formerly known as Citrix NFuse) applications, set the
window size to "No preference" in the Citrix XenApp web portal preferences page.
l
When recording window size using the XenApp Plugin for Hosted Applications 11. The recording
window size option does not work properly with the XenApp Plugin for Hosted Applications 11.
The size of the client window is installed, but the server screen resolution is not. This is a Citrix
Client limitation and will be fixed in future Citrix Client versions.
Workaround: When recording, set the window size equal to the local screen resolution. When
replaying/load testing, set the VuGen or Load Generator screen resolution to equal the resolution
used when the script was recorded. To verify the recorded resolution, view the Window property
in the <Script Folder>\default.cfg file.
l
The Citrix Connection Center may prevent record and replay of Citrix ICA scripts, if it is running
in a different user session on the same machine.
Workaround: Close all instances of the concenter.exe process for all users. To prevent the
Citrix Connection Center from starting automatically, set the ConnectionCenter registry key to
an empty value"". This key can be found at:
For 32-bit systems: HKEY_LOCAL_
MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
For 64-bit systems: HKEY_LOCAL_
MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\Curr
Effects and Memory Requirements of Citrix Agent
When you run Citrix Vusers with the agent installed, each Vuser runs its own process of
ctrxagent.exe. This results in a slight reduction in the number of Vusers that can run on the server
machine (about 7%).
The memory requirements per Citrix ICA Vuser (each Vuser runs its own ctrxagent.exe process) is
approximately 4.35 MB. To run 25 Vusers, you would need 110 MBs of memory.
Data Execution Prevention (DEP) and Citrix Agent Performance
DEP is a security feature included in Windows version XP Service Pack 2 and later. DEP can
interfere with some functions of the Agent for Citrix Presentation Server and may cause VuGen to
stop recording.
If you experience unusual behavior during recording in these environments, modify the DEP
settings.
HP LoadRunner (12.00)
Page 598 of 1743
LoadRunner User Guide
Modify the Windows DEP settings
1. Open Start > Control Panel > System.
2. In the Advanced tab, click Performance settings.
3. In the Performance Options Data Execution Prevention tab, select the first option, DEP for
essential services only.
If you cannot change this option, click Add. Browse to the client program, for example
IEXPLORE.EXE.
4. If neither of these options are possible, try to disable DEP completely.
a. Open a command prompt.
b. Run the following command: bcdedit.exe /set {current} nx AlwaysOff
c. Reboot the machine
d. Verify that the settings took effect by running the following at the command line: BCDEdit
/enum
e. Verify that the last line shows nx
AlwaysOff.
Debugging Tips
The following section lists debugging tips for Citrix scripts.
Single Client Installation
If you are unsuccessful in recording any actions in your Citrix session, verify that you have only one
Citrix client installed on your machine. To verify that only one client is installed, open the
Add/Remove Programs dialog box from the Control Panel and make sure that there is only one
entry for the Citrix ICA client.
Add Breakpoints
Add breakpoints to your script in VuGen to help you determine the problematic lines of code.
Synchronize Your Script
If replay fails, you may need to insert synchronization functions into your script to allow more time
for the desired windows to come into focus. Although you can manually add a delay using lr_think_
time, we recommend that you use one of the synchronization functions discussed in "Citrix Automatic Synchronization" on page 587.
Continuing on Error
You can instruct Vusers to continue running even after encountering an error, such as not locating a
matching window. You specify Continue on Error for individual steps.
This is especially useful where you know that one of two windows may open, but you are unsure of
which. Both windows are legal, but only one will open.
HP LoadRunner (12.00)
Page 599 of 1743
LoadRunner User Guide
Indicate Continue on Error:
In the Step Navigator, right-click on the step and select Show Arguments. In the Continue on
Error box, select the CONTINUE_ON_ERROR option.
In Script view, locate the function and add CONTINUE_ON_ERROR as a final argument, before
CTRX_LAST.
This option is not available for the following functions: ctrx_key, ctrx_key_down, ctrx_key_up,
ctrx_type, ctrx_set_waiting_time, ctrx_save_bitmap, ctrx_execute_on_window, and ctrx_set_
exception.
Extended Log
You can view additional replay information such as:
l
the total amount of GDI handles being used
l
a list of the running Citrix processes (concentr.exe, receiver.exe, wfcica32.exe, wfcrun32.exe)
with their PIDs and user names (if the process is not running under the LoadRunner user)
l
the Citrix client name
l
incompatibility warnings
To view these details, enable Extended logging in the Run-Time settings ( F4 Shortcut key) Log
tab. You can view this information in the Replay Log tab or in the output.txt file in the script's
folder.
Snapshot Bitmap
When an error occurs, VuGen saves a snapshot of the screen to the script's output folder. You can
view the bitmap to try to determine why the error occurred.
During recording, the bitmaps generated for the ctrx_sync_on_bitmap function are saved under
the script's data folder. The bitmap name has the format of hash_value.bmp. If synchronization
fails during replay, the generated bitmap is written to the script's output folder, or if you are running it
in a scenario, to wherever the output files are written. You can examine the new bitmap to
determine why synchronization failed.
Show Vusers
To show Vusers during a scenario, enter the following in the Vuser command line box: -lr_citrix_
vuser_view. In the Controller, open the Vuser Details dialog box and click More to expand the
dialog box. Note that this will affect the scalability of the test, so this should only be done to
examine a problematic Vuser's behavior.
To reduce the effect on the script's scalability, you can show the details for an individual Vuser by
adding the Vuser's ID at the end of the command line: -lr_citrix_vuser_view <VuserID>.
To open multiple Vusers, place a comma-separated list of IDs after the command line. Do not use
spaces, but you may use commas or dashes. For example, 1,3-5,7 would show Vusers 1,3,4,5,
and 7, but would not show Vuser 2, 6 or any Vuser with an ID higher than 7.
HP LoadRunner (12.00)
Page 600 of 1743
LoadRunner User Guide
When recording with XenApp 5.0 using a Citrix and Web multi-protocol script, manual modifications
are needed to ensure proper recording.
Record using XenApp 5.0
1. Modify XenApp Settings
a. Connect to the XenApp server through Internet Explorer.
b. Log in using the same account that will be used during recording.
c. Select Preferences > Session Settings and set Window Size to No Preference.
2. Update Correlation Rules
a. Open the HTTP Correlation node of the Recording Options dialog box.
b. Make sure that the Citrix_XenApp rule is selected.
3. Modify Recording Options
a. Open the General > Recording node of the Recording Options dialog box.
b. Select Advanced HTML to open the Advanced HTML dialog box.
c. Select A script containing explicit URL's only.
Load Generator and Citrix XenApp 11.2 Client
l
A Load Generator cannot be used as a service for the Citrix protocol when the Citrix XenApp
client 11.2 is used.
Workaround: Use another version of Citrix client.
l
Recording a Citrix NFuse script on IE9 is supported from Citrix client version 12.1.0.44.
l
Citrix Clients 11.2 and higher do not support the TCP/IP mode in the Citrix > Login node of the
Recording Options dialog box.
Citrix Access Gateway Support
LoadRunner supports Citrix Access Gateway (CAG) for Citrix Client versions 10.200 (or lower) and
Citrix Client version 13.x.
Click & Script Protocols
Note: From LoadRunner 12.00 and later, Web (Click & Script) is only supported for replay—not
recording.
HP LoadRunner (12.00)
Page 601 of 1743
LoadRunner User Guide
Click & Script Protocols - Overview
The Click & Script protocols record Web sessions on a user-action GUI level. VuGen creates a
GUI-level script that intuitively represents actions in the Web interface. For example, VuGen
generates a web_button function when you click a button to submit information, and VuGen
generates a web_edit_field function when you enter text into an edit box.
Click & Script Vusers support non-HTML code such as Javascript on the client side. VuGen
creates an intuitive script that emulates your actions on the web page, and executes the necessary
Javascript code.
Click & Script Vusers handle most correlations automatically, reducing the time required to create
the script. In most cases, you do not need to define rules for correlations or perform manual
correlations after the recording.
Click & Script Vusers allow you to generate detailed Business Process Reports which summarize
the script. For example, when you click a button to submit data, VuGen generates a web_button
function. If the button is an image, VuGen generates a web_image_submit function. In the
following example, a Vuser clicks the Login button. ...
web_image_submit("Login",
"Snapshot=t4.inf",
DESCRIPTION,
"Alt=Login",
"Name=login",
"FrameName=navbar",
ACTION,
"ClickCoordinates=31,6",
LAST);}
The next section illustrates a user navigating to the Asset ExpressAdd process under the Manage
Assets branch. The user navigates by clicking the text links of the desired branches, generating
web_text_link functions.
web_text_link("Manage Assets_2",
DESCRIPTION,
"Text=Manage Assets",
"Ordinal=2",
"FrameName=main",
ACTION,
"UserAction=Click",
LAST);
web_text_link("Use",
DESCRIPTION,
"Text=Use",
"FrameName=main",
ACTION,
"UserAction=Click",
LAST);
web_text_link("Asset ExpressAdd",
HP LoadRunner (12.00)
P