<<

QA Wizard Pro User Guide Version 2017.1 Copyrights © 1996-2017 Software, Inc. and its subsidiaries. All rights reserved. Defect Scribe, Helix ALM, Helix ALM Suite, Helix Issue Management, Helix Requirements Management, Helix Test Case Management, QA Wizard Pro, Resource Thief, SoloBug, SoloSubmit, Surround SCM, and TestTrack are trademarks or registered trademarks of Perforce Software, Inc. and its subsidiaries in the United States and other countries. Acrobat Reader is a registered trademark of Adobe, Inc. in the United States and other countries. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited. Apple, Mac, Mac OS, macOS, Macintosh, Objective-, and Safari are registered trademarks of Apple Computer, Inc. Chrome is a registered trademark of Google Inc. Debian is a registered trademark of Software in the Public Interest, Inc. Firefox is a registered trademark of the Mozilla Foundation. is a trademark of Linus Torvalds. Microsoft, Windows, Windows , Windows Vista, MS Windows, Active Directory, Internet Explorer, Outlook, SQL Server, Visual SourceSafe, and Visual Studio are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. openSUSE and SUSE are registered trademarks of Novell Inc. in the United States and other countries. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Red Hat, Red Hat Enterprise Linux, and Fedora are registered trademarks of Red Hat, Inc. in the United States and other countries. Ubuntu is a registered trademark of Canonical Ltd. All other product names mentioned herein are the trademarks of their respective owners. All other trademarks are the property of their respective owners. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language in any form by any means without the written permission of Perforce Software, Inc. and its subsidiaries. Your license agreement with Perforce Software, Inc. or any of its subsidiaries, which is included with the product, specifies the permitted and prohibited uses of the product. Any unauthorized duplication or use of this software, in whole or in part, in print, or in any other storage and retrieval system is forbidden. Information in this document is subject to change without notice and does not represent a commitment on the part of Perforce Software, Inc. or any of its subsidiaries. Unless otherwise noted, all companies, products, street addresses, and persons contained herein are purely fictitious. Mention of third-party companies and products is for informational purposes only and does not constitute an endorsement. Perforce Software, Inc. and its subsidiaries 400 N 1st Avenue Suite 200 Minneapolis, Minnesota 55401 USA +1 510.864.7400 [email protected] Contents

What's New 1 Installing QA Wizard Pro 3 Before you install 3 Running the installer 4 After installation 6 Getting Started with QA Wizard Pro 7 Key QA Wizard Pro concepts 8 Understanding the testing process 9 Starting QA Wizard Pro 11 Managing licenses 11 QA Wizard Pro interface 11 Application Repository pane 13 Call Stack pane 14 Errors pane 15 Find Results pane 15 Output pane 15 Pending Changes pane 16 Preview pane 16 References pane 17 Reports pane 17 Script pane 18 Statements pane 19 Helix ALM panes 20 Variables pane 20 Workspace pane 21 Sample scripts and applications 22 Creating workspaces 23 Adding existing files to workspaces 23 Using folders 24 Modifying workspace properties 25 Opening workspaces 26 Using Keyword View 27 Using Text View 28 Declaring variables in Text View 29 Declaring arrays in Text View 31

i Creating functions and subroutines in Text View 32 Setting Text View font and color options 34 Customizing QA Wizard Pro 35 Customizing the interface 35 Customizing toolbars 36 Creating toolbars 37 Adding toolbar and menu commands 37 Modifying toolbar and menu commands 38 Setting toolbar and menu options 38 Customizing keyboard shortcuts 39 Setting general options 40 Setting server connection options 43 Setting email notification options 44 Managing Applications 47 Adding applications 47 Copying applications 49 Exporting applications 49 Importing applications 50 Promoting applications 50 Modifying application properties 51 Adding versions 51 Modifying version properties 53 Deleting versions 54 Deleting applications 54 Managing Application Repositories 57 About application repositories 57 Setting up repositories 59 Maintaining repositories 60 Populating repositories 60 Overriding global application startup information 62 Connecting to the global repository 63 Recording Scripts 65 Recording new scripts 65 Selecting the default web browser 68 Recording additional script steps 69

ii Recording low-level actions 70 Adding new scripts 71 Understanding recorded scripts 71 Running Scripts to Perform Tests 73 Running scripts 73 Setting and running a main script 74 Entering login information when running scripts 74 Viewing results reports 75 Exporting results reports 76 Setting playback options 76 Setting reporting options 78 Running multiple scripts 79 Running scripts against a global repository 79 Running scripts from a command prompt 80 Creating batch files 83 Modifying batch files 86 Running batch files 87 Monitoring Script Playback 89 Viewing playback information in the dashboard 90 Dashboard widget types 92 Changing information displayed in dashboard widgets 95 Installing and configuring the dashboard 97 Viewing playback information in the status tool 99 Load Testing 103 Recording load test scripts 103 Running load tests 104 Running load tests from a command prompt 106 Viewing load test results reports 109 Stress Testing 111 Creating and running stress tests 111 Applying stresses 112 Managing Windows and Controls 115 Capturing window and control data 115 Reviewing and saving repository changes 116 Repository change reasons 118

iii About smart matching 118 Overriding naming conventions for new controls 119 Default control naming convention 121 Modifying window and control properties 122 About search methods 124 Changing standard search criteria 124 Editing window and control properties 126 Using regular expressions 127 Changing the search method for multiple controls 128 Using the Function search method 129 Setting advanced control properties 131 Changing control types 132 Renaming windows and controls 133 Finding and replacing property values 134 Merging controls 136 Configuring user-added windows and controls 136 Manually adding windows and controls to application repositories 138 Adding properties to user-added windows and controls 140 Deleting properties from user-added windows and controls 142 Duplicating windows and controls 142 Editing and deleting user-added windows and controls 143 Synchronizing with the application repository 143 Synchronizing multiple scripts with the application repository 144 Testing context menus 144 Modifying Scripts 145 Adding statements 146 Statement value types 147 Using function results as statement arguments 148 Adding browser actions 149 Cleaning up scripts 150 Editing statements 151 Deleting statements 151 Calling scripts from other scripts 151 Finding variable, function, and subroutine references in scripts 153 Finding variable, function, and subroutine definitions in scripts 153

iv Commenting blocks of steps 154 Handling known exceptions 155 Handling script errors 155 Identifying files and directories in statements 156 Finding and replacing text in scripts 157 Finding and replacing text in individual scripts 158 Finding text in multiple scripts 159 Replacing text in multiple scripts 160 Encrypting text 162 Working with text in HTML elements 162 Modifying script properties 163 About drag-and-drop scripting 164 Using Checkpoints 165 Checkpoint types 165 Creating record-time checkpoints 166 Creating record-time check exists checkpoints 168 Creating checkpoints 169 Editing checkpoints 171 Creating exists checkpoints 171 Creating image checkpoints 173 Editing image checkpoints 175 Creating expression checkpoints 176 Creating string exists checkpoints 177 Deleting checkpoints 177 Checkpoint examples 178 Capturing and checking property values during playback 179 Using OCR to Work with Graphical Text 181 Creating OCR checkpoints 183 Troubleshooting OCR issues 186 Creating Data-Driven Scripts 187 About datasheets 187 Creating local datasheets 187 Adding existing local datasheets 188 Importing external test data 189 Linking to external test data 189

v Configuring external datasheets 190 Creating Microsoft Access datasheets 190 Creating Microsoft Excel datasheets 192 Creating Microsoft SQL Server datasheets 193 Creating Oracle datasheets 195 Creating PostgreSQL datasheets 197 Creating SQLite datasheets 199 Creating text file datasheets 200 Associating datasheets with scripts 203 Using datasheet values in scripts 203 Navigating datasheets 205 Retrieving external data with queries 206 Retrieving external data with script-generated queries 207 Editing local datasheets 208 Modifying local datasheet properties 208 Deleting local datasheets 209 Modifying external datasheet properties 209 Deleting external datasheets 210 Debugging Scripts 211 Running scripts in debug mode 211 Using breakpoints 212 Using the INDEBUGMODE variable 213 Troubleshooting variables 213 Using Repository Variables 215 Creating repository variables 215 Editing repository variables 217 Deleting repository variables 217 Managing repository variable list values 217 Adding repository variable list values 218 Editing repository variable list values 219 Deleting repository variable list values 219 About the URLROOT repository variable 220 Using repository variables in scripts 220 Entering repository variable values during recording and playback 221

vi Testing Dynamic Web Applications 223 About XPath queries 223 Using the XPath search method 223 Using XPath queries in statements 225 Running web scripts against different servers 226 Using URL format rules 227 Creating URL format rules 227 Applying URL format rules 229 Editing URL format rules 230 Editing URL format rules in control properties 230 Deleting URL format rules 232 Testing Nested Controls 233 Supported nested controls 233 Adding statements to test nested controls 233 Nested control object action examples 234 Testing HTML Tables 237 Adding statements to test HTML tables 237 HTML table object action statement examples 239 Creating HTML table checkpoints 240 HTML table checkpoint examples 242 Using the GetControlFromTable statement 243 Capturing HTML table control property values during playback 244 Finding HTML table row and column index values 244 Testing nested HTML tables 245 Nested HTML table examples 246 Running Scripts on Remote Computers 249 Configuring remote computers 249 Starting QAWRemote.exe 250 Running scripts remotely 250 Running multiple scripts remotely 251 Managing the QA Wizard Pro Server 253 Installing the QA Wizard Pro Server 253 Starting the QA Wizard Pro Server 254 Starting the QA Wizard Pro Server Admin Utility 254 Configuring general server options 254

vii Configuring the server database 255 Removing playback data 256 Scheduling playback data removal 257 Adding scheduled playback data removals 257 Editing scheduled playback data removal filters 259 Editing playback data removal schedules 260 Deleting scheduled playback data removals 260 Manually removing playback data 261 Changing the playback data removal password 262 Backing up the QA Wizard Pro Server 262 Integrating with Helix ALM 265 Configuring the Helix ALM integration 265 Using Helix ALM list windows 267 Working with Helix ALM test cases and test runs 268 Adding Helix ALM test cases 269 Recording Helix ALM test case steps 270 Creating scripts from Helix ALM test cases 272 Viewing Helix ALM test cases 274 Editing and deleting Helix ALM test cases 275 Running Helix ALM tests 275 Viewing Helix ALM test runs 276 Editing and deleting Helix ALM test runs 276 Working with Helix ALM issues 276 Adding Helix ALM issues 277 Adding Helix ALM issues from run reports 278 Adding Helix ALM issues from scripts 279 Viewing Helix ALM issues 280 Editing and deleting Helix ALM issues 281 Moving Helix ALM items through the workflow 281 Duplicating Helix ALM items 282 Using the Helix ALM workbook 283 Adding Helix ALM workbook tasks 283 Viewing Helix ALM workbook tasks 284 Editing and deleting Helix ALM workbook tasks 284

viii Integrating with Source Control Tools 285 Configuring source control integration 285 Setting source control options 286 Understanding source control file status icons 287 Opening workspaces under source control 288 Excluding files from source control 289 Working with source control files 289 Adding files to source control 289 Getting files from source control 290 Checking out files from source control 291 Viewing source control file properties 291 Viewing source control file history 292 Viewing line-by-line source control file changes 294 Viewing pending changes 296 Viewing file differences 296 Checking in files to source control 298 Managing changelists 298 Undoing source control check out 300 Renaming source control files 301 Removing source control files 301 Converting QuickTest Pro Data to QA Wizard Pro 303 Understanding QTP data conversion 304 Exporting QTP repository and checkpoint data 304 Converting QTP data 305 Converting QTP repository objects and checkpoints 306 Converting QTP tests and function libraries 309 Reviewing QTP conversion results 312 Viewing the QTP conversion log 314 Troubleshooting QTP conversions 314 Setting Up RDBMS 317 Setting up Oracle databases 317 Setting up PostgreSQL databases 318 Setting up SQL Server databases 318 Troubleshooting RDBMS connections 319

ix Statements 321 Application control statements 321 Checkpoint statements 324 Comment statements 325 Conditional statements 325 Datasheet statements 325 Date/time statements 327 Error handling statements 328 File statements 329 Helix ALM statements 331 Image statements 332 Integrated action statements 332 JSON statements 333 Keyboard action statements 335 Load testing statements 336 Loop statements 339 Math statements 339 Mouse action statements 340 Object action statements 341 OCR statements 342 Programming statements 343 PropertyMap statements 344 QA Wizard Pro statements 345 Script control statements 345 Stress statements 346 String statements 346 System statements 348 Timing statements 349 Touch action statements 349 Web statements 350 Web browser action statements 350 Window action statements 351 # (Outline Block) 351 Abs 352 AddFileAttachment 352

x AddIssue 353 AddToHelixALM 354 Alert 355 AppendToFile 355 ArrayClear 356 ArraySize 356 ArrayToJSONArray 357 ASCII 357 Assignment 358 Back 358 Beep 359 Boolean 359 BoundaryChecks 360 CaptureScreenshot 360 Case 361 Cell 362 CheckExists 362 Checkpoint 363 CheckpointExpression 364 CheckpointImage 364 CheckpointStringExists 365 CheckpointStringNotExists 366 Chr 366 Clear 367 ClearOutput 367 Click 367 Close 368 CloseTab 368 Collapse 368 CombinePaths 369 CommitRecordsetRow 370 CompareFileContents 370 CompareImage 371 ComputerName 372 ContainsSubStr 372

xi CopyFile 373 Cos 373 CreateDirectory 374 CreateGUID 374 CreateObject 375 CreateRecordsetRow 375 CreateTempFile 376 Date 376 DateAdd 377 DateDiff 378 DatePart 379 DateTime 380 DateTimeFormat 381 Day 383 DecimalSeparator 384 DecryptString 384 Delay 385 DeleteDirectory 385 DeleteFile 386 DeleteRecordsetRow 386 DirectoryExists 387 DisableNetworking 387 Do...Loop Until 388 Do...Loop While 389 DoubleClick 390 Drag 391 DragTo 391 Else 392 ElseIf 392 EnableNetworking 393 EncryptString 394 EndsWithSubStr 394 Err.CallStack 395 Err.Clear 396 Err.Description 396

xii Err.LineNumber 397 Err.LineText 398 Err.Number 399 Err.Raise 400 Err.ScriptName 401 Err.Source 401 EvaluateRegExpression 402 Exit 403 Expand 404 ExternalAssemblyCall 404 ExternalCall 406 ExtractHTML 407 ExtractHTMLToString 407 Fail 408 FileBaseName 408 FileDateCreated 409 FileDateLastModified 409 FileDirectoryName 410 FileExists 410 FileExtension 411 FileFullPath 412 FileName 412 FileReadOnly 413 FileRootDirectoryName 413 FileSize 414 FileType 414 FindColumnByRowIndex 415 FindRowByColumnIndex 416 FindSubStr 417 FirstRow 417 Float 418 For Each...Next 418 For...Next 419 Format 420 Forward 422

xiii General 422 GetAllValues 422 GetBrowserVersion 423 GetCallStack 423 GetControlFromTable 424 GetControlFromXPathQuery 425 GetControlSearchTimeout 425 GetCurDir 426 GetCurrentBrowserType 426 GetDataSourceColumnNames 427 GetDiagnostics 427 GetDirectory 428 GetDirectoryNames 428 GetDotNETProperty 429 GetDotNETPropertyWithArgs 430 GetEnv 431 GetFieldValue 431 GetFileNames 432 GetFilePath 433 GetLength 433 GetLowLevelSpeed 434 GetMouseXCoordinate 435 GetMouseYCoordinate 435 GetNumItems 436 GetPlaybackDelay 436 GetPlaybackSessionName 437 GetPropertyMap 437 GetPropertyNames 438 GetPropertyNames - JSONObject 439 GetRecordsetColumnNames 439 GetRowValue 440 GetScreenHeight 441 GetScreenWidth 441 GetScriptVariable 442 GetSQLScalar 442

xiv GetStopwatchElapsedMilliseconds 443 GetStopwatchElapsedTime 443 GetValue - JSONArray 444 GetValue - JSONObject 445 GetVariableValues 446 GetVirtualUserID 446 GetWindowsVersion 446 HasProperty - JSONObject 447 HasProperty - PropertyMap 448 Help 448 Home 449 Hour 449 Hover 449 HTMLFindByID 450 HTMLFindByTag 451 If 451 IgnoreAutocompleteDropDowns 452 IgnoreErrors 453 IgnoreWarnings 453 InsertAt 453 Integer 454 InvokeDotNETMethod 454 InvokeDotNETMethodWithArgs 455 InvokeJavaScript 456 Is64BitWindows 457 IsArray 457 IsIgnoringAutocompleteDropDowns 458 IsIgnoringErrors 458 IsIgnoringWarnings 459 IsJSONArray 459 IsJSONObject 460 IsJSONType 460 IsDate 461 IsNull 462 IsNumeric 462

xv IsObject 463 JSONArrayGetValue 463 JSONArraySetValue 464 JSONCanParseAsArray 465 JSONCanParseAsObject 465 JSONIsValid 466 JSONNewArray 467 JSONNewObject 467 JSONObjectGetValue 467 JSONObjectSetValue 468 JSONParse 469 KeyDown 470 KeyPress 470 KeyUp 471 LastRow 472 Left 472 Length 473 LMouseClick 473 LMouseDoubleClick 474 LMouseDown 475 LMouseUp 476 LoadExternalAssembly 476 Lower 477 MakeRegExpression 477 MakeURL 478 Max 479 Maximize 479 Mid 479 Min 480 Minimize 481 Minute 481 MMouseClick 481 MMouseDoubleClick 482 MMouseDown 483 MMouseUp 484

xvi Month 484 MonthName 485 MonthNum 485 MouseMove 486 MouseMoveFromCurrentPosition 487 MoveDirectory 487 MoveFile 488 MSAADoDefaultAction 488 MSAASetName 488 MSAASetValue 489 Navigate 489 NewIssue 490 NewTab 490 NextRow 491 Now 491 OCRCheckpoint 491 OCRCheckpointPreviousStatement 493 OCRConvertToGrayscale 493 OCRGetContrast 494 OCRGetLanguageFilePath 495 OCRGetScale 496 OCRGetText 497 OCRGetTextFromFile 498 OCRGetTextPreviousStatement 499 OCRIsConvertingToGrayscale 500 OCRSetContrast 501 OCRSetLanguageFilePath 502 OCRSetScale 503 On Error 504 OpenRecordset 504 OpenRecordsetQuery 505 ParseString 506 PerformXPathQuery 506 Pop 507 PrevRow 508

xvii Print 508 PrintLn 509 Property 509 Property - PropertyMap 510 Push 511 Rand 511 Range 512 ReadRegistryEntry 512 ReadTextFile 513 RecordsetBOF 513 RecordsetEOF 514 RecordsetRowCount 515 Refresh 515 Rem 516 RemoveAt 516 RemoveField 517 RemoveProperty 518 Replace 519 ResetStopwatch 520 Resize 520 Restore 520 Right 521 RMouseClick 521 RMouseDoubleClick 522 RMouseDown 523 RMouseUp 523 RunBackgroundCommand 524 RunCommand 525 RunScriptRemote 526 RunSQLCommand 526 SaveRegionToImageFile 527 Script.CallScript 528 Script.ClearContext 529 Script.ClearLoadTestContext 529 Script.CloseApp 530

xviii Script.ConnectToProcess 530 Script.GetContext 531 Script.GetLineNumber 531 Script.GetLoadTestContext 532 Script.RunApp 532 Script.SetBrowser 533 Script.SetContext 534 Script.SetLoadTestContext 534 ScriptName 535 Second 535 Select...Case 536 Select 537 SelectRow 538 SelectTab 538 Set 538 SetAllFilesReadOnly 539 SetCell 539 SetControlSearchTimeout 540 SetDate 540 SetDateRange 541 SetDateTime 541 SetDiagnostics 542 SetFieldValue 542 SetFileReadOnly 543 SetDotNETProperty 544 SetDotNETPropertyWithArgs 545 SetLowLevelSpeed 545 SetPlaybackDelay 546 SetPlaybackSessionName 546 SetRowValue 547 SetScriptVariable 547 SetText 548 SetTime 548 SetValue 549 SetValue - JSONArray 549

xix SetValue - JSONObject 550 SimulateDriveReadOnly 551 SimulateDriveRemainingSpace 551 SimulateMemoryPerAllocationLimit 552 SimulateMemoryRemainingSpace 552 Sin 553 Size 554 SRand 554 StartStopwatch 555 StartsWithSubStr 555 Stop 556 StopStopwatch 556 Str 557 StrCompare 557 StrEquals 558 TestCaseStep 559 Throw 559 Time 560 Today 560 ToString - JSONArray 561 ToString - JSONObject 561 TouchDown 562 TouchMove 563 TouchUp 564 Trim 564 Try...Catch...Finally 565 TypeText 566 Upper 566 UserName 567 WaitForExists 567 WaitForExistsTimed 568 WaitForProperty 569 Warning 570 WebAddNetworkCredential 570 WebAddSessionVariable 571

xx WebClearAllCustomHeaders 572 WebClearNetworkCredentials 572 WebCloseAllConnections 572 WebCloseConnection 573 WebDelete 573 WebGet 574 WebGetAllCustomHeaders 574 WebGetCookie 575 WebGetCustomHeader 576 WebGetReferrer 577 WebGetUserAgent 578 WebHead 578 WebOptions 579 WebPatch 579 WebPatchFromFile 580 WebPatchJSON 581 WebPost 581 WebPostFromFile 582 WebPostJSON 583 WebPut 584 WebPutFromFile 584 WebPutJSON 585 WebRemoveAllSessionVariables 586 WebRemoveCustomHeader 586 WebRemoveSessionVariable 587 WebSetCookie 588 WebSetCustomHeader 588 WebSetReferrer 589 WebSetUserAgent 590 Weekday 590 WeekdayName 591 WeekdayNum 591 While 592 WriteRegistryEntry 592 Year 593

xxi Operators 593 Addition operator 594 And operator 595 Assignment operator 595 Concatenation operator 596 Division operator 596 Exponentiation operator 596 Is operator 597 Mod operator 597 Multiplication operator 597 Negation operator 598 Not operator 598 Or operator 598 Subtraction operator 599 Xor operator 599 Constants 600 Keywords 603 Date/time format examples 605 QA Wizard Pro environment variables 605 Appendix A: Supported Technologies and Controls 607 Appendix B: Run Results Email Field Codes 631 Appendix C: Third-Party Software Licenses 633 Glossary 635 Index 639

xxii What's New

QA Wizard Pro 2017.1 includes the following key features. For a complete list of features, enhancements, and bug fixes, check out the release notes.

Change the search method for multiple controls at the same time If QA Wizard Pro cannot locate or distinguish between controls during playback, you may need to change the search method used. You can now switch to a more accurate search method for multiple controls at the same time without manually updating properties of each control. See Changing the search method for multiple controls, page 128.

Use test data from PostgreSQL and SQLite databases You can now create external datasheets to import or link to existing data in PostgreSQL and SQLite databases for use in data-driven scripts. See Creating PostgreSQL datasheets, page 197 and Creating SQLite datasheets, page 199.

Improve the accuracy of optical character recognition OCR You can now improve the accuracy of text returned by optical character recognition (OCR). Set default playback options to control the contrast, image scale, grayscale conversion, and language file used to read graphical text in applications. See Using OCR to Work with Graphical Text, page 181 and Setting playback options, page 76. You can also use new OCR statements in scripts to adjust these options. See OCR statements, page 342.

Manually add windows and controls to use in scripts If QA Wizard Pro cannot capture windows or controls you need to test because they do not exist in the application or cannot be displayed during recording, you can now manually add them to the application repository to use them in scripts. This lets you create scripts that test new controls before they are implemented in the application if you use a test-driven development process. It can also help save time when you only need to add a small number of controls to the repository because you do not have to repopulate it. See Configuring user-added windows and controls, page 136.

Send custom header values with web requests during load tests Use the following statements to send custom headers and values when posting data during load tests: WebClearAllCustomHeaders, page 572, WebGetAllCustomHeaders, page 574, WebGetCustomHeader, page 576, WebRemoveCustomHeader, page 586, and WebSetCustomHeader, page 588.

Other enhancements n To quickly locate source files on the computer, you can now right-click a file in the Workspace pane and choose Open Containing Folder. n Use the SetAllFilesReadOnly, page 539 and SetFileReadOnly, page 543 statements to allow or prevent scripts from modifying files.

1 What's New

n Use new error handling statements to generate additional output that is helpful when debugging scripts. The Err.LineText, page 398 statement returns text where an error occurred. The Err.CallStack, page 395 statement returns the call stack up to the script line where the last error occurred. n Use the EncryptString, page 394 statement to conceal sensitive text entered in fields, such as passwords.

Note: TestTrack was renamed Helix ALM. The integration works the same as in previous QA Wizard Pro versions. Existing scripts work with both Helix ALM and earlier TestTrack versions.

Seapine License Server was renamed Helix ALM License Server. Seapine ALM Data Warehouse was renamed Helix ALM Data Warehouse.

2 Installing QA Wizard Pro

Perform the following tasks to install QA Wizard Pro. 1. Review important information to consider before installing QA Wizard Pro. See Before you install, page 3. 2. Run the installer and select the components to install. See Running the installer, page 4. 3. Review information about QA Wizard Pro and automated testing to help you get started. See After installation, page 6. 4. If you are an administrative user installing the QA Wizard Pro Server and dashboard, configure server options and the web server to host the dashboard. See After installation, page 6.

Before you install Review the following information before installing QA Wizard Pro.

System requirements Perform the following tasks to make sure the computer you are installing on meets the system requirements. n Review the recommended system requirements. If you are installing the QA Wizard Pro Server, review the server recommendations attached to the system requirements. n Check for and install all available Windows updates. The computer needs the latest updates to install additional resources required by QA Wizard Pro, such as the Microsoft Visual C++ redistributable package. n Make sure you are a member of the local Administrator group on the computer you are installing QA Wizard Pro on. If you do not have local administrative rights, you may be prompted to enter a serial number every time QA Wizard Pro starts and you may not be able to record scripts. Contact your system administrator for help.

Windows 8 support To test Windows 8 applications, you must install QA Wizard Pro in the default application directory (e.g., C:\Program Files\Perforce\QA Wizard Pro on 32-bit Windows or C:\Program Files (x86)\Perforce\QA Wizard Pro on 64-bit Windows).

Server database The QA Wizard Pro Server stores playback data in a SQLite database by default. This database (QAWServer.db) is automatically created when the server starts and does not require any setup or configuration. You can also use a Microsoft SQL Server, Oracle, or PostgreSQL database, but you must create an empty database before configuring the QA Wizard Pro Server. See Setting Up RDBMS Databases, page 317.

Web server for dashboard Before installing the QA Wizard Pro dashboard, make sure Microsoft Internet Information Services (IIS) is installed and enabled on the same computer that hosts the QA Wizard Pro Server. See the Windows help for information.

3 Running the installer

Upgrades Before upgrading the QA Wizard Pro Server, back up the server database and global application repository. See Backing up the QA Wizard Pro Server, page 262.

Note: The QA Wizard Pro Server is only compatible with the same version of QA Wizard Pro applications. If you are upgrading the server, make sure users also upgrade QA Wizard Pro applications so they can continue to send playback data to the server and access the global application repository.

After upgrading, you may be prompted to upgrade workspaces or the local application repository to the current version. These files cannot be reverted back to an earlier version after upgrading. As a best practice, make sure your files are backed up in a source control application before upgrading.

Running the installer To run the installer, double-click the qawizardproinstall.exe file.

Usage statistics During installation, you can choose to allow QA Wizard Pro to send usage statistics to Perforce. See Setting general options, page 40 for a list of information sent.

Components You can select to install the following components.

QA Wizard Pro Includes the following components to help you record and run scripts.

Component Description

QAWizardPro.exe QA Wizard Pro application. Includes a run-time mode, which is used with run-time licenses that only provide access to run scripts.

QAWRunScript.exe Runs scripts and batch files from a command prompt. See Running scripts from a command prompt, page 80.

QAWRunLoadTest.exe Runs load test scripts from a command prompt. See Running load tests from a command prompt, page 106.

QAWRemote.exe Runs scripts on a remote computer. See Running scripts remotely, page 250.

QAWReportViewer.exe Displays results reports, which are generated after scripts run. Reports include playback results, test computer configuration, how long scripts ran, and any warnings or errors that occurred. See Viewing results reports, page 75.

4 Running the installer

Component Description

SampleScripts.qawwspace Workspace that includes sample web and Windows scripts and datasheets. See Sample scripts and applications, page 22.

BugReport.exe and Sample applications used by the sample scripts. WysiCRM.exe

QA Wizard Pro Server The QA Wizard Pro Server (QAWServer.exe) stores global application data and hosts the server database. It is required to use the global repository, dashboard, status tool, and Helix ALM Data Warehouse integration. Only an administrative user needs to install the server on a networked Windows computer. The server admin utility (QAWServerAdmin.exe), which is used to manage the server, is also installed. See Managing the QA Wizard Pro Server, page 253.

Dashboard The dashboard lets you monitor script playback information and statistics in a web browser. To use the dashboard, an administrative user must install files on the same computer that hosts the QA Wizard Pro Server and configure a web server. See Installing and configuring the dashboard, page 97.

Status Tool The status tool (QAWStatusTool.exe) lets you review script playback information line-by-line. It does not require a license and can be installed on any computer to help you monitor local and remote scripts during and after playback. A connection to the QA Wizard Pro Server is required. See Viewing playback information in the status tool, page 99.

Installation directories QA Wizard Pro components are installed in the following directories by default.

Component Default directory Notes

QA Wizard Pro 32-bit Windows—C:\Program You can select a different application directory applications and Files\Perforce\QA Wizard Pro when running the installer. To test Windows 8 status tool 64-bit Windows—C:\Program Files applications, the default directory must be (x86)\Perforce\QA Wizard Pro used.

Server database QAWServer in the computer's root Directory is automatically created when the and global directory (e.g, C:\QAWServer) server is installed. application repository

Dashboard files C:\InetPub\wwwroot\qawdashboard Only change this directory if you are familiar with creating virtual directories on the web server.

5 After installation

After installation Review the following information to set up and use QA Wizard Pro after installation.

Users Review information to learn about using QA Wizard Pro. See Getting Started with QA Wizard Pro, page 7.

Server administrators Make sure the QA Wizard Pro Server service is running and then use the admin utility to configure server options. See Managing the QA Wizard Pro Server, page 253. If you also installed the dashboard, configure the web server so users can access it. See Installing and configuring the dashboard, page 97.

6 Getting Started with QA Wizard Pro

QA Wizard Pro records actions you perform as you interact with a web, Windows, or Java application and adds them as steps in scripts used to automate testing. After recording scripts, you can modify them to make sure they perform all actions required to complete a test. When you are ready to perform tests, run scripts and then review the results in a detailed report. This gives you all the information needed to verify tests and report issues to the development team.

Before you start Review the following information to learn more about QA Wizard Pro and automated testing. n Key QA Wizard Pro concepts provides an overview of common terminology and concepts you should be familiar with before using QA Wizard Pro. n Understanding the testing process provides information about QA Wizard Pro concepts in context of the automated testing process. n QA Wizard Pro Best Practices provides recommended guidelines that can help you avoid common mistakes and improve the quality of your automated tests.

Starting to use QA Wizard Pro Following are some common tasks you should complete to get started with QA Wizard Pro. If you need help installing QA Wizard Pro, see Installing QA Wizard Pro, page 3. 1. Start QA Wizard Pro and add your license. 2. Get familiar with the QA Wizard Pro interface.

Tip: You can use the SampleScripts workspace installed with QA Wizard Pro to view sample web and Windows scripts and experiment with QA Wizard Pro functionality before setting up your own tests. See Sample scripts and applications, page 22.

3. Create a workspace to organize scripts, run reports, datasheets, and any other files for performing tests. 4. Add the application to the local application repository. 5. Record scripts against the application to capture actions to perform during the test and add the windows and controls to the repository. 6. Run scripts to perform tests. During playback, QA Wizard Pro compares the tested application against the window and control information in the application repository. If differences are found, the script fails. 7. View results reports for information about scripts that ran, any warnings or errors that occurred, and the overall status of the playback session.

Taking it to the next level After you become more familiar with QA Wizard Pro, you can perform the following tasks to create more complex tests. n Modify scripts to add or edit statements that perform actions during playback. n Use checkpoints to verify application attributes.

7 Key QA Wizard Pro concepts

n Create data-driven scripts to run multiple iterations of the same test using different sets of data from datasheets. n Modify window and control properties to optimize tests and manage changes to the application. n Debug scripts to troubleshoot errors. n Install and configure the QA Wizard Pro Server to use the dashboard and status tool to monitor playback or use the global application repository to provide application data to other users.

Key QA Wizard Pro concepts Following are some key concepts you should be familiar with before using QA Wizard Pro. Understanding the testing process, page 9 provides information about these concepts in context of the entire automated testing process.

Application repository Application repositories store information about tested applications and versions. When you record a script, QA Wizard Pro captures the application windows and controls and their properties. This information is saved in the repository. When you run a script, the information is used to find windows and controls and perform actions on them. If the window or control is not found, the script fails. See About application repositories, page 57.

Workspaces Workspaces organize scripts, datasheets, and related files. Depending on your process, you may use one workspace for each application or for each functional area you are testing. You can create folders to organize files in workspaces. See Creating workspaces, page 23.

Scripts Scripts contain statements, which are instructions that control how a script runs and performs actions in the tested application. For example, you can call other scripts, declare variables, specify steps to run based on conditions, or repeat a block of steps. See Statements, page 321. Typically, you create scripts by recording against an application. See Recording new scripts, page 65. You can also manually create scripts. To perform a test, you run a script and QA Wizard Pro performs the actions specified in statements in the application. Playback fails if a bug is found in the tested application or if there is a problem in the script. See Running scripts, page 73. You can work with scripts in Keyword View or Text View. Keyword View displays scripts in a grid format, while Text View displays scripts in a text-based editor and provides access to the . See Using Keyword View, page 27 and Using Text View, page 28.

Datasheets Data-driven testing allows you to test multiple scenarios and data ranges with one script. The test data is stored in a separate file, which is a datasheet. Datasheets are stored in workspaces with scripts and other related test files.

8 Understanding the testing process

QA Wizard Pro supports local and external datasheets. You can create test data in a local datasheet, which is a simple spreadsheet created in QA Wizard Pro and stored locally. You can also link to external test data stored in Microsoft Access, Microsoft Excel, Microsoft SQL Server, Oracle, PostgreSQL, SQLite, or text files. See About datasheets, page 187.

Checkpoints Checkpoints help you verify the tested application is working as expected. Checkpoints are statements in scripts used to verify that attributes of an application exist or are correct when compared to an expected value during playback. See Using Checkpoints, page 165.

Reports QA Wizard Pro generates and saves a results report after a script runs. The report includes information about the script, such as the test computer configuration and how long it took the script to run. Reports are stored in workspaces with scripts and other related test files. See Viewing results reports, page 75. You can also monitor scripts in real-time using the dashboard and status tool, which display local and remote script information during playback. You can monitor scripts from any location, such as at home or another office. See Viewing playback information in the dashboard, page 90 and Viewing playback information in the status tool, page 99.

Understanding the testing process Automated testing with QA Wizard Pro involves setting up and planning tests, recording, modifying, and running scripts, and analyzing test results.

Setup Before you start recording scripts, perform the following setup tasks. n Determine which test cases to automate—Consider automating a test if it has predictable results, needs to be performed multiple times, evaluates high-risk conditions, requires testing multiple data values for the same actions, is expensive or impossible to perform manually, or needs to be performed on different hardware or software configurations. n Set up the testing environment—Make sure you have access to the hardware, software, and network resources that you need to record or run tests. n Create a workspace—Workspaces organize scripts and related reports and datasheets. Depending on your organization's process, you may use one workspace for each application or for each functional area. See Creating workspaces, page 23. n Set up the application in the application repository—Application repositories store information about the tested application and version. Each version contains window and control data that identifies and locates objects. See Managing Application Repositories, page 57. n Set general and playback options—Take a few minutes to set general options that control how QA Wizard Pro works and set playback options that control how scripts run. See Setting general options, page 40 and Setting playback options, page 76.

9 Understanding the testing process

n Configure Helix ALM and source control integration (optional)—Integrate QA Wizard Pro with Helix ALM to submit issues when tests fail and manage issues and other testing tasks. See Integrating with Helix ALM, page 265. Integrate with Surround SCM or another source control application to manage changes to workspaces, scripts, and local datasheets. See Integrating with Source Control Tools, page 285.

Recording You can record two types of scripts: standard QA Wizard Pro scripts used for functional and regression testing and load test scripts used for testing performance under load. When you record a standard QA Wizard Pro script, you interact with the application or web site exactly as a user would and QA Wizard Pro adds the actions to the script. When you record a load test script, you also interact with the web application exactly as a user would but QA Wizard Pro adds the information exchanged between the application and server to the script. See Recording Scripts, page 65 and Recording load test scripts, page 103.

Modification Recorded scripts provide a baseline for application testing. You can modify recorded scripts to create more flexible scripts and complex testing scenarios. In addition to recording additional steps, and modifying or deleting steps, you can enhance scripts by: n Adding statements—Statements are instructions in each step that control how the script runs. For example, you can call other scripts, declare variables, specify steps to run based on conditions, or repeat a block of steps. See Statements, page 321. n Creating checkpoints—Checkpoints verify that the value of a property in a window or control matches an expected value during playback. See Using Checkpoints, page 165. n Creating data-driven scripts—Data-driven scripts are the easiest way to create multiple test iterations, allowing you to use data from a local datasheet, Excel spreadsheet, text file, or Access, Oracle, PostgreSQL, SQLite, or SQL Server database to test a different set of data each time a script runs. See Creating Data-Driven Scripts, page 187.

Tip: You can modify scripts in Keyword View or Text View. Keyword View displays scripts in a grid format, while Text View displays scripts in a text-based editor and also provides access to the scripting language. See Using Keyword View, page 27 and Using Text View, page 28.

Execution Execute, or run, scripts to perform a test. During playback of standard QA Wizard Pro scripts, the tested application is compared to the information stored in the application repository. During playback of load test scripts, the web application is run under a simulated load of users. QA Wizard Pro provides several ways to run scripts. You can run an individual script or multiple scripts, run scripts from a command prompt, run scripts on a remote computer, or run scripts in a batch file to perform unattended tests. See Running scripts, page 73 and Running load tests, page 104. Scripts fail if a bug is found in the tested application or if there is a problem in the script. You can troubleshoot a script by debugging it, which allows you to step through a script to locate the problem. You can also step into a called script to debug it. See Running scripts in debug mode, page 211.

10 Starting QA Wizard Pro

You can monitor scripts in real-time using the dashboard and status tool if QA Wizard Pro applications are configured to send playback data to the server. See Viewing playback information in the dashboard, page 90 and Viewing playback information in the status tool, page 99.

Analysis After scripts run, QA Wizard Pro generates and saves a report that summarizes the test results. The report contains information about failed script steps, how long the script took to run, and the test computer configuration. Use this information to determine if problems exist in the application or if you need to modify the script. See Viewing results reports, page 75 and Viewing load test results reports, page 109. If QA Wizard Pro is integrated with Helix ALM, you can submit reports to add issues. This saves testing and development time and ensures all team members have the information they need to perform their assigned tasks. See Adding Helix ALM issues from run reports, page 278.

Starting QA Wizard Pro Choose Start > All Programs > Perforce > QA Wizard Pro > QA Wizard Pro.

Managing licenses You must enter at least one serial number before you can use QA Wizard Pro. See QA Wizard Pro Pricing and Licensing for information about licensing.

Note: A standard QA Wizard Pro license includes five virtual users for load testing. Additional virtual users require a separate load testing license.

1. Choose Tools > Licensing. The Manage Licenses dialog box opens. 2. Click Add to add a license. 3. Enter the serial number and click OK.

Note: Select a license and click View to see the license details. A record of maintenance extenders is also displayed.

QA Wizard Pro interface Take some time to get familiar with the interface before you start working in QA Wizard Pro.

Tip: You can move and hide panes to display only information you need in your preferred layout. See Customizing the interface, page 35.

11 QA Wizard Pro interface

# Area Use to:

Toolbars Access the most commonly used QA Wizard Pro actions. To display or hide a toolbar, choose View > Toolbars and the toolbar name. You can also add buttons to toolbars and create custom toolbars. See Customizing toolbars, page 36.

Workspace Organize test data, including scripts, batches, and datasheets. See Workspace pane, pane page 21.

Reports View reports generated after running scripts. See Reports pane, page 17. pane

Statements View statements you can add to scripts. Double-click a statement to open the Add pane Statement dialog box. See Statements pane, page 19.

Script pane Edit and view scripts, reports, and datasheets. You can work with scripts in Keyword View or Text View. See Script pane, page 18.

Add/Edit Add and edit statements in scripts. Available in both Keyword View and Text View. Statement See Adding statements, page 146. dialog box

12 Application Repository pane

# Area Use to:

Preview Preview application screenshots captured during playback. See Preview pane, page pane 16.

Application Manage tested applications, versions, windows, and controls. Window and control Repository information stored in the application repository is used to locate objects and compare pane properties during script playback. See Application Repository pane, page 13.

References View all references to a variable, function, or subroutine found when searching scripts. pane See References pane, page 17.

Find View text found when searching scripts. See Find Results pane, page 15. Results pane

Call Stack View the stack of function calls made until an error or breakpoint occurs, which can pane help you debug scripts. See Call Stack pane, page 14.

Helix Work with Helix ALM issues, test cases, test runs, and workbook tasks. Requires ALM item integration with Helix ALM. See Helix ALM panes, page 20. panes

Variables View script and repository variables when debugging scripts. See Variables pane, pane page 20.

Errors pane View errors and warnings that occur during script playback. See Errors pane, page 15.

Output View information based on instructions you add to scripts. For example, as a script pane runs, you may want to capture a value from the tested application and print it in the Output pane. See Output pane, page 15.

Pending View modified, checked out, and new source control files in the workspace. Requires Changes integration with a source control tool, such as Surround SCM. See Pending Changes pane pane, page 16.

Application Repository pane Tested applications, versions, and windows and controls are stored in the application repository. During recording, QA Wizard Pro captures information about the application's windows and controls and adds it to the corresponding application and version repository. During script playback, QA Wizard Pro compares the window and control properties in the repository to the tested application to locate objects.

13 Call Stack pane

Note: on the control type icon indicates the window or control was manually added by a user. See Configuring user-added windows and controls, page 136.

Call Stack pane Displays the stack of function calls made until an error or breakpoint occurs. The function and arguments, script, and script line number are displayed, which can help you trace functions completed before an error occurred and view the script you are working in when using the stack to debug scripts. See Running scripts in debug mode, page 211.

Note: You can also use the GetCallStack statement in scripts to retrieve stack information. See GetCallStack, page 423.

Double-click a call stack line to go to the corresponding script step.

Tip: To copy the call stack information, right-click the call stack and choose Copy. This is helpful if you want to add the information to a Helix ALM issue or email it to another team member.

14 Errors pane

Errors pane Displays script syntax errors and errors and warnings that occur during script playback. Each error identifies the script line number where the error occurs. You can select to show only errors, only warnings, or both. Errors and warnings may include hints for resolving playback issues. Some hints include links to controls in the application repository or dialog boxes where you may be able to resolve the issue.

Tip: Right-click the error and choose Copy to copy the error information. This is helpful if you want to add the information to a Helix ALM issue or email it to another team member.

You can filter the information displayed in the Errors pane. n Show errors displays the errors that caused the script to fail. Show handled errors displays errors that occurred but were handled in the script without stopping playback. n Show warnings displays the warnings that you may want to investigate but did not cause the script to fail.

Note: You can use the call stack to trace function calls to the point when an error occurred. Choose View > Call Stack to display the stack information. See Call Stack pane, page 14.

Find Results pane Displays all instances of text found when searching multiple scripts. Double-click a result to view the text in the script. See Finding text in multiple scripts, page 159.

Output pane Displays information based on instructions you add to scripts. For example, you may want a script to capture a value from the application and print it in the Output pane.

15 Pending Changes pane

Note: To search the Output pane, make sure the pane has focus then choose Edit > Find.

Pending Changes pane When source control integration is enabled, all modified, checked out, and new files in the workspace are displayed in the Pending Changes pane. You can select a file and check it in, undo the check out, or view differences between the local file and the file on the source control application server. See Integrating with Source Control Tools, page 285.

Preview pane Displays application screenshots captured during playback. When you click a script step in Keyword View or Text View, the control that the action was performed on is highlighted. You can select controls in the Preview pane to quickly locate them in the Application Repository pane.

16 References pane

Note: Click to zoom in, to zoom out, or to display the screenshot at actual size. Select Auto Fit to display the entire screenshot.

References pane Displays all places where a variable, function, or subroutine is referenced when searching scripts. Double- click a result to view the reference in the script. See Finding variable, function, and subroutine references in scripts, page 153.

Reports pane Displays the reports generated after running a script if the playback option to automatically generate a report is set. See Setting playback options, page 76. Reports are organized by their corresponding script.

Tip: To quickly find a report, search for it by name. Click in the search field to clear the results.

17 Script pane

Script pane The Script pane is the main area where you work with scripts, reports, and datasheets. This pane includes a Keyword View and Text View. Keyword View displays scripts in a grid format. Actions are grouped by the window they are performed on. See Using Keyword View, page 27.

Text View displays scripts in a text-based editor. Text View also provides access to the scripting language, which makes it easy to create and edit statements, modify scripts, and add advanced logic to scripts. See Using Text View, page 28.

18 Statements pane

Working with multiple items You can open multiple scripts, datasheets, and reports to work with them at the same time. Use the following options to navigate between open items. n To view all open items when more tabs than can be displayed are open, click in the upper-right corner of the pane. Select an item from the list to view it. To go to the previous or next open item, click or .

n To view multiple items at the same time, right-click a tab and select New Horizontal Tab Group or New Vertical Tab Group. To move an item to a different tab group, right-click it and choose the group to move it to. n To go to the previous or next location you were working in, click the Go Back or Go Forward toolbar button. You can also choose Script > Go Back or Go Forward. QA Wizard Pro keeps track of the cursor location when you switch between scripts and script lines, go to definitions, find and replace text in scripts, debug scripts, and double-click errors in the Errors pane. You can go back or forward up to the 10 most recent locations. n To close items, right-click the tab and select Close, Close All, or Close Other Tabs. You can also click in the upper-right corner of the pane to close the open item.

Statements pane Displays statements that can be added to scripts. When adding instructions to a script, double-click a statement to open the Add Statement dialog box with the item selected. See Statements, page 321.

Tip: Select a statement type from the Category list to limit the statements displayed. To quickly find a statement, search for it by name. Click in the search field to clear the results.

19 Helix ALM panes

Helix ALM panes Display Helix ALM issues, test cases, test runs, and workbook tasks. If QA Wizard Pro is integrated with Helix ALM, item list windows open in these panes by default. See Integrating with Helix ALM, page 265.

Variables pane Displays script and repository variables when debugging scripts. See Troubleshooting variables, page 213.

20 Workspace pane

Workspace pane Organizes test data, including scripts, batches, and data sources. If a main script is set for the workspace, the script name is displayed in bold. See Setting and running a main script, page 74. To work with an item in a workspace, double-click it to open it in the Script pane.

Tip: To quickly find an item in the workspace, search for it by name. Click in the search field to clear the results. To find a file in the workspace on the computer, right-click it and choose Open Containing Folder.

New workspaces include the following default folders.

Folder Used to organize:

Scripts Script files used to run tests

External Datasheets Input data from external sources

Local Datasheets Input data maintained in QA Wizard Pro

You can rename the default folders or create new folders to group related scripts, datasheets, batches, and any other test files in the workspace. See Using folders, page 24.

21 Sample scripts and applications

Sample scripts and applications You can use the sample scripts, datasheets, and applications installed with QA Wizard Pro to understand how scripts work and experiment with functionality.

Applications The following applications are available to record and run sample scripts against.

Application Description How to access it

Bug Windows application with a form for C:\Program Files (x86)\Perforce\QA Reporter submitting software bug reports. Wizard Pro\BugReport.exe

Sample Windows application for drawing shapes and C:\Windows\System32\mspaint.exe MSPaint images.

WysiCorp Windows .NET application with forms for C:\Program Files (x86)\Perforce\QA CRM managing customer records. Wizard Pro\Wysi_CRM.exe

WysiCorp Web site with a form for submitting software Version 1.0— Web Site bugs. www.wysicorp.com/wysicorp/login.php Version 2.0— www.wysicorp.com/home.html

Workspace The SampleScripts workspace includes scripts and datasheets used to perform various tests against the sample applications. The Test Suite script is set as the main script in the workspace. It runs a series of other sample scripts that perform individual tests as part of a complete test suite. You can run the main script without opening it, making it easy to quickly run all scripts in the suite. See Setting and running a main script, page 74. The workspace includes additional sample scripts organized in the following folders.

Folder Includes scripts that run Used to: against:

Basic Bug Reporter, Sample Perform simple actions to test common user tasks. Scripts MSPaint, WysiCorp CRM, and WysiCorp Web Site

Data- WysiCorp CRM and Run multiple iterations of the same test with different sets Driven WysiCorp Web Site of data from the WysiCorp Bugs Excel file or Scripts WysiCRM Contacts datasheet.

Advanced Bug Reporter, WysiCorp CRM, Demonstrate advanced procedures and functions. Scripts and WysiCorp Web Site

To open the workspace, choose File > Open Workspace and select the SampleScripts.qawwspace file in the C:\Users\\Documents\QA Wizard Pro Workspaces\Sample Workspace directory.

22 Creating workspaces

Creating workspaces Workspaces are used to organize scripts, related run reports, and any test data. All the files associated with a workspace are stored in the same directory as the workspace file. Workspaces can grow quickly as you develop scripts. One way to keep workspaces organized is to think of them as test scenarios. For example, you are creating a regression suite for WysiWrite. One of the areas you will test is the Tools menu, which contains eight options. To stay organized, create a folder for WysiWrite and a subfolder for the Tools menu and then create workspaces and subdirectories in the QA Wizard Pro Workspaces directory for each option on the Tools menu. Your use of workspaces depends on your organization's testing process.

Note: You must create at least one workspace before you record scripts.

1. Choose File > New > New Workspace. The Add New Workspace dialog box opens. 2. Enter a workspace File name. 3. Select a location to save the workspace in or browse to select a different location. Workspace files are saved in C:\Users\\Documents\My Documents\QA Wizard Pro Workspaces by default, with a qawwspace extension. 4. Click Save. The workspace is created.

Tip: You can add existing files, such as scripts in different workspaces, images, and local datasheets, to workspaces. See Adding existing files to workspaces, page 23 and Adding existing local datasheets, page 188.

Adding existing files to workspaces You can add existing files to a workspace to group related files. This helps ensure all required test files are available when scripts run. For example, you can add scripts from other workspaces, text files used to log script information, images used in checkpoints or comparisons, load test .postdata files, and external datasheets that are stored locally to a workspace. When you add an existing file, it is shared and not copied. Any changes you make to the file are available in all workspaces it is in.

Note: After adding files to a workspace, you can organize them in folders. See Using folders, page 24.

1. Choose File > Add Existing File. The Add File dialog box opens.

23 Using folders

2. Browse to the file, select it, and click Open. The file is added to the workspace.

Tip: To find a file in the workspace on the computer, right-click it and choose Open Containing Folder.

Using folders You can create folders to organize the scripts, batches, and datasheets in a QA Wizard Pro workspace.

Note: New workspaces include Scripts, External Datasheets, and Local Datasheets folders by default. These folders can be renamed or removed.

1. Choose File > New > New Folder. The Folder Information dialog box opens. 2. Enter a Folder Name. 3. Click OK. The folder is added to the workspace.

24 Modifying workspace properties

4. Select a folder to add an item.

n To add an existing file, such as a script in a different workspace or images needed for scripts to run without failing, choose File > Add Existing File. See Adding existing files to workspaces, page 23.

n To add a new batch file, choose Batch > New Batch. See Creating batch files, page 83.

n To add an existing batch file, choose Batch > Add Existing Batch.

n To add a datasheet, choose Data > Create Datasheet. See Creating Data-Driven Scripts, page 187.

Tip: Drag items that are already added to the workspace into folders.

Modifying workspace properties You can change the workspace name and directory to store results reports in, and set Helix ALM and source control integration options. 1. Select the workspace in the Workspace pane. 2. Choose File > Properties. The Properties dialog box opens with the General tab selected.

25 Opening workspaces

3. Optionally enter a new Name. 4. Enter a Reports directory to store results reports in. Click Browse to select a location. 5. Enter a Load test reports directory to store load test results reports in. Click Browse to select a location. 6. Click the Helix ALM tab to modify the integration options. See Integrating with Helix ALM, page 265. 7. Click the Source Control tab to modify the integration options. See Configuring source control integration, page 285. 8. Click OK to save the changes.

Opening workspaces Open a workspace to access scripts, related run reports, and test data. Keep the following in mind: n Only one workspace can be open at a time. n If the workspace is formatted for an earlier QA Wizard Pro version, you are prompted to upgrade it or open it as read-only. Click Upgrade Workspace to upgrade it to the current version. The workspace file cannot be reverted back after upgrading. Click Open as Read-Only to open it as read-only. You cannot modify read-only workspaces. n If the workspace is in an unknown format, you cannot open it. It was most likely created in a newer version of QA Wizard Pro than the one you are using. You need to upgrade to the current QA Wizard Pro version to open it. 1. Choose File > Open Workspace. The Open Workspace dialog box opens. 2. Select the workspace and click Open. The workspace opens.

Tip: Choose File > Recent Workspaces to open a recently used workspace.

26 Using Keyword View

Using Keyword View Keyword View displays scripts in a grid format. Each script line is a statement, which specifies how QA Wizard Pro interacts with the tested application.

Tip: If you are a new QA Wizard Pro user, you may want to work in Keyword View to become familiar with the program.

Actions are grouped by the window they are performed on. The following information is displayed in the rows and columns.

Column name Description

# Script step number; corresponds to the line number in Text View

Action Statement that is performed

Control Control the action is performed on; not displayed when viewing load test scripts

Information Statement information, such as arguments

Comment Script step comments

Use the GUI statement editor to work with statements in Keyword View. To add a statement, choose Script > Add Statement. To edit a statement, choose Script > Edit Statement.

Tip: You can also edit arguments directly in Keyword View. Click an Information cell and enter the value.

27 Using Text View

Using Text View Text View displays scripts in a text-based editor and gives you access to the scripting language. Each script line in Text View is a statement, which specifies how QA Wizard Pro interacts with the tested application.

Note: You can customize the font and colors used in Text View. See Setting Text View font and color options, page 34.

Use one of the following methods to work with statements in Text View. n Use the GUI statement editor. To add a statement, choose Script > Add Statement. To edit a statement, choose Script > Edit Statement. If you are a new QA Wizard Pro user, you may want to use the GUI statement editor. n Use code completion, which displays the available statements or actions as you type. n Manually type the statement.

Tip: A sample workspace that includes both web and Windows scripts is installed with QA Wizard Pro. To learn more about Text View, you may want to open a sample script, read the comments, and experiment with the functionality. See Sample scripts and applications, page 22.

Understanding script syntax Each statement has its own syntax rules. If you do not follow these rules, errors are returned when you run the script. Keep the following in mind: n Each statement must be on one line. n Enclose text string values in double quotation marks (e.g., "TextString"). n Do not use any quotation marks with variable or numeric values. n To specify a menu item by index, enclose the index number in square brackets ([]). For example, Window ("WysiCorp CRM").Menu("MenuBar").Item("Options/[4]").Select(). n The following escape characters are supported for all string literals: \n, \r, \t, \\, \' and \".

28 Declaring variables in Text View

n Slashes in menu, ListView, and tree control text must be escaped for literal interpretation during playback.

n Escape forward slashes with two backslashes (\\). For example, the following statement selects the 'Find/Replace' item in the Edit menu: Window("Window").Menu("MenuBar").Item ("Edit/Find\\/Replace").Select().

n Escape backslashes with three backslashes (\\\). For example, the following statement selects the 'Backlash -\' item in the Character List tree: Window("Window").Tree("List").Item("Character List/Backslash - \\\\").Select(). n The scripting language is not case sensitive, with the following exceptions: when comparing strings in conditional statements or using the Checkpoint or Chr statement to check strings. n You can add spaces to a script to improve readability (e.g., it may be easier to read x = 10 than x=10). n Keywords, such as constants or strings, are displayed in different colors to help with readability.

Note: You cannot switch between Keyword View and Text View until any syntax errors, which are displayed in the Errors pane, are resolved.

About code completion Text View's code completion feature displays the available statements or actions as you type. n Enter an equal sign (=) to display a list of functions, which return values. Scroll through the list to select the function to use. Double-click the function or press Enter to add it to the script. Many functions are also available in the GUI statement editor. n Press the spacebar at the beginning of a line to display a list of all statements. Scroll through the list and click the statement you want to use. Double-click the statement or press Enter to add it to the script. n Enter a period (.) after a window or control to display a list of actions or objects. The items in this list change based on the selected window or control. Scroll through the list to select the action or object you want to use. Double-click the action or object or press Enter to add it to the script. n Enter Script and a period to display a list of script actions. n Enter Browser, a web page name in quotes (optional), and a period to display a list of browser actions. For example, Browser("WysiCorp Login"). n Enter Window, a window name in quotes, and a period to display a list of window control types, such as Button or Listbox. For example, Window("Feedback"). n Enter Window, a window name in quotes, a period, a control type, a control name in quotes, and a period to display a list of control type actions, such as Click or TypeText. For example, Window ("Feedback").Editbox("editboxCompany").

Declaring variables in Text View QA Wizard Pro includes script and repository variables, which are both used to store information. n Script variables are defined in a script and can only be used in the script they are created in. n Repository variables are defined in the application repository and can be used in all scripts recorded or run against an application. See Using repository variables in scripts, page 220. Variables can be declared explicitly or implicitly. The variable value can be a text string, expression, or value from an associated datasheet.

29 Declaring variables in Text View

Variables can be explicitly declared using the Dim statement. Variables can also be implicitly declared by assigning a value. Dim sampleA sampleA = 10 sampleB = 20 PrintLn sampleA PrintLn sampleB sampleA = "Hi" sampleB = "there" PrintLn sampleA PrintLn sampleB The variable type is not explicitly declared. Notice that the variables are initially assigned an integer and later assigned a text string.

Note: Variables do not have a specific type (e.g., integer or string). It is much easier to declare variables implicitly by using the variable name in a script. If you use arrays, you must use the Dim statement to declare variables explicitly.

If you create a variable called by other scripts, the variable name must conform to the following rules: n Must start with an alphabetic character n Cannot contain spaces n Can only contain alphanumeric characters or underscore characters

Variable scope Variable values are persistent in called scripts. Keep the following in mind: n If a script is called several times in one run, the values stored in the variables are persistent. The second time the script is called, the variables are populated with the values from when the script exited the first time. n Called scripts use the repository variable values from the script that called them unless they are declared explicitly or the ClearContext statement is used to clear the connection to the repository in the called script.

Assigning variable values You generally declare variables and assign values at the same time. Use the following format to declare a variable and assign a value to it: VariableName = value VariableName is the variable name and value is the value to assign to the variable. For example: x = 5 myUser = "WebUser"

30 Declaring arrays in Text View

Tip: As you work with a script, you can view a list of variables, functions, and subroutines defined in the script in the Definition field at the top of the Script pane. To go directly to the script line where a variable is defined, select it in the Definition field or right-click a script line that references it and choose Go To Definition. See Finding variable, function, and subroutine definitions in scripts, page 153.

Calling script variables from another script Script variables are defined at the script level. To use a script variable with another script in the same workspace, you must first call that script using the Script.CallScript, page 528 statement. You do not have to immediately use the variable. For example, you create a variable named User in the Login script. You want to use the User variable in a new script named TestLogin. First, you call the Login script: Script.CallScript("Login") To use the variable, enter the called script name, a period, then the variable name. For example: PrintLn Login.User

Note: You can also use the GetScriptVariable, page 442 and SetScriptVariable, page 547 statements to access another script and work with variables.

Declaring arrays in Text View An array is a variable that contains a series of values. The variable value can be a text string, expression, or value from an associated datasheet. Variables can be declared explicitly or implicitly. You must use the Dim statement to declare array variables explicitly. Use the following format to declare an array: Dim ArrayName(x) ArrayName is the array variable name and x is the number of elements. For example: Dim Users(2) This creates an array with two elements. Arrays are one-based, so the first array element is indexed 1 and the last is the number specified when declaring the array. QA Wizard Pro supports arrays with up to three dimensions. To declare multiple dimensions, separate the numbers with commas. In the following example, the TestTable variable is a two-dimensional array that includes three rows and one column: Dim TestTable(3,1)

Note: In a two-dimensional array, the first number is always the number of rows and the second number is the number of columns.

Assigning array values Each element in an array can be accessed by an index number. In the previous example, Dim Users (2) was declared as the array. Values are assigned to the array elements: Users(1)="ClientUser" Users(2)="RemoteUser" To store values in an array with more than one dimension you must reference each dimension. For example:

31 Creating functions and subroutines in Text View

TestTable(3,2) = 28

Declaring dynamic arrays You can use dynamic arrays to change an array size during script playback. Use dynamic arrays if you want to declare an array and do not know the size, or to resize an existing array. Declare the array using the Dim statement and then use the ReDim statement to resize it. For example: Dim Users(3) Users(1)="User1" Users(2)="User2" Users(3)="User3" ReDim Users(5,2) This creates an array with three elements and then the ReDim statement resizes the array to be two- dimensional with five rows and two columns. The values assigned to the array are cleared when the ReDim statement is called. To preserve the contents of the array when it is resized, use the Preserve keyword. For example: Dim Users(3) Users(1)="User1" Users(2)="User2" Users(3)="User3" ReDim Preserve Users(10) This creates an array with three elements and then is resized to 10 elements. The three assigned values (User1 through User3) are preserved in the array when the ReDim statement resizes it.

Creating functions and subroutines in Text View You can define functions and subroutines to organize and structure scripts for easier maintenance. You may want to create subroutines and functions for commonly performed actions such as logging in to an application, or for generating data, such as unique passwords. You can create subroutines or functions in individual scripts, but they are most often created in scripts called by other scripts. You can also create multiple functions or subroutines in the called script. If you store functions or subroutines in a script called by other scripts, the script name must conform to the following rules: n Must start with an alphanumeric character n Cannot contain spaces n Can only contain alphanumeric characters or underscore characters

Tip: As you work with a script, you can view a list of variables, functions, and subroutines defined in the script in the Definition field at the top of the Script pane. To go directly to the script line where a function or subroutine is defined, select it in the Definition field or right-click a script line that references it and choose Go To Definition. See Finding variable, function, and subroutine definitions in scripts, page 153. You can then click the Go Back and Go Forward toolbar buttons to navigate back and forward through the areas you worked in.

32 Creating functions and subroutines in Text View

Declaring subroutines Use the Sub...End Sub statements to declare subroutines. Subroutines do not return values. For example, a=Sub1 results in an error because Sub1 cannot return a value. Use the following format to declare subroutines: Sub Name (arg1, arg2,…) [statements] End Sub

Declaring functions Use the Function...End Function statements to declare functions. Functions can accept an unlimited number of arguments and must always return a value. You can define the return value to be whatever you need. The expression is evaluated and results are returned to the calling statement or script. Functions are generally assigned to a variable or printed to the Output pane. Use the following format to declare functions: Function Name (arg1, arg2,…) [statements] Return result End Function

Returning values from functions To return a value from a function, use the Return keyword. You do not have to assign the value to the function name. The following examples show how the return keyword is used. Function myFuncReturnCheck(value) Return value End Function retrieved = myFuncReturnCheck("string") PrintLn(retrieved)

Calling functions and subroutines within a script To call a function or subroutine in the same script, refer to it by name. For example, you create a function named timeWithDashes. To use it, add the following line to a script: PrintLn("Date and time script ran:" + timeWithDashes())

Calling functions and subroutines from another script To call a function or subroutine from another script, you must first call that script using the Script.CallScript, page 528 statement. You do not have to immediately use the function or subroutine. To run the function or subroutine, enter the called script name, a period, then the function or subroutine name: ScriptName.FunctionName/SubroutineName

Note: To avoid syntax errors, the called script name must start with an alphabetic character, cannot contain spaces, and can only contain alphanumeric or underscore characters.

33 Setting Text View font and color options

For example, you created a script named Utilities that stores subroutines. Add the following lines to the script to call the WebLogin subroutine: Script.CallScript("Utilities") Utilities.WebLogin()

Setting Text View font and color options These options control the font and colors used in Text View. 1. Choose Tools > Options. The Options dialog box opens. 2. Click the Text View tab.

3. Select the Font and Size to use for all items displayed in Text View. 4. Select a Display item and make any changes. A preview of the color and style is displayed in the Sample area.

n Select an Item foreground and Item background color from the list or click to select a custom color. Select Same as Plain Text to set the foreground color to match the color for plain text (Line Numbers, Collapsed Outline Block, Comment, Current Statement (Debug), Keyword, String, and Syntax Error only). Select Default to use the QA Wizard Pro default color.

n Select Bold, Italic, or Underline to apply styles to the text.

Note: Custom colors are not available for all display items.

5. Click Reset to Defaults to reset all formatting to the QA Wizard Pro default values. 6. Click OK to save the changes.

34 Customizing QA Wizard Pro

You can customize the QA Wizard Pro interface, toolbars, and keyboard shortcuts to suit your personal preference and help you work more efficiently.

Customizing the interface QA Wizard Pro's advanced docking system makes it easy to customize the layout of panes and windows. You can close, dock and undock, auto hide, float, and move panes. The Script pane cannot be modified.

Note: Choose View > Reset Layout to reset the QA Wizard Pro interface.

Auto hiding panes Auto hide allows unused panes to be hidden and conserve screen space for other panes and windows. Auto hide panes are collapsed into a tab. 1. To auto hide a pane, click the pushpin icon in the pane title bar. You can also right-click the pane title bar and choose Auto Hide. 2. To view a hidden pane, mouse over the tab. The hidden pane slides out.

3. To disable auto hide, mouse over the tab then click the pushpin icon in the pane title bar. You can also right-click the pane title bar and choose Auto Hide.

Undocking panes Panes can be undocked and displayed in a floating window. If you use floating windows on a small monitor, they may be hidden by other panes. 1. To undock and float a pane, double-click the pane title bar. You can also right-click the pane title bar and choose Floating. 2. Double-click the pane title bar to redock the pane.

Moving panes You can move docked panes to a new position or create a tab from a docked pane. 1. Drag the pane you want to move. A docking guide opens, which shows where and how you can dock the panel.

35 Customizing toolbars

2. To dock the pane in a new location, drag the pane to the desired location. 3. To dock the pane as a tab, drag the pane to the new location and click the center guide button.

Hiding panes To leave the most workspace for other windows, you may want to hide panes you do not use. 1. To hide a pane, right-click the pane title bar and choose Hide. 2. To view a hidden or closed pane, choose View and click the pane name.

Customizing toolbars The default toolbar, which is named Main, includes buttons for the most commonly used commands. You can add or remove buttons to the toolbar or create your own custom toolbars. You can also display or hide other built-in toolbars, such as the Repository or Debug toolbar. 1. Choose Tools > Customize Toolbars. The Customize dialog box opens with the Toolbars tab selected. 2. Select or clear a check box to display or hide a toolbar.

Note: You can also choose View > Toolbars to display or hide toolbars.

3. Click New to create a toolbar. See Creating toolbars, page 37. 4. Select a custom toolbar and click Rename to rename it. 5. Select a custom toolbar and click Delete to delete it. 6. Select a toolbar and click Reset to reset it to the default state.

36 Creating toolbars

7. Click Close to save the changes.

Creating toolbars You can create toolbars to access the commands you use most frequently. 1. Choose Tools > Customize Toolbars. The Customize dialog box opens. 2. Click New. The New Toolbar dialog box opens. 3. Enter a Toolbar name. 4. Select the toolbar Location. 5. Click OK. The toolbar is added.

Note: Click the Commands tab in the Customize Toolbar dialog box to add commands to the toolbar. See Adding toolbar and menu commands, page 37.

Adding toolbar and menu commands You can customize the commands available on toolbars and menus. 1. Choose Tools > Customize Toolbars. 2. Click the Commands tab. All available commands are displayed.

3. Select a category and a command. 4. Drag the command to the toolbar or menu. To remove a command, drag it off the toolbar or menu.

37 Modifying toolbar and menu commands

5. Click Rearrange Commands to change the command order and modify button and menu item appearance. See Modifying toolbar and menu commands, page 38. 6. Click Close when you finish.

Modifying toolbar and menu commands You can rearrange and modify toolbar buttons and menu commands. 1. Choose Tools > Customize Toolbars. The Customize dialog box opens. 2. Click the Commands tab. 3. Click Rearrange Commands. The Rearrange Commands dialog box opens.

4. Select the Menu Bar or Toolbar you want to modify. The current toolbar or menu commands are displayed. 5. Click Add to add a command. See Adding toolbar and menu commands, page 37. 6. Select a command and click Move Up or Move Down to move it. 7. Select a command and click Modify Selection to modify the name, image, text and image display options, or position in a group of related commands. 8. Select a command and click Delete to delete it. 9. Click Reset to reset the menu or toolbar to the default state. 10. Click Close to save the changes.

Setting toolbar and menu options You can customize menu and toolbar appearance. 1. Choose Tools > Customize Toolbars. 2. Click the Options tab.

38 Customizing keyboard shortcuts

3. Select Large Icons on Menus or Large Icons on Toolbars to display large icons. 4. Select Show ScreenTips on toolbar to display the command name when hovering the cursor over buttons. Select Show shortcut keys in ScreenTips to include the command keyboard shortcut in the screen tip. 5. Select a Menu Animation to use when menus open. 6. Enter the number of milliseconds for the Floating Toolbar Fade Delay. 7. Click Close to save changes.

Note: Options to show full menus, show full menus after a short delay, and list font names do not apply to QA Wizard Pro.

Customizing keyboard shortcuts You can specify shortcut keys for most QA Wizard Pro commands. 1. Choose Tools > Customize Toolbars. 2. Click Keyboard. The Customize Keyboard dialog box opens.

39 Setting general options

3. Select a category in the Categories list. Available commands are displayed in the Commands list. 4. Select a command in the Commands list.

n To add a shortcut key, select a key from the Specify Shortcut menu. Click Assign to assign it to the command.

n To delete a shortcut key, select the command and click Remove.

n Click Reset All to reset all shortcut keys. 5. Click Close to save changes.

Setting general options Set general options to specify preferences for startup, recording or running scripts, and working with files in QA Wizard Pro. 1. Choose Tools > Options. The Options dialog box opens.

40 Setting general options

2. Select any options on the General tab.

Option Use to:

Show Automatically display the welcome dialog box when you start QA Wizard Pro. Welcome to QA Wizard Pro at startup

Open last Automatically open the last used workspace when you start QA Wizard Pro. Do not workspace by clear this option if you generally use the same workspace. default at startup

Allow editing of Edit read-only files with QA Wizard Pro. You typically should not need to edit read- read-only files only files because changes could affect other files, but you can select this option if you need to test changes only in a local copy. For example, select this option to edit files under source control that are not checked out.

Update Always update screenshots captured during recording. preview images when recording

Send usage Send information about the QA Wizard Pro installation to Perforce. This information statistics helps us improve QA Wizard Pro and solve application issues. See Usage statistics, to Perforce page 42.

Default script Set Keyword View or Text View as the default to open scripts in. Select the view you editor view most frequently use.

41 Setting general options

Option Use to:

Licenses Specify the license type to use if multiple licenses are available. Use full engine license provides access to all functionality. Use run-time engine license only allows you to run scripts and verify results. Run-time licenses may be available if you upgraded from QA Wizard Pro 2015.0 or earlier. They are generally used for remote testing or by users who only run scripts. If a run-time license is not available, QA Wizard Pro uses the full engine license.

Use SSL Always use SSL encryption when testing web applications in Google Chrome. When encryption for enabled, a self-signed certificate is automatically added to the browser Trusted Root Chrome Certification Authorities store the first time you record or run a script in Chrome. SSL extension encryption is required for Chrome HTTPS support. communication Only clear this option if your company enforces trusted certificate authority restrictions and you do not want QA Wizard Pro to add root certificates to the certificate store. The root certificate is automatically removed from the store when SSL encryption is disabled. You must close all instances of Chrome and restart QA Wizard Pro for changes to SSL encryption to take effect.

Not available on Windows Vista.

3. Click OK to save the changes.

Usage statistics If you choose to send usage statistics to Perforce, QA Wizard Pro encodes the following information and sends it to a Perforce server periodically. n Unique user ID—An ID used to identify each installation. Does not include any information that identifies your company or users. n QA Wizard Pro version—Software version installed on the computer. n and version—Windows version and service pack installed on the computer. n Hardware information—Computer processor and speed, amount of installed RAM, and whether the hardware is 32-bit or 64-bit. n License information—QA Wizard Pro licenses in use. n Installed browser versions—Browsers and versions installed on the computer. n Enabled integrations—Information about enabled source control or Helix ALM integrations. n Configuration settings—Number of toolbar icons used, whether Keyword View or Text View is used, and if the global application repository is used. n Number of applications and versions—Number of Windows, web, and Java applications and number of versions for each type in the global and local repositories. n Number of specific applications by technology—Number of applications in the global and local repositories that include controls based on a list of technologies (e.g., .NET, Infragistics). n Generic control data—Information about generic controls in the local and global repositories.

42 Setting server connection options

n QuickTest Pro conversions—Number of attempted conversions based on application type and number of attempted and successfully converted objects by type.

Setting server connection options The QA Wizard Pro Server stores global application data and hosts the server database on a networked computer. You must enter server connection information to perform the following tasks: n Access the global repository. See About application repositories, page 57. n Send playback data to the server. This data is displayed in the dashboard and status tool, which are used to monitor playback. See Viewing playback information in the dashboard, page 90 and Viewing playback information in the status tool, page 99. It is also used for reporting purposes if QA Wizard Pro is integrated with Helix ALM Data Warehouse. See Configuring general server options, page 254. You may need to ask your system administrator for connection information.

Note: These options apply to all QA Wizard Pro applications that run scripts on the local computer. For example, if sending playback data to the server is enabled, information about scripts run from QA Wizard Pro and the command prompt is sent to the server and displayed in the dashboard and status tool.

1. Choose Tools > Options. The Options dialog box opens. 2. Click the Server tab.

3. Enter the QA Wizard Pro Server IP address or DNS name. 4. Enter the QA Wizard Pro Server port number. The default port is 8002. 5. Select Send playback data to server to send playback information to the server, which includes the scripts run during the session, the session name (optional), when the session ran, the host computer, warnings or errors that occurred during playback, and the session status. You must select this option if you want information about scripts run on the computer displayed in the dashboard or status tool, or imported to ALM Data Warehouse for reporting purposes. 6. Select Prompt to name sessions before running scripts to be prompted to enter a playback session name before scripts run.

43 Setting email notification options

Naming sessions makes them easier to find when viewing playback information in the dashboard or status tool, or removing data from the server database. If this option is selected, you are always prompted to enter a session name when you run scripts, but you can also choose to run them without entering a name. You cannot name or rename playback sessions after they are sent to the server. 7. Click OK to save the changes. You must restart QA Wizard Pro before you can connect to the server.

Setting email notification options These options control email notifications sent after scripts run. Email notifications include the status of playback sessions (Successful or Failed). If reports are generated, they are attached to the email. See Setting reporting options, page 78.

Note: When running scripts or load tests remotely from a command line, the email notification options on the host computer are used.

1. Choose Tools > Options. The Options dialog box opens. 2. Click the Email tab.

3. Select a Send email notification option to specify when to send results.

44 Setting email notification options

n Never never sends an email.

n On Success sends results only if playback completes successfully.

n On Failure sends results only if playback fails.

n Always sends results after every playback session. 4. Enter the SMTP configuration information.

n Enter the Host used to send outgoing mail. Enter an IP address (e.g., 192.168.1.100) or the fully qualified domain name of the mail server (e.g., mailserver.companyname.com).

n Enter the Port number used by the SMTP host. The default port is 25.

n Enter the Username and Password used to connect to mail server. If a username is entered, authentication with the SMTP host is attempted. Leave the username blank if authentication is not required.

n Select Use SSL encryption to use secure sockets layer encryption for the connection. The port number changes to 465 when this option is selected. 5. Enter the sender's email address in the From field. 6. Specify the Recipients.

n Click Add to enter recipient email addresses. Separate multiple addresses with a semicolon or comma.

n Select recipient and click Edit to make any changes.

n Select a recipient and click Remove to remove them. Click Yes when prompted to confirm the removal. 7. Enter the email Subject. The default subject includes the field code %RUN_TYPE%: %RUN_RESULT% field code, which displays the test type (batch, script, or load test) and result in the sent email. See Run Results Email Field Codes, page 631. 8. Enter the Message body. The default message body includes the %RUN_FILETYPE%: %RUN_FILELIST% field code, which specifies the test type (batch, script, or load test) and a list of filenames. You can also add additional field codes. See Run Results Email Field Codes, page 631. 9. Click OK to save the changes.

45

Managing Applications

Before you can test an application with QA Wizard Pro, you need to add it to the application repository and configure the startup information, which is used every time you record or run a script. See Adding applications, page 47. As new application versions become available you can create corresponding versions in the repository. This allows you to continue testing previous versions while creating scripts to perform tests on new versions. See Adding versions, page 51.

Adding applications Before you record scripts, you must add the application to the repository so QA Wizard Pro can connect to it. You usually perform this task when you are preparing to test a new application. After an application is added, it can be accessed from any workspace. 1. Choose File > New > New Application. The Add New Application dialog box opens.

2. On the General tab, select the Type of application you are adding.

Note: If you are testing an application that uses Windows 8-style controls, select Windows 8 instead of Windows. Testing Windows 8 applications is not supported in QA Wizard Pro on Windows 10.

3. Enter the Startup Information. The available fields depend on the application type.

47 Adding applications

Application Field/option Description type

Browser URL Enter the URL to access the application.

Create Select this option to create a repository variable that contains the repository address for the server hosting the web site. You may want to select variable this option if you are testing against multiple web servers.

%URLROOT% This field is automatically populated using the server portion of the URL you entered (e.g., www.wysicorp.com). This is the default variable value used when running and recording scripts against the application version. See About the URLROOT repository variable, page 220.

Windows Executable Enter the executable path or click Browse to locate the executable. path

Working Enter the application directory path. This field is automatically directory populated if you browsed to locate the executable.

Command line Enter any arguments you want to use to control how the application arguments operates when a script starts it. For example, some applications allow you to pass a filename as an argument when the application starts.

Java Java Enter the Java application path or click Browse to locate the file. application

Working Enter the application directory path. This field is automatically directory populated if you browsed to locate the file.

Java launcher Enter the executable filename that runs the application or click Browse to locate the file. This field is only enabled for .jar files and is automatically populated if you browsed to locate the file.

Command line Enter any arguments you want to use to control how the application arguments operates when a script starts it.

Windows 8 Windows 8 Select the application from the list. application

4. Enter the application Name. The application name must be unique within the repository. 5. Enter the application Version. We recommend entering the version of the application you are testing (e.g., 7.2). Each application in the repository contains one or more versions, and each version contains information for starting the application and the data captured during recording.

Note: If you are testing a new version, add a version to the repository instead of an application. See Adding versions, page 51.

48 Copying applications

6. Select the Repository to create the application in. See About application repositories, page 57. 7. Enter and confirm a Password to password protect the application. Use a password if you want to control access to application data. You may not want all users to have access to add and modify application data because changes may cause scripts to fail. 8. Click the Name Overrides tab to specify conventions for naming new controls captured when recording scripts or populating the application repository. See Overriding naming conventions for new controls, page 119. 9. Click OK. The application is added to the repository.

Tip: You can also add applications when you record a script. See Recording new scripts, page 65.

Copying applications If you are experimenting with an application and do not want to modify the existing data in the local repository, you can copy the application. When you copy an application, all versions, including window and control data, are copied.

Note: You cannot copy applications in the global repository.

1. Select the application you want to copy in the Application Repository pane. 2. Choose Repository > Copy Application. The Copy Application dialog box opens. 3. Enter the Application Name to use for the copied application. The application name must be unique within the repository. 4. Select Include images to copy the screenshots captured during recording. 5. Click OK. The application is copied.

Exporting applications You can export an application to create a backup copy, share it with other users, or move it to a different location or computer. If you want to share a script with another user, but you are not using a shared repository, you must export the application and include it with the script. The other user must import the application before using the script. See Importing applications, page 50.

Note: Exporting and importing is the recommended method for backing up application repositories and moving them to different locations or computers. This helps eliminate the risk of losing or corrupting files, which may occur when copying files directly in Windows Explorer.

1. Select the application to export in the Application Repository pane. 2. Choose Repository > Export Application. The Export Application dialog box opens. 3. Select the file location, enter a file name, and click Save.

49 Importing applications

Another Export Application dialog box opens.

4. Review the File path and name for the exported application or click Browse to make any changes. 5. Select Include images to export screenshots captured during recording. 6. Click OK. The application is exported. Exported applications are saved with a .qawapp extension.

Importing applications You can import an exported application into a local or global repository. If you want to use a script from another user without sharing a repository, you must also import the application included with the shared script. 1. Choose Repository > Import Application. The Import Application dialog box opens. 2. Select the exported application file to import. Exported applications have a .qawapp file extension. 3. Click Open. The Import Application dialog box opens. 4. Enter an application Name. The application name must be unique within the repository. 5. Select the Repository to import the application to. 6. Click OK. The application is imported.

Promoting applications Promoting an application copies all the application data and versions from the local repository to the global repository. Promote an application after modifying the window and control properties so other users can record against the application. 1. Select the application to promote in the Application Repository pane. 2. Choose Repository > Promote Application. You are prompted to confirm the promotion. 3. Click Yes. The Promote Application dialog box opens. 4. Enter the Application Name to use in the global repository. Use a different name than the one used in the local repository to avoid record or playback conflicts. 5. Select Include images to promote screenshots captured during recording. 6. Click OK.

50 Modifying application properties

The application is promoted to the global repository.

Tip: After an application is promoted, rename or delete the application in the local repository. Make any changes to the application in the global repository.

Modifying application properties You can rename an application or change the password required to modify the application. You can also specify a default naming convention to use when capturing new controls from the application.

Note: Renaming an application can cause scripts to stop working. If you change the application name, you must also change the name in the SetContext statement in scripts. See Script.SetContext, page 534.

1. Select the application in the Application Repository pane and choose File > Properties.

Tip: If you only want to rename the application, you can select it and choose File > Rename.

The Properties dialog box opens.

2. On the General tab, make any changes to the application name and password. 3. Click the Name Overrides tab to specify conventions to use for naming new controls captured from the application when recording scripts or populating the application repository. See Overriding naming conventions for new controls, page 119. 4. Click OK to save the changes.

Adding versions Each application in the repository contains one or more versions. Each version contains information for starting the application and the window and control data that is captured during recording. Maintaining versions allows you to easily test previous versions of an application while creating scripts to test new versions. Create a new version when changes to windows and controls in the tested application cause scripts to stop working. For example, you may create an application version for major and minor releases, but not for maintenance releases that only include minor changes.

51 Adding versions

1. Select the application to create the new version for in the Application Repository pane. 2. Choose File > New > New Application Version. The New Version dialog box opens.

3. Enter the version Name. 4. Select a Version to copy. 5. Select Duplicate windows and controls to include the window and control data from the selected version to copy. If this option is not selected, no windows or controls are included in the new version. For example, you may want to clear this option if a new interface toolkit was used to develop the new application version because the existing window and control data will not be valid for the new version. 6. Enter the Startup Information on the General tab. The available fields depend on the application type. The fields are automatically populated with the information stored in the selected application version to copy and can be modified for the new version.

Application Field/option Description type

Windows Executable Enter the executable path or click Browse to locate the executable. path

Working Enter the application directory path. This field is automatically directory populated if you browsed to locate the executable.

Command Enter any arguments you want to use to control how the application line operates when a script starts it. arguments

Browser URL Enter the URL to access the application.

52 Modifying version properties

Application Field/option Description type

Java Java Enter the Java application path or click Browse to locate the file. application

Working Enter the application directory path. This field is automatically directory populated if you browsed to locate the file.

Java Enter the executable filename that runs the application or click Browse launcher to locate the file. This field is only enabled for .jar files and is automatically populated if you browsed to locate the file.

Command Enter any arguments you want to use to control how the application line operates when a script starts it. arguments

7. Click the Repository Variables tab to create repository variables for the new version. See Creating repository variables, page 215. 8. If you are adding a web application version, click the URL Formats tab to create URL format rules for the new version. See Creating URL format rules, page 227. 9. Click OK. The version is added.

Modifying version properties You can change the version number and application startup information. The properties you can change are based on the application type.

Note: Modifying the version number can cause scripts to stop working. When you change the number in the version properties, you must also change the version number in the SetContext statement. See Script.SetContext, page 534.

1. Select the version in the Application Repository pane. 2. Choose File > Properties. The Properties dialog box opens. The available fields depend on the application type.

53 Deleting versions

3. Make any changes. Change the version number only if it is incorrect. If you are testing a new application version, create a new version in the repository. See Adding versions, page 51.

Tip: You can also change version numbers in the Application Repository pane. To change a version number, select it and choose File > Rename.

4. Optionally click the Repository Variables tab to manage repository variables for the version. See Creating repository variables, page 215. 5. If you are modifying a web application version, optionally click the URL Formats tab to manage URL format rules for the new version. See Creating URL format rules, page 227. 6. Click OK to save the changes.

Deleting versions You may want to delete a version from the local or global application repository. When you delete a version, scripts that reference the version no longer work. You can change the version the script uses in the SetContext statement in each script. See Script.SetContext, page 534.

Note: You can export the application to create a backup copy before you delete a version. See Exporting applications, page 49.

1. Select the version you want to delete in the Application Repository pane. 2. Choose Edit > Delete. You are prompted to confirm the deletion. This action cannot be undone. 3. Click OK. The version is deleted.

Deleting applications You may want to delete applications from the local and global repository. Deleting an application also deletes all versions in the application and all window and control data.

54 Deleting applications

Note: Export the application to create a backup copy before deleting it. See Exporting applications, page 49.

1. Select the application you want to delete in the Application Repository pane. 2. Choose Edit > Delete. You are prompted to confirm the deletion. This action cannot be undone. 3. Click OK. The application is deleted.

55

Managing Application Repositories

Application repositories contain information about the applications and versions you are testing. Each application version in the repository contains data about the windows and controls that are captured during recording. This information is used during playback to locate and perform actions on windows and controls. Whether you are using the global repository or local repository, you need to set up the repository before testing begins and maintain the repository as testing continues or new application versions are released.

About application repositories When you record a script, QA Wizard Pro captures the windows you access in the application, the controls in each window, and the properties of each window and control. This information is saved in the local or global application repository. After application data is saved in the repository, any script you record or run has access to the window and control data and properties. When you record new scripts, QA Wizard Pro compares the windows and controls found during recording with the information in the repository. Any new controls found in the application are added to the repository. When you run a script, the information in the repository is used to run the application and perform actions on windows and controls, which are located using the window and control properties. If QA Wizard Pro cannot locate a window or control the script fails.

Note: If team members record or run scripts against the same application or you are testing multiple applications, we recommend using the global repository to manage application data. See Configuring general server options, page 254.

Differences between global and local application repositories Local repositories are specific to one computer. They are generally used when one tester is recording and running scripts against an application version or when setting up an application before it is promoted to a global repository. Global repositories can be shared among users and computers. A global repository is hosted on the QA Wizard Pro Server and is generally used when multiple testers are running scripts against the same application version. You can promote an application to a global repository from a local repository to share applications with other users. For example, Bill is creating scripts for WysiWrite and Jane is creating scripts for WysiChart. Bill has to create scripts that test the integration between WysiWrite and WysiChart. Because Jane already created scripts for WysiChart, she can promote the application data to the global repository so Bill can access it. Use a global repository unless only one tester is dedicated to testing an application or you do not have access to a network. The global repository provides many benefits, including: n Application data is stored in a central location that all users can access. Users can record and run scripts against the same application without recreating and maintaining the application in their local repositories. n Users do not have to change their local repositories when application changes that affect scripts are made. Scripts can be easily updated if windows or controls are added or changed.

57 About application repositories

n Changes to the window and control data can be performed by one user or a limited group of users to ensure continued script integrity. The global repository can be password protected to further limit changes. n Application data is not lost if a system failure occurs on a local computer because all data is stored on a server.

Repository components After you record a script, QA Wizard Pro groups the captured controls by the application, the application version, and the window that contains the controls. This information is organized in a tree structure in the Application Repository pane.

During recording, QA Wizard Pro captures screenshots of windows. When you click a window in the repository, the screenshot is displayed in the Preview pane. When you click a control in the repository, it is outlined with a red box in the screenshot.

58 Setting up repositories

Setting up repositories Before you start recording, we recommend taking the time to set up the application in the repository. While these steps are optional, they can help you understand how QA Wizard Pro captures the windows, controls, and other properties in the application you are testing. Taking the time to set up the repository also guards against adding duplicate windows and controls to the repository. Perform the following steps to add the application and prepare the repository data for testing. 1. Add the application and version to your local repository. See Adding applications, page 47. 2. Record a script for each major area of the application you are testing. Navigate to each window and dialog box that will be tested. If a window or dialog box is displayed during recording, QA Wizard Pro captures the window, controls, and properties of the window and controls. See Recording new scripts, page 65 and Capturing window and control data, page 115. 3. Evaluate the window and control properties that are used to locate objects during playback. QA Wizard Pro automatically selects search criteria, but you may want to select different criteria based on your knowledge of the application. If duplicate windows and controls are added to the repository after recording or an object is not located during playback, it is a good indication you need to modify the search criteria. See Modifying window and control properties, page 122. 4. Review the window and control names in the repository. QA Wizard Pro tries to create meaningful names, but it may capture a generic name. The window and control names are referenced in scripts and used to locate objects. You may want to rename windows and controls to better match the application. See Renaming windows and controls, page 133. If you modify any names, you must also update scripts so QA Wizard Pro can successfully locate the objects using the new names. See Synchronizing with the application repository, page 143. 5. Run the scripts to make sure QA Wizard Pro can locate all windows and controls and the scripts work as expected. See Running scripts, page 73. If scripts fail, you may need to modify additional search criteria. See Modifying window and control properties, page 122. 6. Promote the application from the local repository to the global repository. See Promoting applications, page 50. If your organization does not use a global repository, you can export the application if you need share it with other testers. See Exporting applications, page 49. 7. If you promote the application to the global repository, rename or delete the corresponding application in the local repository. This ensures the correct repository is used when recording or running scripts. See Modifying application properties, page 51 and Deleting applications, page 54. You are now ready to record test scripts. If your organization uses a global repository, make sure you are using the application in the global repository instead of the local repository.

Note: For best results, record scripts or populate repositories to capture window and controls information whenever possible. If QA Wizard Pro cannot capture window or controls because they do not exist in the application or cannot be displayed when recording, you can manually add them to the repository to use when creating or modifying scripts. Only manually add windows or controls if you are familiar with how QA Wizard Pro uses properties and expected property values to locate controls during playback. See Configuring user-added windows and controls, page 136.

59 Maintaining repositories

Maintaining repositories As applications change, you need to maintain the repository to keep it updated and organized. Keep the following in mind as testing continues: n When applications change, new windows and controls are automatically added to the repository during recording. You can also populate the repository to add windows and controls without recording a script. See Populating repositories, page 60. You may need to modify the name and search criteria for the new windows and controls. See Modifying window and control properties, page 122. n If you change window and control names, update scripts that refer to the objects. See Synchronizing with the application repository, page 143. n When a new version of the application is released for testing, you can also create an application version in the repository. See Adding versions, page 51. n If an application is stored in the global repository, make changes directly in the repository so all users can access the changed application. To refresh the repository , users can right-click the application repository and choose Refresh Repository. If an application is in your local repository and you exported the application to share it, you may need to export it again. n Make sure you regularly back up applications in the local and global repositories. To back up applications, export them and save the copy to a backup directory. See Exporting applications, page 49.

Note: When you upgrade QA Wizard Pro, the application repository may also be upgraded. A backup copy of the repository is created in the repository directory. The local repository is in the Application Data\Perforce\QA Wizard Pro\repository directory. Global repository data is stored in the QAWServer directory on the root of the computer the QA Wizard Pro Server application is installed on. The current repository is stored in the directory named with the highest version number (for example, repositoryV3).

Populating repositories When applications change, windows and controls are added to the repository the next time you record a script against the application. You can also populate the repository to add windows and controls without recording scripts. 1. Choose Repository > Populate Repository. The Populate Repository dialog box opens.

60 Populating repositories

2. Select the application you want to populate the repository for. Select Connect to running application to populate the repository of a Windows application that is already running on the test computer. Select the application from the corresponding list.

Note: Click New to add an application. See Adding applications, page 47.

3. If you are populating from a web application, select a Browser. 4. Click Populate. The application opens. The Populate Repository toolbar also opens.

5. Navigate to each new window and dialog box in the application. 6. Click the Stress Populate Repository toolbar button to add stresses, such as low drive and memory space, read-only drives, and disabled networking. See Applying stresses, page 112. 7. Click the Stop Populate Repository toolbar button when you are finished. The Repository Changes dialog box opens. New or changed windows and controls are displayed. See Reviewing and saving repository changes, page 116.

61 Overriding global application startup information

Tip: You may want to rename generic window and control names to make them consistent with the application and change control types for generic controls and HTML elements. You can also do this after you save the repository changes. See Renaming windows and controls, page 133 and Changing control types, page 132.

8. Click Save to save the repository changes. The new windows and controls are added to the repository.

Overriding global application startup information When you test against an application in the global repository, QA Wizard Pro uses the default startup information to start the application. If you installed the application in a different directory or on a different drive on the local computer, you can override the startup information so QA Wizard Pro can find the application. 1. Select the global application version in the Application Repository pane and choose File > Properties. The Properties dialog box opens. The available fields depend on the application type.

62 Connecting to the global repository

2. On the General tab, select Override Startup Information and make any changes. The startup information overrides are used when recording or running scripts on the local computer only.

Note: Only change the version number and default startup information if it is incorrect. Any changes to this information for applications in the global repository could affect other users who test the application.

3. Click OK to save the changes.

Connecting to the global repository When QA Wizard Pro starts, it automatically connects to the configured server. If QA Wizard Pro cannot connect to the global repository on the server, a message is displayed at the bottom of the Application Repository pane. Click Connect to connect to the server.

Note: You can only connect to one server per computer.

Check the following if the connection fails: n Make sure the computer is connected to the network. n Choose Tools > Options and then click the Server tab. Make sure the server address and port number are correct.

63

Recording Scripts

During recording, QA Wizard Pro captures the actions you perform as you interact with the application. After a script is recorded, you run it to test the application.

Recording new scripts Recording creates a new script and captures actions as you interact with an application. The scripts you record provide a baseline for testing. After recording, you can modify scripts to develop more complex testing scenarios. Careful planning is the key to successful automated testing. Short, task-based scripts are easier to manage and maintain. Tests should also be repeatable and have an expected result. For example, if the test application requires logging in, record a single login script that is called at the beginning of all other scripts that run against the application. This helps ensure QA Wizard Pro captures windows and controls used when logging in so they are located when the script runs and eliminates the need for updating statements in multiple scripts if the log in process changes later. See Calling scripts from other scripts, page 151. Keep the following in mind before recording scripts: n Make sure the application is set up in QA Wizard Pro. See Managing Application Repositories, page 57. n QA Wizard Pro must be installed in the default C:\Program Files or C:\Program Files (x86) directory to record scripts against Windows 8 applications. If it is installed in a different directory, an error is returned during recording. n If you are recording a web script, disable any browser auto complete options for forms and passwords. These options can cause scripts to fail during playback because incorrect values are entered or controls cannot be found if the list of auto complete values is displayed over them. n If you are recording a web script in Google Chrome and an error that the default port is already in use is returned, you need to update a configuration file to change the port QA Wizard Pro uses to communicate with Chrome. See Cannot Record in Chrome Because Port Already in Use for information. n To record scripts against HTTPS web applications in Chrome, SSL encryption must be enabled. See Setting general options, page 40. 1. Choose Script > Record New Script. The Record New Script dialog box opens.

65 Recording new scripts

2. Enter a Script name. 3. Select the Application you want to record against. Click New to add an application. See Adding applications, page 47. 4. Select Connect to running application to record against an instance of a Windows application running on the test computer.

Note: This option is not available if a Windows 8 application is selected.

n Select the application from the corresponding list. Make sure the selected application is a Windows application associated with the running process. If new windows and controls are found during recording, they are added to the repository. If you do not select the right application, windows and controls are added to the wrong application in the repository.

n If you record against a running application, the application must be running on the test computer during playback or the script will fail. 5. If you are recording a web script, select a Browser.

Tip: You can select the default browser to use for recording web scripts. See Selecting the default web browser, page 68. You can change the browser before recording.

6. Click Record. The application starts. The Recording toolbar also opens.

You may be prompted for additional information.

n If repository variables are defined for the application version, you are prompted to enter variable values before you start recording. See Entering repository variable values during recording and playback, page 221.

66 Recording new scripts

n If you are recording a script in Firefox for the first time, you are prompted to install and enable the required QA Wizard Pro extension. Select Allow this installation and click Continue. 7. Navigate through the application, performing the actions you want to record.

n Click the Checkpoint Recording toolbar button to add checkpoints to the script during recording. See Creating record-time checkpoints, page 166. Click the button again to exit checkpoints mode.

n Click the Stress Recording toolbar button to add stresses to the script, such as low drive and memory space, read-only drives, and disabled networking. See Applying stresses, page 112.

n Click the Low-Level Recording toolbar button to switch to low-level recording mode. Low-level action statements perform mouse actions that QA Wizard Pro records when it does not recognize an object. See Recording low-level actions, page 70. Click the button again to exit low-level mode.

n Click the Comment Recording toolbar button to add a comment to the script. Comment statements are not run during playback.

Note: Click the Cancel Recording toolbar button to cancel recording and discard all recorded actions.

8. Click the Stop Recording toolbar button. The Repository Changes dialog box opens. New or changed windows and controls are displayed. See Reviewing and saving repository changes, page 116.

9. Click Save to save the repository changes.

67 Selecting the default web browser

The script is processed and the actions are added to it. Information about the application windows and controls are added to the repository.

Tip: Window and controls added to the repository may have generic names depending on the application. You may want to modify the repository to make the names consistent with other objects. See Modifying window and control properties, page 122.

Selecting the default web browser QA Wizard Pro supports Microsoft Internet Explorer, Mozilla Firefox, and Google Chrome. You can run scripts using any of these browsers, regardless of the browser used for recording. If an application supports all browsers, you can record scripts in one browser and run them in all the browsers to make sure the application performs consistently. See the QA Wizard Pro System Requirements for supported browsers.

Note: SSL encryption is required to record and run scripts against secure web applications in Chrome. If you test web applications that use HTTPS and select Chrome as the default browser, make sure SSL encryption is enabled to avoid recording or playback errors. See Setting general options, page 40.

1. To select the browser, choose Tools > Browser. 2. Select Internet Explorer, Firefox, or Chrome. Scripts are recorded and run in the selected browser by default. Use the SetBrowser statement to run scripts in a different browser without changing the default setting.

68 Recording additional script steps

Tip: You can use the Browser toolbar to view the browser scripts are running in. Choose View > Toolbars > Browser to display the toolbar.

Recording additional script steps You can add additional steps to an existing script by recording them. New steps are added to the end of the script or to the line below a selected script step. You can also manually add steps, but recording the new steps ensures actions are performed on the correct windows and controls. 1. Open the script to add steps to. 2. Choose Script > Record Into. The Record Into dialog box opens.

3. Select the Application you want to record against. Click New to add an application. See Adding applications, page 47. 4. Select Connect to running application to record against an instance of a Windows application running on the test computer.

Note: This option is not available if a Windows 8 application is selected.

5. Select a recording option.

n Select Add recorded statements after line to add the new steps after the selected step.

n Select Append recorded statements to end of script to add the new steps after the last step in the script. 6. Click Record. You are prompted to run the current steps before recording.

69 Recording low-level actions

Note: If repository variables are defined for the application version, you may be prompted to enter variable values before you begin recording. See Entering repository variable values during recording and playback, page 221.

7. Click Yes. The script runs. The Recording toolbar opens when the script finishes running. 8. Navigate through the application, performing the actions you want to record. 9. Click the Stop Recording toolbar button. The Repository Changes dialog box opens. New or changed windows and controls are displayed. See Reviewing and saving repository changes, page 116.

10. Click Save to save the repository changes. The script is processed and the actions are added to it.

Recording low-level actions If an application uses non-standard controls, QA Wizard Pro may not recognize those objects and uses low- level action statements to perform keyboard and mouse actions on them. For example, if you are recording a script to test a web page with hover-over menus, use low-level mode to force the recording system to track mouse movements and capture the menu items. 1. While recording a script, click Low-Level on the Recording toolbar. Low-level mode is activated. 2. Mouse over an object to use as a starting point.

70 Adding new scripts

The selected object is outlined with a red box. 3. Click the selected object. QA Wizard Pro begins recording low-level actions. 4. Interact with the object. 5. Click Low-Level to stop recording low-level commands. Low-level actions are grouped in an expandable outline. Click to view the steps.

Adding new scripts You can add a new script to the workspace without recording. You may want to add a script to test a function before adding it to an existing script or add an entire script of functions that you call from other scripts.

Note: You can record a script if you want to add a new script that performs actions in an application, or add existing scripts from other workspaces. See Adding existing files to workspaces, page 23 or Adding existing files to workspaces, page 23.

1. Choose File > New > New Script. The Add New Script dialog box opens. 2. Enter a script File name. 3. Click Save. The new script is added to the workspace.

Understanding recorded scripts After you record a script, the actions you performed are processed and added to the script. Some additional steps are also automatically added to help QA Wizard Pro use the correct application during playback. The following statements are automatically added to scripts: n The SetContext statement specifies the application version to connect to in the application repository during playback. This connection is required because it gives QA Wizard Pro information about the executable to run or URL to access during playback, including any additional information such as command line arguments. This statement is automatically added to the beginning of a script after recording. It must be followed by a RunApp or ConnectToProcess statement. See Script.SetContext, page 534. n The RunApp statement starts the application specified in the preceding SetContext statement. The application version in the repository contains the executable path, working directory, and command line arguments required to start Windows applications, or the URL required to access web applications. This statement is automatically added to the beginning of the script after the SetContext statement, but you can also manually add this statement. See Script.RunApp, page 532. n If you connected to a Windows application running on the test computer, a ConnectToProcess statement is added to the script. See Script.ConnectToProcess, page 530.

71 Understanding recorded scripts

After recording a script, you can modify it to create a more complex script or to correct any mistakes. See Modifying Scripts, page 145.

Tip: You can use more than one application or running process to perform steps in a script. For example, if a script tests an application that generates output, you may want to add the output to another application before the script finishes. You can add a ClearContext statement after the last step the initial application performs to disconnect the script from the application repository. See Script.ClearContext, page 529. To connect to another application, add another SetContext statement that specifies the application and version to connect to. Record or manually add the steps to perform in the new application. See Recording additional script steps, page 69 or Adding statements, page 146.

72 Running Scripts to Perform Tests

When you run a script, QA Wizard Pro compares the tested application against the window and control information stored in the application repository. If differences are found in the window or control properties, the script fails. You can run individual scripts or multiple scripts using QA Wizard Pro or using a command prompt. You can also run scripts remotely. Keep the following in mind: n Make sure the correct browser is selected before running scripts that test web sites or web applications. See Selecting the default web browser, page 68. n If the script connects to a running process, the process must be running on the test computer. n If you move scripts to another computer to run them, the tested applications must be available in the global or local application repository. Scripts cannot run without connecting to the application in the repository. n If you frequently run the same individual script or created a test suite script for modular testing, you can set the script as the main script for the workspace to quickly run it without opening it. See Setting and running a main script, page 74.

Tip: You can monitor playback using the dashboard and status tool. See Viewing playback information in the dashboard, page 90 and Viewing playback information in the status tool, page 99.

Running scripts Run scripts to perform tests. During playback, QA Wizard Pro compares the tested application against the window and control information stored in the application repository. If differences are found in the window or control properties, the script fails. 1. Open the script to run and then choose Script > Run. You can also right-click a script in the Workspace pane and choose Open and Run.

Note: If a script is set as the main script for the workspace, you can run it without opening it. Choose Script > Run Main Script. See Setting and running a main script, page 74.

The script runs.

n You may be prompted to name the playback session before playback starts. Enter a session name and click Set Name and Run or click Run Without Name to run the session without a name. If you do not want to be prompted to enter a session name, disable it in the server options. See Setting server connection options, page 43.

n If repository variables are defined for the application version, you may be prompted to enter variable values before playback starts. See Entering repository variable values during recording and playback, page 221.

n If QA Wizard Pro is integrated with Helix ALM Data Warehouse, you may be prompted to log in to the server. See Entering login information when running scripts, page 74.

n You are prompted to install and enable the required QA Wizard Pro extension the first time you run a script in Firefox. Select Allow this installation and click Continue. Any errors that occur are displayed in the Errors pane. When the script finishes running, the run report is generated. See Viewing results reports, page 75.

73 Setting and running a main script

If email notifications are configured, the results may be sent to specified recipients. See Setting email notification options, page 44.

Setting and running a main script You can set the main script for the workspace to quickly run a frequently used script or a script used to run a complete test suite. For example, if a workspace contains multiple scripts for individual tests and you create a script that runs all related scripts as a test suite, you can set the test suite script as the main script to run the entire suite when the individual scripts are saved in the workspace and ready to run.

After the main script is set, you can run or debug it without opening it. This eliminates the need to switch to the main script if you are working with a called script or another file in the Script pane. n To set a script as the main script for a workspace, open it and choose Script > Set as Main Script. You can also right-click the script in the Workspace pane and choose Set as Main Script. The main script name is displayed in bold in the Workspace pane. n To run the main script, choose Script > Run Main Script. See Running scripts, page 73 for information about running scripts. n To debug the main script, choose Debug > Debug Main Script. See Running scripts in debug mode, page 211 for information about debugging scripts.

Entering login information when running scripts You may be prompted to enter a username and password to connect to the QA Wizard Pro Server when running scripts. If QA Wizard Pro is integrated with the Helix ALM Data Warehouse, the Helix ALM License Server may need to verify user credentials before sending playback data to the QA Wizard Pro Server.

Note: You can only connect to one server per computer. The server configured in the running the script is selected automatically.

1. Enter your Username and Password or select Use single sign-on to log in with your network credentials. Ask your server administrator for additional information about single sign-on. 2. Select Always use this username and password to automatically log in to the server when QA Wizard Pro starts.

74 Viewing results reports

3. Click Connect. QA Wizard Pro connects to the server and script playback continues.

Viewing results reports QA Wizard Pro generates and saves a results report after a script runs. The report includes information about the script such as the test computer configuration and how long it took the script to run. Reports are named using the script name and the date and time the script ran. If email notifications are configured, the report may be sent to specified recipients. See Setting email notification options, page 44.

Note: By default, reports are generated every time a script runs. To change this option, see Setting reporting options, page 78. Double-click a report in the Reports pane. The report opens. It includes information about the script and details about any failures.

1. Choose File > Print to print the report. 2. Choose File > Save As to save the report in a different format to use with other programs. See Exporting results reports, page 76.

Note: If QA Wizard Pro is integrated with Helix ALM, you can submit run reports to add issues. See Adding Helix ALM issues from run reports, page 278.

75 Exporting results reports

Exporting results reports You can save results reports in a different file format to use with other programs. 1. Double-click the report in the Reports pane to open it. 2. Choose File > Save As. The Save As dialog box opens. 3. Select the Location you want to save the file to. 4. Enter a File name. The default report name is QA Wizard Pro Playback Summary. 5. Select a Save as type. Reports can be saved as BMP, CSV, EMF, XLS, GIF, HTML, JPEG, PDF, PNG, RTF, TIFF, and XML files. 6. Click Save. The report is exported to the selected format and saved in the selected location.

Setting playback options You can set playback options to lock the keyboard and mouse during script playback, change the speed of low-level actions, specify the time QA Wizard Pro searches for controls before playback times out, and specify the default optical character recognition (OCR) settings. Keep the following in mind: n To monitor playback in the QA Wizard Pro dashboard or status tool, you must send playback data to the server. See Setting server connection options, page 43. n Scripts run remotely use the playback options set on the remote computer. Before setting playback options on a remote computer, make sure QAWRemote is not currently running scripts. Right-click the QAWRemote.exe icon in the Windows taskbar and choose Console. Verify the status is Idle and then choose File > Exit to close QAWRemote. After setting the playback options, close QA Wizard Pro and then restart QAWRemote on the remote computer before running scripts. See Starting QAWRemote.exe, page 250. 1. Choose Tools > Options. The Options dialog box opens. 2. Click the Playback tab.

76 Setting playback options

3. Select Lock keyboard and mouse to lock the keyboard and mouse when scripts run. Select this option if you will be away from the computer while scripts run or if you are running scripts remotely to prevent unexpected actions from affecting playback.

Note: To unlock the keyboard and mouse while a script is running, press Ctrl+Alt+Delete to open the Windows Security dialog box. Press Esc to close the dialog box and return to QA Wizard Pro. You can let the script continue running or press the Pause/Break key to stop the script.

4. Select a low-level action Speed option.

n Same speed as when recorded plays back low-level actions at the speed they were recorded.

n Maximum speed plays back low-level actions as quickly as possible. Select this option to speed up playback if scripts are running as expected. 5. Enter the Control search timeout to indicate how long before playback times out. If the timeout is reached, playback stops and an error is displayed. The default value is 15,000 milliseconds. 6. Specify the default Optical Character Recognition (OCR) options to use when converting graphical text in applications to text strings. These options are applied to temporary images created from specified regions of applications before they are processed using OCR to improve the accuracy of the returned text. See Using OCR to Work with Graphical Text, page 181.

n Convert to grayscale automatically converts images to grayscale. This option is selected by default.

n Image scale specifies the number of times to increase the image scale. You can enter a value between 1 and 15. For example, 1 scales to original size (100%), 2 scales two times the original size (200%), and 15 scales 15 times the original size (1500%). The default value is 4.

77 Setting reporting options

n Contrast specifies the amount of color contrast to apply to images. You can enter a value between 0 and 100. For example, 0 does not change the image contrast and 100 makes the image solid black. The default value is 0.

n Language file path specifies the path to the OCR language file to use. The path to the English language file (e.g., %QAWDIR%\OCR\tessdata\eng.traineddata) is selected by default. Click Browse to select a different file.

Note: QA Wizard Pro uses the Tesseract OCR engine. QA Wizard Pro includes the English language file (eng.traineddata). If you need to test other languages, download additional language files from Tesseract. Language files must be stored in a directory named tessdata.

7. Click OK to save the changes.

Setting reporting options These options control how reports are generated, displayed, and exported. 1. Choose Tools > Options. The Options dialog box opens. 2. Click the Reporting tab.

3. Select Generate report after every playback session to always generate a results report after scripts run. 4. Select any Format options for results reports.

n Display report after every playback session opens the report after scripts run.

n Always export to specifies a file format to automatically export reports to. If this option is selected, a PDF or HTML version of the results report is saved in the Reports directory with the QA Wizard Pro report. 5. Select Include warnings to include warnings in results reports and the status tool. Clearing this option displays warnings only in the Errors pane. 6. Click OK to save the changes.

78 Running multiple scripts

Running multiple scripts You may want to run more than one script at a time. For example, you may have a script that logs in, one that checks the controls, and one that completes a form. 1. Choose Script > Run Multiple. The Select Scripts dialog box opens. 2. Select the scripts you want to run and click to add them to the Selected scripts list. To remove a script, select it in Selected scripts list and click .

3. Select a script and click , , , or to reorder the list. Scripts run in the order displayed. 4. Click Run.

Note: You may be prompted to enter information before playback starts, such as a session name, repository variable values, or server login credentials. See Running scripts, page 73.

The scripts run. Any errors are displayed in the Errors pane. When the scripts finish running, the run report, which includes results for all the scripts, is generated. See Viewing results reports, page 75. If email notifications are configured, the report may be sent to specified recipients. See Setting email notification options, page 44.

Running scripts against a global repository When you promote an application to a global repository, you will have two copies of an application, one in the local repository and one in the global repository. If you run a script that was recorded before you promoted the application, it continues to use the local repository. QA Wizard Pro indicates it is using a local version in the Errors pane. One way to run a script using a global repository is to rename or delete the application in the local repository. This is helpful if you want all scripts to use the global repository but do not want to change individual scripts. When you run any of these scripts, they first look for the application in the local repository. When scripts cannot find the application, they use the version in the global repository instead.

79 Running scripts from a command prompt

To change the repository for a few scripts or perform ad hoc testing against a copy of the application in the global repository, add 'Global:' to the SetContext statement.

Running scripts from a command prompt You can use the QAWRunScript command to run scripts and batch files from a command prompt. Enter QAWRunScript /? to view help. To run load test scripts from a command prompt, use the QAWLoadTest command. See Running load tests from a command prompt, page 106

Script syntax QAWRunScript.exe [workspace] scripts [/helixalm] [/reportdir "path"] [/reportfile "path"] [/noreport] [/Dvariable="value"] [/remote computername] [/lsuser username] [/lspassword password] [/lssinglesignon on|off] [/emailhost host] [/emailport port] [/emailresults OnSuccess|OnFailure|Always|Never] [/emailusername username] [/emailpassword passwordincleartext] [/emailusesslencryption TRUE|FALSE] [/emailfrom emailaddress] [/emailto listofemailaddresses] [/emailsubject "subject line"] [/emailmessagebody "message body"] [/promptbeforeexit] [/sessionname "name"]

Script example The following command runs the WysiCorp Login script from the WysiCorpWebSite workspace. QAWRunScript.exe "WysiCorpWebSite.qawwspace" "WysiCorp Login.qawscript" To run the script without creating a results report, add the /noreport option. For example: QAWRunScript.exe "WysiCorpWebSite.qawwspace" "WysiCorp Login.qawscript" /noreport To run the script and change a repository variable value, add the /Dvariable option. The following example changes the URLROOT repository variable value. QAWRunScript.exe "WysiCorpWebSite.qawwspace" "WysiCorp Login.qawscript" /DURLROOT=http://www.wysicorp.com

Batch syntax QAWRunScript.exe batch [/helixalm] [/reportdir "path"] [/reportfile "path"] [/noreport] [/Dvariable="value"] [/remote computername] [/lsuser username] [/lspassword password] [/lssinglesignon on|off] [/emailresults OnSuccess|OnFailure|Always|Never] [/emailhost host] [/emailport port] [/emailusername username] [/emailpassword passwordincleartext] [/emailusesslencryption TRUE|FALSE] [/emailfrom emailaddress] [/emailto listofemailaddresses] [/emailsubject "subject line"] [/emailmessagebody "message body"] [/promptbeforeexit] [/sessionname "name"]

Batch example The following command runs the WysiCorp Logins batch file and saves the run results report on the computer's Desktop. QAWRunScript.exe "WysiCorpLogins.qawbatch" /reportdir %USERPROFILE%\Desktop

80 Running scripts from a command prompt

Command options

General

Item Description

workspace Workspace filename. Required if the script calls another script or has an associated datasheet, or if the /helixalm option is specified.

scripts Script filenames. Separate multiple filenames with spaces.

batch Batch filename.

/remote Run scripts on the specified remote computer. See Running scripts remotely, page computername 250.

/promptbeforeexit Prompt for confirmation before exiting QAWRunScript.

/sessionname Playback session name. Only used if playback information is sent to the QA Wizard "name" Pro Server.

Results reports

Item Description

/reportdir Directory path to save the run report in (e.g., C:\Program Files\Perforce\QA Wizard "path" Pro\RunReports). Report is saved with a default filename.

/reportfile Full directory path to save the run report in, including filename (e.g., C:\Program "path" Files\Perforce\QA Wizard Pro\RunReports\Login.qawreport).

/noreport Disable report generation.

Repository variables

Item Description

/Dvariable="value" Set repository variable and value. Overrides default value.

81 Running scripts from a command prompt

Email results

Item Description

/emailresults OnSuccess| Indicates when to email results. OnFailure| n OnSuccess: Only email when scripts pass. Always|Never n OnFailure: Only email only when scripts fail.

n Always: Email when scripts pass or fail.

n Never: Do not send email.

/emailhost host Email server host. Enter the domain name (e.g., mailserver.company.com) or IP address (e.g., 192.168.1.100).

/emailport port Port used to communicate with the email server.

/emailusername username Username used to communicate with the email server.

/emailpassword Password used to communicate with email server. passwordincleartext

/emailusesslencryption Use SSL encryption to communicate with the email server. TRUE | FALSE

/emailfrom emailaddress Sender's email address.

/emailto Recipient's email address. Separate multiple addresses with a semicolon. listofemailaddresses

/email subject "subject Email subject line. Must start and end with quotes. line"

/emailmessagebody Email message body. Must start and end with quotes. Only one line is "message body" allowed.

Helix ALM and Helix ALM Data Warehouse integrations

Item Description

/helixalm Automatically submit issue to Helix ALM.

/lsuser Helix ALM License Server username for ALM Data Warehouse integration. Overrides the username saved value on the computer running the script. If not specified, may be prompted to enter username.

/lspassword Helix ALM License Server password for ALM Data Warehouse integration. Overrides the password saved value on the computer running the script. If not specified, may be prompted to enter password.

82 Creating batch files

Item Description

/lssinglesignon Enable or disable single sign-on for use with ALM Data Warehouse integration. Overrides on|off the saved value on the computer running the script.

Return value After playback completes, a value is returned to the command prompt to indicate if the session succeeded or failed.

Value Description

0 All scripts succeeded.

Non- Errors caused scripts to fail. Use the output in the command prompt, the results report (if zero generated), or the status tool to review error information. See Viewing results reports, page 75 number and Viewing playback information in the status tool, page 99.

Creating batch files A QA Wizard Pro batch file is an executable that includes scripts and any associated datasheets or other called files. Batch files can be used to schedule groups of scripts to run unattended for a shorter, more thorough testing cycle. You can also use batch files to execute regression test suites as part of a nightly build process. Batch files can include any files from the same workspace except other batch files.

Tip: If a script in a batch file performs actions that require logging in to an application first, add a script to the batch file that logs in to the application before other scripts in the batch run.

1. Choose Batch > New Batch. The Batch dialog box opens.

83 Creating batch files

2. Click Add Scripts to add scripts to the batch. The Select Scripts dialog box opens.

3. Select the scripts to include in the batch and click to add them to the Selected scripts list. To remove a script, select it in Selected scripts list and click . To reorder the selected scripts, click , , , or . Scripts run in the order displayed. You can also reorder scripts in the Batch dialog box before saving the batch file. 4. Click OK. The selected scripts are displayed in the Scripts folder on the Batch dialog box.

84 Creating batch files

Note: If a script in the batch calls a script or datasheet using a text string parameter, or has a data source associated with it, the script or datasheet is automatically included in the batch. If variables or other expressions are used to access other scripts or datasheets, you must add the additional files to the batch to make them available when the batch runs.

5. To include other files from the workspace in the batch, click Add Additional Files. Adding the files to the batch prevents scripts that need access to other files from failing when the batch runs. For example, you can add a datasheet called using a variable or a text file used to log data to the batch. The Select Files dialog box opens.

6. Select the files to include in the batch and click to add them to the Selected files list To remove a file, select it in Selected files list and click . 7. Click OK. The selected files are displayed in the Additional Files folder on the Batch dialog box. 8. Select a script and click Top, Move Up, Move Down, or Bottom to reorder the list. Scripts run in the order displayed. 9. If a Helix ALM connection is configured for the workspace, select Automatically submit issues to Helix ALM to add an issue for each failed script. 10. Click Save As. The Save As dialog box opens. 11. Enter a File name, select a Save in location or browse to select a different location, and click Save. Batch files are saved with a .qawbatch file extension. 12. Click Close when you finish.

85 Modifying batch files

Modifying batch files When you create a batch file, QA Wizard Pro makes a copy of the scripts and the associated datasheets and bundles them in the batch file. If you make changes to the scripts or datasheets in the workspace, you may need to update the batch files that they are saved in. You can also change the order that scripts run, remove scripts and datasheets, and add additional workspace files that scripts in the batch may need.

Tip: To quickly update the scripts included in a batch file, select it and choose Batch > Update Batch. To update all batch files, choose Batch > Update All Batches.

1. Choose Batch > Open Existing Batch. The Open dialog box opens. 2. Select the batch file to modify. 3. Click Open. The Batch dialog box opens. Information about each file is displayed in columns.

Column name Description

File File name

Date Date the file was last updated in the batch file

Status Status of the file in the batch file:

n Current—File in the batch matches the file in the workspace

n Old—File in the workspace has changed

n Missing—File is not found in the workspace

n Unknown—The workspace that contains the file is not open

Note: Called scripts and associated datasheets are displayed under the related script.

4. Make any changes to the file.

n Select a file with an Old status and click Update to replace it with the updated file. Click Update All to update all files. You cannot update files with a Missing or Unknown status.

n Select a script and click Top, Move Up, Move Down, or Bottom to reorder the list.

n Select a file and click Delete to remove it from the batch file. You cannot delete called scripts or associated datasheets.

Note: The Check Out dialog box may open if you make changes to batch files checked in to a source control application. See Checking out files from source control, page 291.

5. Click Save to save the changes. 6. Click Close when you finish.

86 Running batch files

Running batch files You can run QA Wizard Pro batch files immediately or schedule them to run unattended. Keep the following in mind: n If you move a batch file to another computer to run it, the tested applications must be available in the global or local application repository. n When you run batch files, the QA Wizard Pro playback options set on the computer running the scripts are used. See Setting playback options, page 76. n If the batch file includes web scripts, the selected browser runs all scripts in the batch. See Selecting the default web browser, page 68. n Batch file run reports are stored in the Reports folder in the workspace directory (e.g., C:\Users\\Documents\My Documents\QA Wizard Pro Workspaces\Reports). n If email notifications are configured, the batch run results may be sent to specified recipients. See Setting email notification options, page 44.

If you want to: Then:

Immediately run one Double-click the batch file (.qawbatch) you want to run in Windows Explorer batch file or use the QAWRunScript command. See Running scripts from a command prompt, page 80.

Schedule one or more Use a scheduling program, such as Windows Task Scheduler, to schedule batch files to run the batch file to run. unattended

87

Monitoring Script Playback

You can monitor local and remote script playback in real-time using the QA Wizard Pro dashboard and status tool.

Dashboard Use the dashboard to see an overview of the most recent playback sessions and statistics about your automated tests in a web browser. It can help you identify failed scripts that need closer review and determine if adequate testing is complete for an upcoming release. See Viewing playback information in the dashboard, page 90.

Status tool Use the status tool to review playback information line-by-line. It can help you trace script lines that ran before warnings and errors occurred and provide details to share with developers when reporting issues in builds. See Viewing playback information in the status tool, page 99.

89 Viewing playback information in the dashboard

Viewing playback information in the dashboard You can use the QA Wizard Pro dashboard to monitor playback information in a web browser. It can help you see an overview of the most recent sessions run and statistics about your team's automated testing efforts, such as the number of sessions run during a date range and per test computer. For example, if you include batch files in a continuous build process, you can use the dashboard to monitor regression test results and quickly identify failed scripts that may indicate issues in a recent build. You can view the dashboard in a browser on any computer to monitor local and remote sessions in real-time. See QA Wizard Pro Dashboard Supported Web Browsers and Servers for a list of supported browsers.

Note: An administrative user is usually responsible for setting up the dashboard. See Installing and configuring the dashboard, page 97. Make sure that sending playback data to the QA Wizard Pro Server is enabled if you want information about scripts run from the local computer displayed in the dashboard. See Setting server connection options, page 43.

90 Viewing playback information in the dashboard

Tip: You can also use the status tool to review playback information line-by-line, which can help you debug scripts more thoroughly and identify issues in product builds that caused scripts to fail. See Viewing playback information in the status tool, page 99.

Accessing the dashboard To access the dashboard, start a web browser and enter the dashboard URL. Ask your QA Wizard Pro Server administrator for the URL. The URL includes the name or IP address of the web server that hosts the dashboard and the path to the dashboard application. For example, http://yourserver.com/qawdashboard.

Using dashboard widgets Playback information is displayed in the following widgets on the dashboard. See Dashboard widget types, page 92 for more information and examples.

91 Dashboard widget types

Widget Displays: To use the widget:

Recent Playback An overview of the most Click to change the data displayed in the Sessions recent playback sessions. widget. See Changing information displayed in dashboard widgets, page 95. Only the five most recent sessions are displayed by Mouse over a session and click to view default the first time you line-by-line details about it in the status tool if access the dashboard. it is installed. See Viewing playback information in the status tool, page 99.

Playback Session History A chart of the number of Click to change the data displayed in the playback sessions in each run widget. See Changing information displayed state per day in a date range. in dashboard widgets, page 95.

Only sessions run during the Mouse over data in the chart to view more last week to today are information. displayed by default the first time you access the Mouse over a run state in the legend to dashboard. highlight the corresponding data on the chart.

Test Computer Activity A chart of the number of Click a run state in the legend to hide the playback sessions in each run corresponding data from the chart. Click a state per test computer. hidden run state to show the data.

All sessions for all test computers are displayed by default the first time you access the dashboard.

Dashboard widget types The dashboard includes the following widgets that display playback information.

Recent Playback Sessions Displays an overview of the most recent playback sessions. Use this widget to quickly see the status of sessions during or after playback. For example, you can see which scripts failed during an automated regression test to report issues in a new build. Each session summary includes the current run state, session name (if provided), computer it ran on, when it started, and how long it ran. Active, canceled, and inactive sessions also include the last five script lines that ran. Failed sessions also include information about errors that caused scripts to fail.

92 Dashboard widget types

Example

Using the widget n Click to change the data displayed in the widget. See Changing information displayed in dashboard widgets, page 95. n Mouse over a session and click to view line-by-line details about it in the status tool if it is installed. See Viewing playback information in the status tool, page 99.

Playback Session History Displays a chart of the number of playback sessions in each run state per day in a date range. Use this widget to view trends in your automated testing efforts and compare how many sessions pass versus fail. For example, you can use this information to determine if adequate testing is complete before a product is ready to release.

93 Dashboard widget types

Example

Using the widget n Click to change the data displayed in the widget. See Changing information displayed in dashboard widgets, page 95. n Mouse over data in the chart to view more information. n Mouse over a run state in the legend to highlight the corresponding data on the chart. n Click a run state in the legend to hide the corresponding data from the chart. Click a hidden run state to show the data.

Test Computer Activity Displays a chart of the number of playback sessions in each run state per test computer. Use this widget to see how your automated tests perform on different computer configurations. For example, you can use this information to determine if adjustments to the product system requirements are needed for an upcoming release.

94 Changing information displayed in dashboard widgets

Example

Using the widget n Click to change the data displayed in the widget. See Changing information displayed in dashboard widgets, page 95. n Mouse over data in the chart to view more information. n Mouse over a run state in the legend to highlight the corresponding data on the chart. n Click a run state in the legend to hide the corresponding data from the chart. Click a hidden run state to show the data.

Changing information displayed in dashboard widgets You can specify criteria to filter the information displayed in dashboard widgets.

Tip: A summary of the filters used in a widget is displayed next to . Mouse over a truncated filter summary to view the full summary.

1. Click in the upper right corner of the widget. The Filter dialog box opens.

95 Changing information displayed in dashboard widgets

2. Select the filter options. The available options depend on the widget type.

Option Displays in the widget

Number of The specified number of sessions. You can enter a value between 1 and 200. Only results available in the Recent Playback Sessions widget.

Date Sessions run during the selected date range.

n From includes sessions run on or after the selected date and through includes sessions run on or before the selected date.

n A time period includes sessions during the specific period, such as last week or last month.

n In the last includes sessions run during the specified number of hours, days, weeks, months, or years before the current date/time.

Run Sessions in the selected state, which is the status of a session during or after playback. states You can include active sessions that are running, successful sessions, failed sessions, inactive sessions that did not send information to the server in over 30 minutes, or sessions canceled by the user who started them. Only available in the Recent Playback Sessions widget.

96 Installing and configuring the dashboard

Option Displays in the widget

Test Sessions run on the selected computers. Select an option to include or exclude the computers computers. Includes the following includes sessions run on the selected computers and Excludes the following includes sessions not run on the selected computers.

Session Sessions by name. You can include sessions with names that equal, start with, end with, name contain, do not equal, or do not contain specific text. Select Ignore case to ignore the case of the entered text.

3. Click Apply. The widget refreshes to show the updated information.

Installing and configuring the dashboard The dashboard lets users monitor playback information and statistics in a web browser. Before users can access the dashboard, an administrative user must install the files on the computer that hosts the QA Wizard Pro Server and configure Microsoft Internet Information Services (IIS) web server to host the dashboard.

Note: IIS must be installed and enabled on the same computer that hosts the QA Wizard Pro Server before installing the dashboard files. See QA Wizard Pro Dashboard Supported Web Browsers and Servers for a list of supported IIS versions.

Installing the dashboard files On the computer that hosts the QA Wizard Pro Server, run the QA Wizard Pro installer and select QA Wizard Pro Dashboard. The files are installed in the C:\InetPub\wwwroot\qawdashboard directory by default. Only change the directory if you are familiar with mapping virtual directories in IIS.

Configuring IIS After installing the dashboard files, you must convert them to an application in IIS.

Note: If you did not install the files in the default directory, you must create a virtual directory alias in IIS before adding the dashboard application. See the IIS help for information about creating virtual directory aliases.

1. Open IIS Manager. 2. In the Connections pane, expand the local host node and choose Application Pools. 3. Click Add Application Pool. The Add Application Pool dialog box opens. 4. Add the following application pool information.

Option Value

Name QA Wizard Pro Dashboard

97 Installing and configuring the dashboard

Option Value

.NET Framework version .NET Framework v4.0

Managed pipeline mode Integrated

Start application pool immediately Selected

5. Click OK. The application pool is added.

Note: Steps 6-8 are only required on 64-bit Windows. If you are using 32-bit Windows, continue with step 9.

6. Select the dashboard application pool and click Advanced Settings. The Advanced Settings dialog box opens. 7. In the General category, select True for the Enable 32-bit Applications option. 8. Click OK. The settings are saved. 9. In the Connections pane, expand the local host, Sites, and Default Web Site nodes. 10. Right-click the qawdashboard folder and choose Convert to Application. The Add Application dialog box opens. 11. Click Select, select the QA Wizard Pro Dashboard application pool, and click OK. 12. Click OK. The dashboard application is added.

Enabling ASP.NET 4.5 support (Windows Server 2012 only) The dashboard uses .NET Framework 4.5. Required ASP.NET 4.5 support is enabled on most supported Windows versions when installing the dashboard files, but you must manually enable it on Windows Server 2012.

1. Open Server Manager.

2. Click add roles and features. The Add Roles and Features Wizard opens. 3. On the Before You Begin page, click Next. 4. On the Installation Type page, select Role-based or Feature-based Installation and click Next. 5. On the Server Selection page, select the computer the dashboard files are installed on and click Next. 6. On the Server Roles page, select Web Server (IIS) and click Next. 7. Click Next to skip the Features and Web Server Roles (IIS) pages. 8. On the Role Services page, expand the Application Development node, select ASP.NET 4.5, and click Next. 9. On the Confirmation page, click Install.

98 Viewing playback information in the status tool

Accessing the dashboard 1. Make sure the QA Wizard Pro Server is running. See Starting the QA Wizard Pro Server, page 254. 2. Start a web browser and enter the dashboard URL. The URL includes the name or IP address of the web server that hosts the dashboard and the path to the dashboard application. For example, http://yourserver.com/qawdashboard. The dashboard may take a few minutes to load the first time.

Note: To display information in the dashboard, make sure users configure QA Wizard Pro to send playback data to the server. See Setting server connection options, page 43.

Troubleshooting Errors can occur when accessing the dashboard if the required ASP.NET packages are not installed correctly on the server computer. Perform the following steps to update the ASP.NET registration with IIS. 1. At a command prompt, enter the following command:

n 64-bit—C:\Windows\Microsoft.NET\Framework64\v4.0.30319 aspnet_regiis -i

n 32-bit—C:\Windows\Microsoft.NET\Framework\v4.0.30319 aspnet_regiis -i 2. Open IIS Manager and restart the server.

Viewing playback information in the status tool You can review script playback line-by-line in the QA Wizard Pro status tool. It displays detailed information about playback sessions, such as the current run state, the computer scripts ran on, how long they ran, any errors or warnings that occurred, and script steps grouped by the window an action was performed on. You can install the status tool on any computer to monitor local and remote sessions in real-time. Make sure that sending playback data to the QA Wizard Pro Server is enabled if you want information about scripts run from the local computer displayed in the status tool. See Setting server connection options, page 43. After reviewing playback information, you can export individual session reports to save the information in various formats. You can then share these reports with developers to provide helpful information for fixing issues found during testing.

Tip: You can also use the dashboard to monitor playback information and statistics in a web browser, which can help you quickly identify failed sessions that may need closer review in the status tool. See Viewing playback information in the dashboard, page 90.

1. To start the status tool, choose Start > All Programs > Perforce > QA Wizard Pro > QA Wizard Pro Status Tool. The status tool opens.

99 Viewing playback information in the status tool

Note: The status tool requires a connection to a QA Wizard Pro Server. If it cannot connect to the server, you may need to update the connection information. Click , enter the server address and port number, and click OK.

2. Select a playback session to view the results. 3. To change the sessions displayed, click and select the filter options. If the status tool was opened from the dashboard, only the corresponding session is displayed. You can update the filter options to view other sessions.

Option Displays:

Date Sessions run during the selected date range.

n More than includes sessions run more than the specified number of hours, days, weeks, months, or years ago relative to the current date/time.

n From includes sessions run on or after the selected date and through includes sessions run on or before the selected date.

n In the last includes sessions run during the specified number of hours, days, weeks, months, or years before the current date/time.

Run state Sessions in the selected state, which is the status of a session during or after playback. You can include active sessions that are running, successful sessions, failed sessions, inactive sessions that did not send information to the server in over 30 minutes, or sessions canceled by the user who started them.

100 Viewing playback information in the status tool

Option Displays:

Test Sessions run on the selected computers. Click Select All to select all test computers or computers click Select None to clear all selected computers.

Session Sessions by name. You can include sessions with names that equal, start with, end with, name contain, do not equal, or do not contain specific text. Select Ignore case to ignore the case of the entered text.

4. Click to save the session report. Choose the location to save the report in, enter a file name, and select a file type. Reports can be saved as CSV, XLSX, and DOCX files.

101

Load Testing

Load testing helps you determine how a web application behaves by simulating real-world scenarios and increasing the load on the web server. Identifying bottlenecks that can slow performance under a heavier load, such as database access or cache size, can help you improve your web application for the best overall user experience. Because load testing is a simulation of user behavior, use load test results as a guide to what users experience as application use increases. Load testing will not provide you with the maximum number of users that an application can support. QA Wizard Pro load test scripts do not capture user interface actions. When you record load test scripts, QA Wizard Pro only captures the information exchanged between the application and web server. You can then run those scripts under a load of virtual users to determine how the application and server behave. Keep the following in mind: n Before you record a load test script, make sure the testing environment is as basic as possible and does not contain elements that are not part of the application, which could affect the test results. For example, you may need to clear the cache or disable browser toolbars. n Before you run a load test, you may need to modify some scripts so they do not affect the test results. For example, keep basic setup and read/write actions in standard QA Wizard Pro scripts and call those scripts from load test scripts. Load tests should only include statements for testing performance under load.

Recording load test scripts Load test scripts capture the information exchanged between a web application and the web server hosting it. When you record a load test script, changes are not made to the application repository. 1. Choose Script > Record Load Test. The Record New Load Test Script dialog box opens.

2. Enter a Script name. 3. Select the Application you want to record the script against. Click New to add a web application. See Adding applications, page 47. 4. Select the Browser to run the application in.

103 Running load tests

Note: You can only record load tests in Microsoft Internet Explorer and Mozilla Firefox. See the QA Wizard Pro System Requirements for supported browser versions.

5. Click Record. The application starts in the selected browser. The Recording toolbar also opens. 6. Navigate through the application, performing actions you want to test with a simulated load of users. 7. Click Stop on the Recording toolbar when you finish recording. The script is created and opened in the Script pane. Load test scripts are saved with a qawloadscript file extension.

After recording The following data may be added to load test scripts or the workspace after recording. n Recorded load test scripts may capture requests to external sites that are not a part of your application, such as Google Analytics, phishing and malware protection sites, or web tracking sites. Review load test scripts and delete statements that are not directly related to the web site you are testing before running load tests. n If data that could cause invalid script lines or syntax errors in the load test script is posted to the web server during recording, QA Wizard Pro stores that data in a separate postdata file in the workspace. To view a postdata file, select it in the workspace and choose File > Open.

Running load tests Run load test scripts to perform load tests on web applications. During playback, the application runs under a simulated load of users to determine how it behaves.

Note: Load tests must run on the computer that hosts the virtual users. You can use a maximum of 250 virtual users on each computer per load test. To run tests with more virtual users, add additional QA Wizard Pro licenses to other remote computers and distribute virtual users between them when setting up the test.

1. Choose Script > Run Load Test. The Run Load Test dialog box opens. The settings from the most recent load test are displayed.

104 Running load tests

2. Enter the Total number of virtual users to simulate for the load test. This number cannot exceed the number of virtual users available on the computer running the test. 3. Select the Scripts to run. You can include multiple scripts in a load test and divide the total number of virtual users between the scripts. For example, you can test how an application handles 500 users: 200 who use search functionality at the same time and the other 300 who use shopping cart and check out functionality.

n Click Add to add a script to the load test. The Select Scripts dialog box opens. Select the scripts to include in the test and click Select.

n Enter the number of Virtual Users or Percent of total virtual users to simulate for each script. The sum of these values must match the total number of virtual users for the test.

n Click Remove to remove a script from the test. 4. Select the Computers to host virtual users. You can use a maximum of 250 virtual users on each computer per load test.

n Click Add to add a remote computer to host virtual users. The Select Remote Computers dialog box opens. Select the remote computers to use and click Select. You can also configure remote computers to use for the test. Each remote computer must have QA Wizard Pro installed, QAWRemote.exe running, and a valid license. See Configuring remote computers, page 249.

105 Running load tests from a command prompt

n Enter the number of Virtual Users or Percent of total virtual users to host on each computer. The sum of these values must match the total number of virtual users for the test.

n Click Remove to remove a computer from the test. 5. Select the Browsers to use.

n Click Add to add a browser. The Add Browser dialog box opens. Select the browser or enter the user agent to use in the test and click Select. The user agent string is sent to the application to provide specific information about the browser. If you select a browser, the user agent is automatically provided.

n Enter the number of Virtual Users or Percent of the total virtual users to simulate using each browser. The sum of these values must match the total number of virtual users for the test.

n Click Remove to remove a browser from the test. 6. Optionally enter the number of seconds for the load test to spend loading users in the Scale startup to reach 100% load field. Use this option if you want to gradually apply load to the application, which provides a more realistic testing scenario than loading all virtual users instantly. 7. Select a test Duration.

n Run each virtual user until the script completes stops the test when all scripts are complete.

n Run the load test for a specified amount of time stops the test when the specified time limit is reached. If scripts stop before time expires, they restart and continue to run for the duration of the specified time. 8. Click Run. You may be prompted to name the playback session before the test starts. Enter a session name and click Set Name and Run or click Run Without Name to run the session without a name. If you do not want to be prompted to enter a session name, disable it in the server options. See Setting server connection options, page 43. A progress indicator opens and displays the run time, current load, and the number of errors and warnings returned during the test. When the test is complete, a load test report is generated. See Viewing load test results reports, page 109. If email notifications are configured, the results may be sent to specified recipients. See Setting email notification options, page 44.

Note: Load tests do not stop when scripts return errors or warnings. The load test run report includes details about the errors and warnings.

If errors are reported after posting data from a file during a load test, you may need to modify the postdata file. Select the file in the workspace and choose File > Open. Only modify these files if you are familiar with the content type and data.

Running load tests from a command prompt You can use the QAWRunLoadTest command to run load test scripts from a command prompt. Enter QAWRunLoadTest /? to view help. To run standard QA Wizard Pro scripts from a command prompt, use the QAWRunScript command. See Running scripts from a command prompt, page 80.

106 Running load tests from a command prompt

Syntax QAWRunLoadTest.exe virtualusers [workspace] script[:numusers] [/remote computername [:numusers]] [/useragent "useragentstring"[:numusers]] [/scalestartup scaletime] [/runtocompletion | /runtime runseconds] [/reportdir "path" | /reportfile "path" | /noreport] [/Dvariable="value"] [/lsuser username] [/lspassword password] [/lssinglesignon on|off] [/emailresults OnSuccess|OnFailure|Always|Never] [/emailhost host] [/emailport port] [/emailusername username] [/emailpassword passwordincleartext] [/emailusesslencryption TRUE|FALSE] [/emailfrom emailaddress] [/emailto listofemailaddresses] [/emailsubject "subject line"] [/emailmessagebody "message body"] [/sessionname "name"]

Example The following command runs the Shopping Cart load test script for 120 seconds and gradually adds 50 virtual users over the first 60 seconds of playback. QAWRunLoadTest.exe 50 "WysiCorpStore.qawwspace" "ShoppingCart.qawloadscript" /scalestartup 60 /runtime 120

Command options

Load test settings

Item Description

virtualusers Total number of virtual users to simulate. Cannot exceed the number of virtual users available on the computer running the test.

workspace Workspace filename that contains the scripts to run. Required if the load test script calls another script.

script Script filename. Separate multiple scripts with spaces.

:numusers Number of virtual users to assign to an item, such as a script, computer, or browser. If no value is specified, the total number of virtual users is evenly distributed among items. Can assign a maximum of 250 virtual users to each computer.

/remote Run scripts on the specified remote computer. Each remote computer must have QA computername Wizard Pro installed, QAWRemote.exe running, and a valid license. See Running scripts remotely, page 250.

/useragent User agent or browser to use when running scripts. Internet Explorer 8 is used if no "useragentstring" user agent is specified.

/scalestartup Scale startup to reach 100% load in the specified number of seconds. scaletime

/runtocompletion Allow each script to complete and then stop the test.

/runtime Run the test using each virtual user for the specified number of seconds. If scripts end, runseconds they restart and run the remaining duration of the specified time.

107 Running load tests from a command prompt

Item Description

/sessionname Playback session name. Only used if playback information is sent to the QA Wizard "name" Pro Server.

Results reports

Item Description

/reportdir Directory path to save the run report in (e.g., C:\Users\\Documents\My "path" Documents\QA Wizard Pro Workspaces\Load Tests\Load Test Reports).

/reportfile Directory path to save the run report in including file name (e.g., "path" C:\Users\\Documents\My Documents\QA Wizard Pro Workspaces\Load Tests\Load Test Reports\Load Test 8-9-2010 11_23_08 AM.qawreport).

/noreport Disable report generation.

Repository variables

Item Description

/Dvariable="value" Set repository variable and value. Overrides default value.

Email results

Item Description

/emailresults OnSuccess| Indicates when to email results. OnFailure| n OnSuccess: Only email when scripts pass. Always|Never n OnFailure: Only email only when scripts fail.

n Always: Email when scripts pass or fail.

n Never: Do not send email.

/emailhost host Email server host. Enter the domain name (e.g., mailserver.company.com) or IP address (e.g., 192.168.1.100).

/emailport port Port used to communicate with the email server.

/emailusername username Username used to communicate with the email server.

/emailpassword Password used to communicate with email server. passwordincleartext

/emailusesslencryption Use SSL encryption to communicate with the email server. TRUE | FALSE

108 Viewing load test results reports

Item Description

/emailfrom emailaddress Sender's email address.

/emailto Recipient's email address. Separate multiple addresses with a semicolon. listofemailaddresses

/email subject "subject Email subject line. Must start and end with quotes. line"

/emailmessagebody Email message body. Must start and end with quotes. Only one line is "message body" allowed.

Helix ALM Data Warehouse integration

Item Description

/lsuser Helix ALM License Server username for ALM Data Warehouse integration. Overrides the saved value on the computer running the script. If not specified, may be prompted to enter username.

/lspassword Helix ALM License Server password for ALM Data Warehouse integration. Overrides the saved value on the computer running the script. If not specified, may be prompted to enter password.

/lssinglesignon Enable or disable single sign-on for use with ALM Data Warehouse integration. Overrides on|off the saved value on the computer running the script.

Return value After playback completes, a value is returned to the command prompt to indicate if scripts returned errors or warnings.

Value Description

0 No errors or warnings were returned.

Non- Errors or warnings were returned. Use the output in the command prompt, the results report (if zero generated), or the status tool to review error information. See Viewing load test results reports, number page 109 and Viewing playback information in the status tool, page 99.

Viewing load test results reports QA Wizard Pro generates and saves a results report after a load test script runs. The report includes information about how well the server performed under load. Load test reports are named Load Test followed by the date and time the load test ran. For example, Load Test 6-17-2010 1_05_17 PM. If email notifications are configured, the report may be sent to specified recipients. See Setting email notification options, page 44. 1. Double-click a load test report in the Load Test Reports folder in the Reports pane.

109 Viewing load test results reports

The report opens and displays an overview of the test results, details about errors and warnings returned during the test, and graphs of the virtual users, response time, page hits, bytes transferred, and number of errors. 2. Click Export Graph Data in the report to save the graph data as a CSV file. You can open this file in Microsoft Excel and create additional graphs or manipulate the data for additional analysis. 3. Choose File > Print to print the report. 4. Choose File > Save As to save the report in a different format to use with other programs. See Exporting results reports, page 76.

110 Stress Testing

Stress testing helps you determine how a Windows or Java application performs under stressful conditions. You can create stresses, such as disabling Windows networking services, or simulate scenarios, such as read-only disks or low memory and disk space. QA Wizard Pro can apply multiple stress simulations to an application at once. The simulations can start when the application starts or be staggered to stress the application at specific points. Disk and memory simulations only affect the application when interacting with it from QA Wizard Pro. When script playback completes, all stresses are stopped. You can add stresses when recording new scripts, recording additional steps in existing scripts, or populating the application repository. You can also manually add stress testing statements to scripts. See Applying stresses, page 112 or Creating and running stress tests, page 111.

Note: Disabling Windows networking disables all network adapters on the host or remote computer. This affects all running applications. Close all applications that require a network connection before disabling networking.

Creating and running stress tests You can create stress tests to determine how a Windows or Java application behaves under stressed conditions. You can add simulated stresses to test an application, such as low memory, low disk space, and read-only drives, or real stresses, such as disabled Windows networking. You can add stresses to scripts during recording or manually add stress statements to existing scripts. The following example shows a stress test script.

Note: Stress statements cannot be used when recording new load tests or Helix ALM test cases, running load tests, or creating scripts from test cases.

111 Applying stresses

Creating new stress test scripts You can add stresses as you record new scripts. This is helpful if you want to enable stresses when the application starts or from a specific point in the script and use them throughout script playback. See Applying stresses, page 112.

Adding stresses to existing scripts You can add stresses to existing scripts as you record additional steps. See Applying stresses, page 112. You can also manually add stress statements to existing scripts. This is helpful if you want to enable and disable stresses at specific points during script playback. See Stress statements, page 346.

Running stress test scripts Run stress test scripts the same way you normally run scripts. See Running scripts, page 73. When playback completes, all simulated and real stresses are disabled, a run report is generated, and the tested application resumes normal operation. If email notifications are configured, the results are sent to specified recipients.

Applying stresses You can apply stress to applications when recording new scripts or additional script steps to test how applications behave under stressful conditions, such as low disk space and memory. You can also apply stresses when populating the application repository to capture controls that are only displayed under stressful conditions. For example, you may want to simulate a read-only drive to capture an error message dialog box.

Note: You can manually add stress statements to scripts to enable and disable stresses at specific points during script playback. See Adding statements, page 146.

1. Click the Stress Recording toolbar button when recording a script or populating the repository. The Configure Stress dialog box opens.

2. Select any Drive options.

112 Applying stresses

n Simulate drive with remaining simulates a drive with low space. Select the drive letter, enter the remaining space, and select a unit of bytes.

n Simulate drive as read only simulates a read-only disk. Select the drive letter. 3. Select any Memory options.

n Simulate memory with remaining simulates low memory. Enter the remaining space and select a unit of bytes.

n Simulate maximum of per allocation specifies the maximum available memory per allocation attempt. Enter the space and select a unit of bytes. 4. Select Disable Windows networking to disable all network adapters on the computer.

Note: Disabling networking affects all applications running on the computer. If an application that requires a network connection is running, close it before selecting this option.

5. Click OK to save the changes. Finish recording the script or populating the repository. If you recorded a script, the stress options you set during recording are applied when you run the script. See Running scripts, page 73.

113

Managing Windows and Controls

When you record a script, QA Wizard Pro identifies windows and controls in the application and saves information about them in the application repository. This information is used during playback to locate and perform actions on windows and controls in the application. If the application changes after scripts are recorded, new windows and controls are added to the repository. You can modify window and control data in the application repository to: n Create intuitive names for windows and controls that are referenced in scripts. n Change control types to better identify generic or incorrectly identified controls in the repository. n Change the properties and values that are used during playback to locate controls. n duplicate controls that are captured during recording if the application changes. n Update references to modified window and control names in multiple scripts.

Note: For best results, record scripts or populate repositories to capture window and controls information whenever possible. If QA Wizard Pro cannot capture window or controls because they do not exist in the application or cannot be displayed when recording, you can manually add them to the repository to use when creating or modifying scripts. See Configuring user-added windows and controls, page 136.

Capturing window and control data Each window and control in an application has several properties that QA Wizard Pro uses to uniquely identify objects. Following are examples of properties that may be captured:

Property Description

ControlOrder Order of controls in the window.

Focused Indicates if the control is currently selected.

ListItems Values displayed in a combo box or list box.

Number of Items Number of items in a combo box or list box.

SelectedIndexes Position of items in a combo box or list box.

SubType Definition of the control in the Window Class.

Text Default text displayed in an edit box or combo box or the text that appears on a button or as a label.

Visible Indicates if the control is displayed.

Tip: Before you record scripts, take the time to set up the application in the application repository. This includes capturing the window and controls and modifying their properties. If a window or dialog box is displayed during recording, QA Wizard Pro captures the window, controls, and their properties. See Setting up repositories, page 59.

115 Reviewing and saving repository changes

Reviewing and saving repository changes QA Wizard Pro updates the application repository when you record a script, populate the application repository, or apply URL formats. Before the repository is updated, you are prompted to review windows and controls that will be added or modified and optionally make changes. It is important to take the time to review repository changes to make sure that: n A large number of duplicate controls will not be added to the repository, which can make it unmanageable. n New controls that will be added to the repository have meaningful and intuitive names. You can rename controls before they are added. If you recorded a script, the new control names are used in the resulting script. n Generic controls that QA Wizard Pro cannot identify are changed to a specific control type, if appropriate. You can change generic controls and HTML elements to button, check box, edit box, and tab bar controls. Making any changes to windows and controls before they are added to the repository provides a more readable, accurate resulting script with fewer ambiguous control names and better statements for interacting with controls.

Note: You are also prompted to review repository changes if you click the Review recommended repository changes link in the Errors pane after playback.

1. The Repository Changes dialog box opens after recording a script, populating the repository, or applying URL formats. The number of affected windows and controls and the following information is displayed:

n Control—Window or control that will be added or modified. To rename a control, click the name and enter a new name or select a suggested name from the list (new controls only). See Renaming windows and controls, page 133.

n Type—Control type. To change the type for a generic control or HTML element, select a new type. See Changing control types, page 132.

n Action—Action to perform on the window or control. Will add indicates the window or control is new and will be added. Will modify indicates the window or control already exists and the properties will be updated. None indicates no action will be performed.

n Reason—Reason the action will be performed on the window or control. See Repository change reasons, page 118.

116 Reviewing and saving repository changes

Tip: Select a window or control to view the screenshot that will be saved in the repository. A screenshot is only displayed if repository images are set to update during recording. If a control is selected, it is outlined with a red box in the screenshot. Use the zoom buttons to adjust the image or select Auto Fit to display the entire screenshot.

2. Select Smart matching to allow QA Wizard Pro to automatically select different search criteria if needed. See About smart matching, page 118. Smart matching is generally helpful when adding windows and controls to the repository. If this option is selected, the list refreshes and displays the windows and controls to update based on smart matching. You may not want to select this option if you have an established repository.

Note: Smart matching during recording is currently only available for web scripts.

3. Only add used controls to the repository is selected by default. Clear this option to add all captured controls to the application repository. You may not want to clear this option if the application contains a large number of controls that you will not test. This can help keep the repository more manageable. If this option is cleared, the list refreshes with the controls to add or modify.

Note: Statements can only perform actions on windows and controls stored in the application repository. You cannot add or edit statements on controls that are not in the repository.

117 Repository change reasons

4. Click Save to save the recommended changes or click Don't Save if you want to reject the recommended changes. You may not want to save the changes if duplicate controls will be added to the repository. This indicates the properties selected as search criteria for the existing control are not unique and you need to modify the criteria. See Modifying window and control properties, page 122.

Tip: If you are recording a script and click Don't Save, the recording is canceled and the script steps are not saved.

Repository change reasons Following are reasons windows and controls in the repository need to be updated. The reason is displayed for each control in the Repository Changes dialog box. See Reviewing and saving repository changes, page 116.

Reason Explanation

New The window or control does not exist in the application repository and will be added. control

Smart The search criteria for the window or control will be automatically updated because the matching selected properties do not differentiate the control from new controls captured during recording. See About smart matching, page 118.

Image The repository image for the control will be automatically updated. Images are only updated if update the Update preview images when recording option is selected in the Options dialog box. See Setting general options, page 40.

Format The URL format rules for the application version will be applied to the control. See Applying applied URL format rules, page 229.

About smart matching Smart matching enhances recording reliability by enabling QA Wizard Pro to update window and control properties used as search criteria in the application repository to differentiate them from new windows and controls captured during recording. Smart matching is also used during playback to locate controls and recommend better search criteria if QA Wizard Pro cannot determine the difference between two or more controls.

Note: Smart matching is currently only available for web scripts.

Recording After you record a script, the Repository Changes dialog box opens and allows you to review the windows and controls that will be added or modified in the application repository. Smart matching, which is enabled by default for web scripts, allows QA Wizard Pro to compare existing repository controls against the new controls.

118 Overriding naming conventions for new controls

If QA Wizard Pro determines the properties selected as search criteria for existing controls do not differentiate them enough from new controls captured during recording, different search criteria is selected to make the controls unique. This can help prevent incorrect merging of two similar controls into one control in the repository and prevent adding the same control to the repository multiple times. See Reviewing and saving repository changes, page 116.

Playback During playback, QA Wizard Pro attempts to find controls that match the control properties selected as search criteria in the application repository. If more than one matching control is found or the control is not found, QA Wizard Pro uses smart matching to try to locate the control. If smart matching cannot locate the control, the process of using search criteria followed by smart matching repeats until the control is found or the control search timeout limit is reached. If smart matching locates the control, a warning in the Errors pane indicates the control the action was performed on and includes a 'Review recommended repository changes' link. You can click this link to open the Repository Changes dialog box, which displays the recommended repository changes. You can review the changes and save them to update the repository. The next time you run the script, QA Wizard Pro should be able to uniquely identify the control. See Reviewing and saving repository changes, page 116.

Disabling smart matching Smart matching is enabled on all controls by default. You can disable smart matching on the Advanced tab in the control Properties dialog box. If you disable smart matching on a control, only the search criteria are used to locate the control during recording and playback.

You should only disable smart matching for controls if: n You always want to use modified search criteria to locate a control during playback and do not want smart matching to change the criteria during recording. n QA Wizard Pro uses smart matching during playback, but chooses the wrong controls. In this case, modify the search criteria to fix the issue before you disable smart matching.

Overriding naming conventions for new controls When recording scripts or populating the application repository, QA Wizard Pro captures windows and controls and information about their properties from the application. Before adding controls to the repository, you are prompted to review the control names and types in the Repository Changes dialog box. If you want to change a control name, you can enter one or select one from a list of suggestions generated based on control properties.

119 Overriding naming conventions for new controls

To ensure new controls captured when you record or populate in the future use intuitive names that are consistent with the tested application, you can override the default control naming convention. You can specify a prefix to add to control names to help you organize controls by type in the repository. You can also change the priority of properties used to suggest names for each control type. For example, if you want all new buttons captured from an application to use the same prefix followed by the button text as the name, you can specify the 'btn' prefix for the Button control and select the Text property value as a priority to ensure that value is suggested for the rest of the control name before other property values.

Note: Name overrides only apply to new controls captured when recording scripts or populating the repository. Existing controls in the repository are not updated.

1. Click the Name Overrides tab when you are adding an application or modifying application properties.

2. Select a Control Type. 3. Enter a Control name prefix to prepend text to new control names. 4. Select a property from the Available Properties list and click the right arrow to add it to the Override Priority list. The override priority order determines which property values are used first when QA Wizard Pro suggests control names in the Repository Changes dialog box. Values added to the Override Priority list are used after values in the default naming convention order. See Default control naming convention, page 121. Use the arrow buttons to reorder the list.

120 Default control naming convention

The value in the Available Properties list represents the default naming convention for the control type. If you want to add property values not included in the default convention for the control type, add to the Override Priority list and then add the additional property values after it. This forces QA Wizard Pro to look for other property values in the control to use for name suggestions, but keeps the default naming convention as first priority.

Tip: To copy overrides from another application, click Copy Overrides and select the application.

5. Click OK to save the changes.

Default control naming convention When recording a script or populating the application repository, QA Wizard Pro suggests window and control names based on properties captured from the application. Before adding controls to the repository, you can review them in the Repository Changes dialog box. You can select a name for controls from the list of suggestions or enter a name. To create the list of suggested names for new controls, QA Wizard Pro uses up to five control property values in the following order.

Note: Properties that only apply to specific control types are in parentheses.

Priority Property

1 UIA Name

2 Automation Name

3 Automation ID

4 Name

5 Control Name

6 Object Name

7 ID

8 Inner Text (Link only)

9 Text (Window, Button, and Label only)

10 Title (Window only)

11 Accessible Name

12 Label

13 UIComponent ID

14 Display Object Name

121 Modifying window and control properties

Priority Property

15 Attached Text (EditBox, SpinBox, ComboBox, ListBox, ListView, Grid, Tree, and Image only)

16 MSAA Name

17 [placeholder] (EditBox, SpinBox, and ComboBox only)

18 [alt] (Image only)

19 [title] (Image only)

20 src (Image only)

21 Menu Type (Menu only)

22 Class Name

23 HTMLTagName (HTMLElement only)

24 Control Type

Tip: If you want to add a prefix to new control names or change the priority of the properties used to suggest names for a specific control type, you can override the default control naming convention. See Overriding naming conventions for new controls, page 119.

Modifying window and control properties Each application window and control has a set of properties that are captured during recording and saved in the application repository. These properties make each window and control in the repository unique so duplicate objects are not added during subsequent recordings. Properties are also used as search criteria to find windows and controls in the application during playback. Different types of windows and controls have different types of properties and each property has a value. For example, the Text property of an OK button is OK. QA Wizard Pro automatically selects a unique set of properties to use as search criteria. A window or control is successfully located when its actual property values match the selected search criteria. QA Wizard Pro stores two values for each window and control property. The original value is saved when the window or control is added to the application repository. The expected value is what scripts expect to find during playback. These values usually match. If an application changes, you may need to modify expected values to make sure QA Wizard Pro can locate the window or control during playback. You can also select different search criteria based on your knowledge of the application. 1. Select a window or control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected.

Tip: Select windows or controls in the Preview pane to quickly locate them in the Application Repository pane.

122 Modifying window and control properties

2. Enter a Name to identify the window or control in scripts and the application repository. If you rename a window or control, you must also update the name in existing scripts. See Renaming windows and controls, page 133. 3. Select a Control type to let QA Wizard Pro determine the actions that can be performed on the control. Only change the control type if a different type more accurately identifies the control or the current type is incorrect. You cannot change the type for windows. See Changing control types, page 132. 4. Click the Search Method tab to view or change the method and criteria used to search for the window or control during playback. See About search methods, page 124. 5. Click the Properties tab to view a list of property names and values captured when the window or control was added to the application repository.

Tip: You can use this information as a reference for valid property names to use when adding Checkpoint or Property statements to verify current property values or creating custom XPath queries to locate HTML controls during playback. See Checkpoint, page 363, Property, page 509, and About XPath queries, page 223.

6. Click the Advanced tab to select options that let QA Wizard Pro automatically update the properties used during recording and recommend better search criteria during playback. See Setting advanced control properties, page 131. 7. Click OK to save the changes.

123 About search methods

About search methods During playback, QA Wizard Pro searches for windows and controls using the Standard, XPath, or Function method, which is selected in the window/control Properties dialog box.

Standard When new windows and controls in Windows and Java applications are added to the application repository, the Standard search method is selected in the control properties by default. This search method locates windows and controls using application properties and expected values. A control is located when its actual property values match the selected search criteria in the repository. If a control set to use the Standard search method is not located during playback, you can modify the properties to select different search criteria. See Changing standard search criteria, page 124. If QA Wizard Pro still cannot locate the control or selects the wrong control after modifying the criteria, you can modify the control to use the XPath or Function search method instead.

XPath When new HTML controls in web applications are added to the application repository, the XPath search method is selected in the control properties by default. This search method locates HTML controls using an XPath query. All HTML controls in the repository have an XPath, which is a unique path to a control based on its position in the hierarchy of the HTML document. QA Wizard Pro can search for controls using the XPath in the repository or you can enter a different XPath. See About XPath queries, page 223.

Note: Some HTML controls added to the repository in QA Wizard Pro 2016.2.0 or earlier may use the Standard search method. If these controls are not located when running web scripts, modify the control properties to use the XPath search method to improve playback accuracy. See Using the XPath search method, page 223.

Function The Function search method can be used to create a custom algorithm to locate controls, such as a search algorithm that includes and/or conditions. Because this function is executed both during recording and playback, you must use the GetRunTimeValue function to retrieve control properties. See Using the Function search method, page 129.

Note: Only use the Function search method if you are familiar with creating functions and understand how changing search options can impact scripts. Scripts will not work if you use this search method incorrectly.

Changing standard search criteria A window or control must be unique so QA Wizard Pro can differentiate it from other objects. QA Wizard Pro automatically selects a unique set of properties to use as search criteria. If QA Wizard Pro cannot locate a window or control when scripts run, you can change the properties used as search criteria or the expected values to better identify it during playback. You may also need to update search criteria if the application changes to prevent QA Wizard Pro from adding existing windows or controls to the repository during subsequent recordings. 1. Select a window or control in the Application Repository pane and choose File > Properties.

124 Changing standard search criteria

The Properties dialog box opens with the Search Method tab selected.

2. Select a property check box to use it as search criteria. Clear the check box to remove the property as search criteria. If the property you want to use as search criteria is not displayed, click Add Property to add it. This option is only available for user-added windows and controls, which are identified by on the control type icon in the Application Repository pane. See Adding properties to user-added windows and controls, page 140. If you select more than one property, the expected values for all selected properties must match the actual values during playback. If any of the values do not match, QA Wizard Pro cannot find the window or control.

Note: HTML element property names may be enclosed in brackets. For example, [href]. The brackets indicate that the property is a specified attribute in the HTML. QA Wizard Pro does not require these properties when capturing information during recording or populating the repository, or use them as search criteria by default. In some cases, you may see two properties with the same name, such as href and [href]. The property values are the same, but the brackets indicate a difference in how the properties were captured.

3. Select an Action to specify how QA Wizard Pro searches for the property's expected value.

n Equals searches for exact matches to the expected value. This is the default action.

n Starts with searches for values that start with the expected value.

n Ends with searches for values that end with the expected value.

125 Editing window and control properties

n Contains searches for values that include the expected value.

n Matches regex matches a regular expression. See Using regular expressions, page 127.

n Matches format matches parts of a URL to an expected value. This action is only available for web properties with URL expected values, such as URL, Href, and Src. See Editing URL format rules in control properties, page 230. 4. Enter the Expected Value for the property or mouse over the current value and click Edit to modify it. See Editing window and control properties, page 126. 5. Click OK to save the changes.

Editing window and control properties QA Wizard Pro stores two values for each window and control property. The original value is saved when the window or control is added to the application repository. The expected value is what scripts expect to find during playback. These values usually match. If an application changes, you may need to modify expected values to make sure QA Wizard Pro can locate the window or control during playback. 1. Select a window or control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected. 2. In the row for the property set as search criteria, select an Action to specify how QA Wizard Pro searches for the expected value. You can specify to search for values that match the exact expected value, start with, end with, or contain the expected value, match a regular expression, or match a URL format. 3. Mouse over the Expected Value and click Edit. The Edit Property dialog box opens.

Note: If Matches format is selected in the Action column, the Edit URL Formats dialog box opens. See Editing URL format rules in control properties, page 230.

4. Select a property Name if the current name is incorrect.

126 Using regular expressions

Note: The Name field is only enabled for properties manually added to user-added windows and controls. Default properties QA Wizard Pro saves with controls based on the type cannot be renamed.

5. Enter the expected value. You can use repository variables in expected values so QA Wizard Pro can locate dynamic windows and controls when an application changes. For example, you can replace a URL with the URLROOT repository variable. To use a repository variable in the value, select it from the list and click Insert. The variable is replaced with the variable value used during playback. See Creating repository variables, page 215.

Tip: To enter a repository variable in the Expected value field, add percent signs to the beginning and end of the variable name. For example, %urlroot%.

6. Click OK to save the changes. 7. Click OK to close the Properties dialog box.

Using regular expressions Regular expressions provide a more powerful way to search for window or control properties that include dynamically generated text, such as a window title or button label. When a property used as search criteria includes dynamically generated text, QA Wizard Pro may not be able to find the window or control during playback. To make sure QA Wizard Pro finds the window or control, you can use a regular expression as the expected value to search for a pattern match. For example, in Helix ALM, the edit window title can be either Edit Issue #x or Edit Record #x depending on the project configuration, where x corresponds to the assigned issue number (e.g., Edit Issue #2). To make sure QA Wizard Pro finds the window, Matches regex is selected in the Action column and the expected value is replaced with Edit Issue|Record #. When the script runs, QA Wizard Pro successfully finds the edit issue or edit record window because the expected value matches Edit Issue # or Edit Record #, regardless of the number in the window title. 1. Select a window or control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected.

127 Changing the search method for multiple controls

2. In the row for the property set as search criteria, select Matches regex as the Action used to search for the expected value. Selected properties are used as search criteria for the window or control. 3. Enter the regular expression as the Expected Value. QA Wizard Pro supports .NET regular expressions. 4. Click OK to save the changes.

Changing the search method for multiple controls You can change the search method set for multiple controls at the same time. This lets you quickly switch to a more accurate search method without manually updating the properties of each control. For example, if multiple HTMLLink controls in the application repository use a relative XPath, but have a dynamic ID attribute that changes every time the web page refreshes, you can update them all to use the full XPath. See About search methods, page 124 for information about search methods. 1. Ctrl+click the controls to change the search method for in the Application Repository pane. You can only select multiple controls in the same window. 2. Right-click and choose Search Method. A check mark indicates the current search method. Custom indicates at least one of the selected controls uses the Custom XPath or Function search method.

128 Using the Function search method

3. Select the search method to use. Relative XPath and Full XPath are only available for HTML controls in web applications. Custom opens the Properties dialog box and is only available when one control is selected. You are prompted to confirm the change. 4. Click Yes. The selected search method is set in the control properties.

Using the Function search method You can use the Function search method to create a custom algorithm that locates controls that are stored in the application repository during playback. For example, you can use a search algorithm that includes and/or conditions. The function is executed during recording and playback and must return True to locate the control. You may want to use the Function search method if a control is not located after you: n Select additional or different search criteria in the Standard search method. See Modifying window and control properties, page 122. n Use regular expressions for expected values in the Standard search method. See Using regular expressions, page 127. n Use the XPath search method to locate an HTML control. See Using the XPath search method, page 223.

129 Using the Function search method

Note: Only use the Function method if you are familiar with creating functions and understand how changing search options can impact scripts. Scripts will not work if you use this search method incorrectly.

Creating the search function 1. Select a window or control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected. 2. Select Function from the Search method list. The following code is automatically added to declare the function: Function ControlName(controlData) End Function 3. Add the function to use to locate the control.

n The function must return True or False to indicate if the controlData passed to the function represents the control.

n Use the ContainsRuntimeValue statement to check that the property is defined for the control and the GetRuntimeValue statement to return the property value.

n Use the Subtype property in combination with other properties to locate the control. 4. Click OK to save the function.

ContainsRuntimeValue statement Returns True or False to indicate if a property is defined for a control. ContainsRuntimeValue(ControlData,"PropertyDisplayName") ControlData The snapshot control data (properties). PropertyDisplayName Property display name to find.

GetRuntimeValue statement Returns the value of a control property. Use the ContainsRuntimeValue statement first to determine if the property is defined. GetRuntimeValue(ControlData,"PropertyDisplayName") ControlData The snapshot control data (properties). PropertyDisplayName Property display name to find.

Note: The ContainsRuntimeValue and GetRuntimeValue statements can only be used with the Function search method.

130 Setting advanced control properties

Example A dialog box contains an Advanced>> button, which is a .NET Windows Forms push button control. When the button is clicked, the dialog box expands with additional controls and the button is replaced by a Simple<< button. When the Simple<< button is clicked, the dialog box is restored to its original state. When you record a script, QA Wizard Pro captures both the Advanced>> and Simple<< buttons. You want QA Wizard Pro to recognize the buttons as the same button during playback so you merge them in the application repository and change the control name to AdvancedSimple. Use the Function search method to locate the AdvancedSimple control. The control is only located if the function returns True. The following function returns True if the value of the control's SubType property is .NET PushButton and the value of the Text property is Advanced>> or Simple<<. The function returns False if the control was not located. Function AdvancedSimple(controlData) isAdvancedSimple = False subType = GetRuntimeValue(controlData, "Subtype") hasText = ContainsRuntimeValue(controlData, "Text") If hasText and subType = ".NET PushButton" Then text = GetRuntimeValue(controlData, "Text") If text = "Advanced >>" or text = "Simple<<" Then isAdvancedSimple = True End If End If Return isAdvancedSimple End Function

Setting advanced control properties You can enable smart matching to automatically update the standard search criteria for windows and controls. Smart matching helps differentiate similar windows and controls added to the application repository, but you can disable it for windows or controls if you always want to use search criteria you specified to locate them. See About smart matching, page 118. 1. Select a window or control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected. 2. Click the Advanced tab.

3. Select Enable smart matching to let QA Wizard Pro update window and control properties used as search criteria during recording and recommend better search criteria during playback. This option is selected by default. Only clear it if you do not want to automatically update search criteria.

131 Changing control types

Note: Ignore this overlay control during recording and playback and Force recursive ignore are only available if they were selected for the control in an earlier QA Wizard Pro version. These options ignore controls if they obstruct others in the application to work around playback issues. If you clear Ignore this overlay control during recording and playback, both options are permanently removed from the Properties dialog box.

4. Click OK to save the changes.

Changing control types When you record a script or populate the application repository, QA Wizard Pro captures and analyzes the application controls and identifies the type of each one. The type is saved in the repository and used to determine actions that can be performed on the control. If QA Wizard Pro cannot identify a control type, it is added to the repository as a generic control. Scripts can only use low-level action statements to interact with generic controls. You may need to change a control type to identify it more accurately so you can use other statements to interact with it. For example, you can change a generic control that you enter text in to an edit box. This lets you to add statements that perform object actions, such as Set Text, on the control instead of relying on low- level action statements. It is easiest to change control types in the Repository Changes dialog box that opens after you record a script or populate the repository. The resulting script includes object action statements for controls you interacted with instead of low-level actions. See Reviewing and saving repository changes, page 116. You can also change the type of any control in the control Properties dialog box.

Note: You cannot change the control type for windows.

1. Select a control in the Application Repository pane and choose File > Properties. The Properties dialog box opens.

Tip: Select a control in the Preview pane to quickly locate it in the Application Repository pane.

2. Select a Control type. You can change any control to a Button, Check Box, Edit Box, or Tab Bar. Make sure you select a control type that matches the control.

3. Click OK to save the changes. The control type is changed in the repository.

132 Renaming windows and controls

Renaming windows and controls It is important to make sure windows and controls in the application repository use intuitive names that are consistent with the tested application. For example, when you recorded the first script against an application, QA Wizard Pro named a Username field control as editbox8. You can rename the control to use the field name to more easily identify it in the repository and scripts. Windows and controls are displayed alphabetically in the repository. When you rename windows and controls, use the same name as in the application or use a naming convention that groups similar controls. For example, to group buttons, rename the OK and Cancel buttons in the repository to buttonCancel and buttonOK.

Tip: When you review new windows and controls in the Repository Changes dialog box after recording a script or populating the application repository, QA Wizard Pro suggests names for them based on property values captured from the application. To use a different naming format for new controls, you can override the default naming convention for specific control types to reduce the time spent manually renaming windows and controls. See Overriding naming conventions for new controls, page 119.

1. Select a window or control in the Application Repository pane. A screenshot of the window is displayed in the Preview pane. If a control is selected, it is outlined with a red box in the screenshot.

Note: To adjust the Preview pane to view the entire screenshot, double-click the pane title bar. Adjust the pane size or use the zoom buttons to adjust the image. You can also select controls in the Preview pane to quickly locate them in the Application Repository pane.

2. Compare the name in the application repository to the selected window or control in the Preview pane and decide if it needs to be renamed. 3. To rename the window or control, select it and choose File > Properties. The Properties dialog box opens.

133 Finding and replacing property values

Tip: To rename a window or control without opening the Properties dialog box, right-click it in the Application Repository pane and choose Rename.

4. Enter a new Name for the window or control. Window names must be unique within the application version and control names must be unique within the window they are grouped with in the repository.

5. Click OK to save the changes. The window or control name is changed in the repository.

Note: When you rename a window or control, scripts created before the change will not work until you update them. See Synchronizing with the application repository, page 143.

Finding and replacing property values If an application changes, you may need to change the expected value used to locate a window or control. Use the repository find and replace to locate window and control property values and replace them. For example, if a web site server name changes in a URL, you can update all references to it in the repository.

Note: You cannot replace property values for controls that apply URL format rules to the expected value. See Applying URL format rules, page 229.

1. Choose Repository > Find and Replace. The Repository Find and Replace dialog box opens.

134 Finding and replacing property values

2. Select the Repository path you want to search. 3. Enter the value to search for in the Find field. 4. Enter the replacement value in the Replace field. The New Expected Value column is updated as you type.

Tip: You can enter a value in the Find field, enter a value in the Replace field, and click Replace All to replace the values without performing a find.

5. Select Match case to match the case of the value in the Find field. 6. Select Limit to properties containing to limit the search based on a value in a property name. Enter the value to search for. For example, you want to find all instances of 'WysiCorp' only in property names that contain 'text'. Select this option and enter 'text' in the corresponding field. The search results only include properties that contain the value in the Find field and 'text' in the property name, such as Text and TopControlText. 7. Click Find. The search results are displayed.

Note: If a URL format rule is applied to an expected value, the search results display the URL without applying the rule.

8. Select a search result and click Properties to open the Properties dialog box. 9. Select a search result and click Replace to replace the value.

Note: If the expected value cannot be replaced, is displayed in the New Expected Value column.

10. Click Replace All to replace the value in all expected values in the search results. 11. Click Close when you are finished.

135 Merging controls

Merging controls New controls may be added to an application or existing control properties may change after you record scripts. Because QA Wizard Pro uses properties to identify a window or control, there may be duplicates of the same object in the application repository. You can merge controls to eliminate the duplicates and keep one control that can be used by scripts. For example, you record a script that references a dialog box with an Exit button. The button name is changed to Cancel in a later release. You record a new script and there are now two items in the repository for the same control. You want scripts to use the Cancel button repository item only. You could delete the Exit button, but scripts that use the old control name will fail. Merge the controls to delete the duplicate control without breaking scripts. 1. Select the control you want to keep in the Application Repository pane. 2. Ctrl+click each control you want to merge with the selected control. 3. Choose Repository > Merge. The Merge Controls dialog box opens.

4. Select the Control to keep. This is the control that remains in the application repository after the controls are merged. The controls that will be removed are displayed in the Controls to remove list. 5. Click OK. The controls are merged.

Note: If a control is removed because it is merged with another control, scripts recorded before the change will not work until you update them. See Synchronizing with the application repository, page 143.

Configuring user-added windows and controls When creating or modifying scripts, you can only add statements that perform actions on windows or controls if the windows or controls are already in the application repository. If QA Wizard Pro cannot add windows or controls you need to test during recording because they do not exist in the application or cannot be displayed when recording, you can manually add them to the repository. You may want to manually add windows and controls to the repository if:

136 Configuring user-added windows and controls

n You use a test-driven development process and need to create scripts for testing windows and controls before they are implemented in the application. n You only need to add a small number of controls to the repository. Manually adding the controls may be faster than repopulating the repository. n You cannot set up the computer you are recording on to capture a specific window or control. For example, you may need to add a statement that clicks a button on a dialog box that only is only displayed in Windows Vista. If you do not have access to a Vista computer and record on a Windows 7 computer, the dialog box is not displayed. You can manually add the window and control to the repository and then add statements to scripts to handle the scenario. You can add new windows and controls to the repository and configure the properties and search criteria based on your knowledge of the application. You can also duplicate an existing window and control and then modify the properties of the new control to make it unique in the repository.

Note: For best results, record scripts or populate repositories to capture window and controls information whenever possible. Only manually add windows or controls if you are familiar with how QA Wizard Pro uses properties and expected property values to locate controls during playback. See Modifying window and control properties, page 122.

1. Select the application version in the Application Repository pane and choose Repository > Modify Version Windows and Controls. The Modify Windows and Controls dialog box opens.

2. To add a window, select the version and click Add Child or select a window and click Add Sibling. To add a control, select a window and click Add Child or select a control and click Add Sibling. See Manually adding windows and controls to application repositories, page 138. 3. Select a window or control and click Duplicate to duplicate it. See Duplicating windows and controls, page 142.

137 Manually adding windows and controls to application repositories

Tip: To move a user-added control to group it with a different window, drag it to the correct window. This is helpful when duplicating existing controls to use with other windows in the application.

4. Select a window or control and click Rename to rename it. See Renaming windows and controls, page 133. 5. Select a window or control and click Properties to modify the properties, such as the control type, search method and criteria, and expected property values. See Editing and deleting user-added windows and controls, page 143. 6. Select a window or control and click Delete to delete it. See Editing and deleting user-added windows and controls, page 143. 7. Click OK to save the changes.

Manually adding windows and controls to application repositories If QA Wizard Pro cannot add windows or controls you need to test during recording because they do not exist in the application or cannot be displayed when recording, you can manually add them to the repository. This lets you add controls for use in statements without needing to record first. You may want to manually add windows and controls to the repository if: n You use a test-driven development process and need to create scripts for testing windows and controls before they are implemented in the application. n You only need to add a small number of controls to the repository. Manually adding the controls may be faster than repopulating the repository. n You cannot set up the computer you are recording on to capture a specific window or control. For example, you may need to add a statement that clicks a button on a dialog box that only is only displayed in Windows Vista. If you do not have access to a Vista computer and record on a Windows 7 computer, the dialog box is not displayed. You can manually add the window and control to the repository and then add statements to scripts to handle the scenario.

Note: For best results, record scripts or populate repositories to capture window and controls information whenever possible. Only manually add windows or controls if you are familiar with how QA Wizard Pro uses properties and expected property values to locate controls during playback. See Modifying window and control properties, page 122.

1. Select the application version in the Application Repository pane and choose Repository > Modify Version Windows and Controls. The Modify Windows and Controls dialog box opens.

138 Manually adding windows and controls to application repositories

2. To add a window, select the version and click Add Child or select a window and click Add Sibling. To add a control, select a window and click Add Child or select a control and click Add Sibling.

Tip: To add a window or control that is similar to an existing window or control in the repository, duplicate the existing control and then edit the properties in the new control. See Duplicating windows and controls, page 142.

The Properties dialog box opens.

3. Enter a Name to identify the window or control in scripts and the application repository.

139 Adding properties to user-added windows and controls

4. Select a Control type to let QA Wizard Pro determine the actions that can be performed on the control. You cannot change the type for windows. 5. Click the Search Method tab to select the method and criteria used to search for the window or control during playback. See About search methods, page 124.

Note: If you select the Standard search method, you can add properties and expected values to use as search criteria. See Adding properties to user-added windows and controls, page 140.

6. Click the Properties tab to view or update the list of property names and values to save with the control when it is added the repository. You usually do not need to make changes to this information. You can use it as a reference for valid property names to use when adding Checkpoint or Property statements to scripts or creating custom XPath queries to locate HTML controls during playback. You can also add or delete properties based on your knowledge of the control to save additional information. See Adding properties to user- added windows and controls, page 140 and Deleting properties from user-added windows and controls, page 142. 7. Click the Advanced tab to select options that let QA Wizard Pro automatically update the properties used during recording and recommend better search criteria during playback. See Setting advanced control properties, page 131. 8. Click OK to add the control. The control is displayed in the Modify Windows and Controls dialog box. A overlay on the control type icon indicates it is a user-added control instead of a control added by QA Wizard Pro. 9. Repeat steps 2 - 8 to add additional controls.

Tip: To move a user-added control to group it with a different window, drag it to the correct window. This is helpful if you accidentally add a child control to the wrong window.

10. Click OK to save the changes. After controls are added to the repository, you can add statements to scripts to perform actions on them. See Adding statements, page 146.

Adding properties to user-added windows and controls Each application window and control has a set of properties that make it unique in the application repository. These properties are used to identify windows and controls so duplicate objects are not added during subsequent recordings. They are also used as search criteria for the Standard search method to find the controls during playback. See About search methods, page 124. When you select the control type for a user-added window or control, a default set of properties is automatically added to it. To use a property that is not added to the control by default as search criteria or to make the control unique in the repository, you can manually add the property and value.

Note: Make sure to only add valid properties to user-added windows or controls based on the technology used to develop the test application. You cannot add properties to windows and controls added to the repository by QA Wizard Pro.

1. Click Add Property on the Search Method or Properties tab in the Properties dialog box when you are adding or editing a user-added window or control.

140 Adding properties to user-added windows and controls

The Add Property dialog box opens.

2. Select or enter a property Name. If the window or control in the application does not include the specified property name, QA Wizard Pro cannot identify it during recording and playback, which may cause errors or add duplicate objects to the repository. 3. Enter the Repository value to save as the original value for the property when the control is added to the repository. Enter a valid value based on your knowledge of the test application that can be used as a reference if the expected property value is changed later. If you do not know the value to enter, ask the application developer for help. 4. Enter the Expected value to specify the value to find in the application during playback. The repository and expected values usually match when you first add properties to windows or controls, but you can modify the expected value later if the application changes. You can enter a text, rectangle, number, Boolean, or URL value. You can use repository variables in expected values so QA Wizard Pro can locate dynamic windows and controls when an application changes. For example, you can replace a URL with the URLROOT repository variable. To use a repository variable in the value, select it from the list and click Insert. The variable is replaced with the variable value used during playback. See Creating repository variables, page 215.

Tip: To enter a repository variable in the Expected value field, add percent signs to the beginning and end of the variable name. For example, %urlroot%.

5. Click OK add the property. Make sure the property is selected on the Search Method tab in the Properties dialog box to use it as search criteria when recording or running scripts.

141 Deleting properties from user-added windows and controls

Deleting properties from user-added windows and controls You can delete properties from user-added windows and controls if they are not needed. For example, if a control was duplicated from another control, you can delete the properties not used as search criteria to make the controls unique in the application repository. You should not need to delete properties from user-added controls often.

Note: You cannot delete properties from windows and controls added to the repository by QA Wizard Pro.

1. Click Delete Property on the Search Method or Properties tab in the Properties dialog box when you are adding or editing a user-added window or control. 2. Click Yes to confirm the deletion. The property is deleted. 3. Click OK to save the changes.

Duplicating windows and controls If you need to add a window or control that is similar to an existing window or control in the repository, save time by duplicating the existing control and then editing the properties in the new control. For example, if QA Wizard Pro cannot distinguish between two similar buttons on a web page during recording and adds them to the repository as one control instead of two, you can duplicate the captured button control and then update the properties for each control to uniquely identify them instead of recording again.

Note: For best results, record scripts or populate repositories to capture window and controls information whenever possible. Only manually add windows or controls if you are familiar with how QA Wizard Pro uses properties and expected property values to locate controls during playback. See Modifying window and control properties, page 122.

1. Select the application version in the Application Repository pane and choose Repository > Modify Version Windows and Controls. The Modify Windows and Controls dialog box opens. 2. Select the window or control to duplicate and click Duplicate. If you are duplicating a window, you are prompted to duplicate the child controls in the selected window. Click Yes to duplicate the window and child controls or click No to duplicate the window only. The window or control is duplicated and a number is appended to the name. is displayed on the control type icon to indicate it is a user-added window or control.

142 Editing and deleting user-added windows and controls

Tip: To move a user-added control to group it with a different window, drag it to the correct window.

3. Modify the window or control. See Editing and deleting user-added windows and controls, page 143. 4. Click OK to save the changes. After the window or control is saved, you can add statements to scripts to perform actions on it. See Adding statements, page 146.

Editing and deleting user-added windows and controls Edit a user-added window or control to change the properties, such as the name, control type, search method and criteria, or smart matching setting. You can also delete windows or controls if they are no longer needed. 1. Select the application version in the Application Repository pane and choose Repository > Modify Version Windows and Controls. The Modify Windows and Controls dialog box opens. 2. Edit or delete the user-added window or control. on the control type icon indicates a user-added window or control.

n To edit a control, select it and click Properties. Make any changes and click OK. For information about control properties, see Manually adding windows and controls to application repositories, page 138.

n To delete a window or control, select it and click Delete. If you delete a window, all child controls in it are also deleted. Click Yes to confirm the deletion. 3. Click OK to save the changes.

Note: If you renamed a window or control, scripts created before the change will not work until you update them. See Synchronizing with the application repository, page 143.

Synchronizing with the application repository When you rename a window or control, any scripts recorded before the change will fail. You must update the name in scripts. Synchronization allows you to quickly update scripts with the application repository, instead of spending time searching through scripts to look for changed names. 1. Open the script you want to update. 2. Choose Script > Synchronize with Application Repository. You are prompted to confirm the update. 3. Click Yes. QA Wizard Pro looks for window and control name differences between the script and repository. If differences are found, the script is updated with the new names. A results dialog box that includes the number of references updated in the script opens. 4. Click OK to close the results dialog box.

Note: To update more than one script, select the scripts in the Workspace pane and choose Script > Synchronize Multiple with Application Repository. See Synchronizing multiple scripts with the application repository, page 144.

143 Synchronizing multiple scripts with the application repository

Synchronizing multiple scripts with the application repository When you rename a window or control, any scripts recorded before the window or control was renamed will fail. You must synchronize the scripts with the application repository to update the old window and control names. 1. Select the scripts to update in the Workspace pane. 2. Choose Script > Synchronize Multiple with Application Repository. The Select File dialog box opens. 3. To select multiple scripts, Ctrl+click each script you want to update. 4. Click Open. QA Wizard Pro looks for window and control name differences between the script and repository. If differences are found, the scripts are updated with the new names. A results dialog box that includes the number of references updated in each script opens. 5. Click OK to close the results dialog box.

Testing context menus QA Wizard Pro can perform actions on context (shortcut) menu items. Testing context menus requires the ContextMenu object in a script statement with the X and Y coordinates, relative to a window or control, for where to open the menu. After you specify where the context menu should be opened, you can enter a context menu item to test and an object action statement, such as Click or Select, or a low-level action statement, such as mouse movement statements, to perform on the item. You can also create checkpoints for context menus. The following example shows a statement that selects a context menu item. Window("CRM").Tree("treeProducts").Item("Solutions/Design/WysiOrganize").ContextMenu(110, 12).Item("Add/Category").Select()

Note: To specify a context menu item by index, enclose the index number in square brackets ([]). For example, Window("CRM").ContextMenu(150, 20).Item("Reports/[4]").Select().

144 Modifying Scripts

Recorded scripts provide a baseline for application testing. After recording, you can create more flexible and complex scripts by adding statements, calling other scripts, creating checkpoints, and using data sources for input data. You can modify scripts in Keyword View and Text View. Text View provides greater flexibility and allows you to add advanced logic to scripts that is not available in Keyword View. See Using Text View, page 28.

Statements Each action performed during recording is added to the script as a statement. You can add additional statements to control how a script runs or return values to variables that can be passed to other statements. See Adding statements, page 146. See Statements, page 321 for a list of available statements.

Called scripts Keep scripts simple, modular, and focused on performing a specific task. After you create scripts to perform different tasks, you can use the CallScript statement to combine them and create more complex scripts that perform multiple tasks as the same time. When a script is called, QA Wizard Pro runs it to completion and then returns to the script that called it to continue playback. See Calling scripts from other scripts, page 151.

Checkpoints Use checkpoints to verify that the value of a property in an application window or control matches an expected value during playback. If the actual value in the tested application and the expected value do not match, the script fails. See Using Checkpoints, page 165.

Data-driven scripts Create data-driven scripts to use data from other sources to test a different set of data each time a script runs. During playback, QA Wizard Pro reads input values from a local or external datasheet. See Creating Data- Driven Scripts, page 187.

Other script modification tasks As you become more familiar with how scripts work, you can perform the following tasks to work with and manage them. n Clean up scripts to delete unnecessary steps or outline blocks of related steps. n Find variable, function, and subroutine references and definitions to determine the impact of a change. n Comment blocks of steps to prevent a group of statements from running. n Handle known exceptions and errors to prevent scripts from failing. n Identify files and directories to perform actions on and return values from in statements. n Find and replace text in scripts. n Encrypt text to conceal text entered in fields during playback.

145 Adding statements

n Modify script properties to rename a script or associate a datasheet with it. n Use drag-and-drop scripting to quickly modify script steps.

Adding statements Statements are instructions that specify how QA Wizard Pro interacts with the tested application. Functions are statements that return a value to a variable that can be passed to other statements. Some statements are automatically added during recording, but you can manually add other statements to create more powerful and flexible scripts. 1. Select the script line above where to add the statement.

n If you are adding a conditional or loop statement, select the steps to include in the statement before adding it.

n In Text View, you can add the statement and then copy and paste the steps to include in the statement block between the starting and ending statements. 2. Choose Script > Add Statement. The Add Statement dialog box opens.

Tip: You can drag a statement from the Statements pane or controls from the Preview pane and Application Repository pane to open the Add Statement dialog box with the item selected.

3. Select the statement to add. See Statements, page 321. To exclude statements from the list, select a statement Category. You can also enter the first few letters of the statement name in the Filter field to display matching statements. 4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Enter the statement information. Required fields are indicated with . For some fields, you can indicate how to interpret the value you enter. You can use text, values, constants, datasheet values, script and repository variables, or functions depending on the field type. See Statement value types, page 147.

Note: Screenshots are displayed when you add some statements. The screenshot is updated when you select the window and control to perform the statement on. Use the zoom buttons to zoom in, zoom out, or display the screenshot at actual size. Select Auto Fit to display the entire screenshot.

6. If you are adding a function, select an optional Output variable to assign the return value to. The list includes script variables declared before the current line and repository variables for the application. To create a new variable, enter a variable name. 7. Enter an optional Comment, such as the purpose of the statement. 8. Click OK to add the statement to the script.

146 Statement value types

Statement value types Statement input fields support a variety of value types. A default value type is selected for each field, but you can change the value type. This can help you create more dynamic statements that use values from variables or datasheets, or values returned by calculations or functions. To use a different value type, click the button and select a type from the list.

Value type Description Field types

Text Interprets the entered value as a literal string. Strings, file paths

Value Interprets the entered value as a variable or math expression. Integer, float

Constant Uses a QA Wizard Pro constant selected from a drop-down list. QA Wizard Pro constant (e.g., control property name, True/False)

Key Input Uses keyboard input. Key input for KeyPress, KeyDown, and KeyUp statements

Expression Interprets the entered value as a variable or math expression. All input fields The returned value is used as the input value.

Datasheet Uses a value in the current row of the associated datasheet All input fields based on the selected column.

147 Using function results as statement arguments

Value type Description Field types

Variable Uses a selected script variable or repository variable defined for All input fields the application.

Function Uses the value returned from a function. Click Edit in the All input fields corresponding field to add a function. See Using function results as statement arguments, page 148.

Using function results as statement arguments You can use a value returned by a function as an argument value in statements. For example, you can parse a string and use the return value as the expected value in a Checkpoint statement. 1. In the Add or Edit Statement dialog box, select Function in the field to use a function in.

2. Click Edit. The Add Function dialog box opens. 3. Select the function to add. 4. Enter the function arguments. Required fields are marked with an exclamation point. For some arguments, you can indicate how to interpret the value you enter. You can use text, values, constants, datasheet values, script and repository variables, or functions depending on the field type. See Statement value types, page 147.

Note: Some functions allow you to add additional arguments. Click Add Argument to add an Argument field and then enter the argument. To remove an argument, click Remove Argument next to the argument field.

5. Click OK. The function is added.

148 Adding browser actions

Adding browser actions When you record a script against a web application, QA Wizard Pro adds a Browser object to the application repository and captures the browser controls, such as toolbar buttons. You can add actions to perform on the browser and specify the window to work with if the script opens multiple browsers.

QA Wizard Pro can perform browser navigation actions, including browsing back and forward, refreshing a page, and adding, selecting, and closing tabs. Object actions, window actions, mouse actions, checkpoints, and some web statements are also available for browsers. When you add a browser action, the Browser object is used instead of the Window object. For example, the statement for navigating back in a browser window is Browser().Button("Back").Click() instead of Window("Browser").Button("Back").Click().

Note: The following information only applies to adding actions to perform actions on browser windows, not to web pages displayed in browsers.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select a statement from the Web Browser Actions category. See Web browser action statements, page 350.

149 Cleaning up scripts

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select a web page from the Browser Containing Page list to specify the window to perform the action on. is selected by default. If this option is selected and the script opens multiple browser windows during playback, the action is performed on the last used window. 6. Enter or select any additional statement information. 7. Enter an optional Comment, such as the purpose of the statement. 8. Click OK to add the statement to the script.

Cleaning up scripts After you record scripts, you may want to clean up the steps by deleting unnecessary steps or outlining blocks of steps to group them.

Deleting unnecessary steps Because QA Wizard Pro records every action you perform, you may end up with extra script steps you do not need. For example, you may press Tab to move to a field and then enter information. QA Wizard Pro records moving to a field and typing in that field as two separate steps. Scripts only require steps that perform an action, such as entering a value or submitting data. Generally, you do not need steps that select or move to another field.

Tip: To minimize the amount of clean up, select a field with the mouse instead of tabbing to it during recording.

Can be deleted n KeyDown (Tab, Enter, etc.) n KeyUp (Tab, Enter, etc.) n KeyPress

Can be deleted based on the situation n Mouse click

Outlining steps You can combine, or outline, blocks of steps to improve script organization and readability. These blocks can be expanded or collapsed. When a block is collapsed, only the first line is displayed. QA Wizard Pro automatically outlines low-level actions. You can outline other blocks of steps in Text View and Keyword View.

150 Editing statements

n Text View—Enter a pound sign (#) on an empty line directly above the first script step you want to include in the block of steps. Enter a pound sign on an empty line directly below the last script step you want to include in the block. n Keyword View—Ctrl+click the steps you want to include in the block. Choose Script > Add Statement, select the Outline Block statement from the Comment category, and click OK.

Tip: To help with organization, make the first line a comment about the block of steps. Only the first line is displayed in a collapsed, outlined block.

Editing statements You can edit a statement to change its arguments. 1. Select the step that contains the statement you want to edit and choose Script > Edit Statement.

Tip: You can also edit arguments in Keyword View by clicking an Information cell.

2. Make any changes. 3. Click OK to save the changes.

Deleting statements 1. Select the script step that includes the statement you want to delete. 2. Choose Edit > Delete. The statement is deleted.

Note: You cannot delete statements in Keyword View that cause a script to become invalid. Switch to Text View to delete the statement.

Calling scripts from other scripts Calling scripts lets you share common actions between scripts and eliminate the need to re-create tests when an application changes. As a best practice, try to create simple, modular scripts that focus on performing a specific task. After you create scripts to perform different tasks, you can use the Script.CallScript statement to combine them and create more complex scripts that perform multiple tasks at the same time. See Script.CallScript, page 528. For example, if you are testing a web application that requires logging in, you can create a login script that can be called from other scripts in the workspace. When the login script is called, QA Wizard Pro runs it to completion and then returns to the script that called it to continue playback. If errors occur during login or the login process changes in the application, you only have to update the login script instead of all scripts that use the same steps. The following example shows a script with the Script.CallScript statement that calls another script named Login.

151 Calling scripts from other scripts

Note: You can call standard QA Wizard Pro scripts from load test scripts and vice versa. If a load test script is called from a standard script, the load test script runs normally but with only one user.

You can also use functions, subroutines, and variables defined in called scripts without redefining them in multiple scripts. See Calling functions and subroutines from another script, page 33 and Calling script variables from another script, page 31. 1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select the Script Call Script statement from the Script Control category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Script name to call. 6. If the script uses an associated datasheet to perform data-driven actions, select Constant from the value list in the Optional datasheet name field and select the datasheet. Data sources associated with called scripts are ignored unless you specify a datasheet for them in the Script.CallScript statement. If a datasheet is specified, the called script runs once for each row in it. If a datasheet is not specified, the called script only runs once, but has access to the variables and data source associated with the calling script and any statements declared before the Script.CallScript statement. 7. Click OK to add the statement to the script.

152 Finding variable, function, and subroutine references in scripts

Tip: You can also drag a script from the Workspace pane to the open script to automatically add a Script.CallScript statement.

Finding variable, function, and subroutine references in scripts You can find all places where variables, functions, and subroutines are referenced in scripts in the open workspace. When you are modifying or debugging scripts, you can use this information to determine the impact of a change before updating a variable, function, or subroutine name or definition. The search results only include where a variable, function, or subroutine is declared and called in scripts. References in commented script lines and values that do not refer to the selected variable, function, or subroutine, such as text in statement arguments, are not included.

Tip: To quickly find where a user-defined variable, function, or subroutine is declared, select it and choose Script > Go To Definition. See Finding variable, function, and subroutine definitions in scripts, page 153.

1. Select the variable, function, or subroutine in a script and choose Script > Find All References. The number of references found in the workspace is displayed in the References pane. Each result shows the script name, line number, and text with the reference underlined.

2. Double-click a reference to open the script. The script opens and the line with the reference is selected.

Note: You can work with the results in the References pane until you perform another search or close QA Wizard Pro.

Finding variable, function, and subroutine definitions in scripts QA Wizard Pro provides different ways to find where user-defined variables, functions, and subroutines are declared in scripts. This can help you reference the definitions when modifying scripts and understand how these statements are used in complex scripts.

Tip: To find all places where a variable, function, or subroutine is called in the workspace, select it in a script and choose Find All References. See Finding variable, function, and subroutine references in scripts, page 153.

153 Commenting blocks of steps

Using the Definition field in the Script pane Use the Definition field in the Script pane to see a list of all user-defined variables, functions, and subroutines in the open script. Refer to this list when setting values in statements to make sure the correct variable, function, and subroutine names are used consistently. You can also quickly find functions and subroutines that cause errors when debugging scripts. Select a variable, function, or subroutine in the Definition field to go to the line where it is defined. The definition is highlighted in the script.

Note: If you are editing a statement inside a function or subroutine, the function or subroutine name is displayed in the Definition field for context and to help indicate that any changes may affect other parts of the script or called scripts.

Going directly to definitions To go to the script line where a user-defined variable, function, or subroutine is declared, click a line that contains it and choose Script > Go To Definition. This helps you quickly find definitions in more specific contexts, such as when variables are defined inside functions or subroutines. You can also use this option to find definitions in called scripts without opening other scripts first or manually searching script lines.

Tip: To navigate back and forward through scripts as you find definitions, click the Go Back and Go Forward toolbar buttons or choose Script > Go Back or Go Forward. This helps you easily return to the location you were working in if you move between multiple scripts.

Commenting blocks of steps You can comment blocks of steps, instead of commenting each script step. This allows you to quickly comment out sections of scripts, which is useful if you want to include multiple test scenarios in one script. 1. Select the statements you want to comment in Keyword View or Text View. Click and drag to select a continuous range of statements. In Keyword View, you can also Ctrl+click statements to select them. 2. Right-click and choose Comment Block.

154 Handling known exceptions

The selected steps are commented. 3. To uncomment a block of steps, select the statements. Right-click and choose Uncomment Block.

Note: You can also add a comment to a single step. See Rem, page 516.

Handling known exceptions Exceptions are known events in an application that interrupt its expected operation. For example, an application may display an error dialog box if a user does not enter a username or password. If the error is displayed during playback, the script fails unless it contains steps to handle this behavior. To handle exceptions, record a script that captures the exception. Add the WaitForExists statement to the script to determine if the exception occurs and use conditional statements to indicate how to handle the exceptions you want to ignore. See WaitForExists, page 567 and Conditional statements, page 325. In the following example, the login button is clicked before any user credentials are entered and an error dialog box is displayed. The WaitForExists statement is used to determine if the error is displayed and assigns true or false to the LoginError variable based on the result. The If statement is used to instruct QA Wizard Pro to click the OK button in the error dialog box if the LoginError variable value is true and continue playback with the next script step. Window("ACME Bank").Button("Login").Click() LoginError = Window("EnterUsernamePassword").WaitForExists(5000) If LoginError = "True" Then Window("EnterUsernamePassword").Button("OK").Click() End If Window("ACME Bank").EditBox("editbox1").SetText("Guest") Window("ACME Bank").EditBox("editbox2").SetText("SoloBug") Window("ACME Bank").Button("Login").Click()

Handling script errors QA Wizard Pro provides two ways to handle errors that occur when running scripts: n Use inline error handling to continue running scripts after errors occur. You can use the On Error Resume Next statement and Err object to collect error information during playback. See On Error, page 504. n Use structured error handling to identify a block of statements that can raise errors under specific conditions to avoid script failure. You can use the Try...Catch...Finally statements can be used to provide additional statements for handling errors. See Try...Catch...Finally, page 565. You can use inline and structured error handling together, but typically you only use one method per script. Consider using structured error handling in scripts that require advanced error responses. The Finally statement can be used to perform script maintenance whether or not errors are encountered. The following example shows structured error handling used to add information to an output file, perform various checkpoints, and indicate the end of the output log. The Try...Catch...Finally statements allow the errors to be logged while ensuring the output log is correct and complete. AppendToFile("C:\\Testing\\Output.txt", "Starting checks") Try Window("Login").Button("btnLogin").Checkpoint("Text", "Login", True, "Login button text is incorrect")

155 Identifying files and directories in statements

Window("Login").Button("btnCancel").Checkpoint("Text", "Cancel", True, "Cancel button text is incorrect") Window("Login").Button("btnHelp").Checkpoint("Text", "Help", True, "Help button text is incorrect") AppendToFile("C:\\Testing\\Output.txt", "All checks complete") Catch AppendToFile("C:\\Testing\\Output.txt", "Checkpoint failure: " + Err.Description()) Finally AppendToFile("C:\\Testing\\Output.txt", "Finished checks") End Try Consider using inline error handling if you have a script that calls other scripts and you want playback to continue even if errors are encountered in the called scripts. The following example shows a controller script that launches several other scripts. The On Error Resume Next statement ensures each script runs even if one or more of the called scripts fails. On Error Resume Next Script.CallScript("MenuCheck") Script.CallScript("LoginChecks") Script.CallScript("ShoppingcartChecks") Script.CallScript("OrderStatusChecks") On Error Goto 0

Identifying files and directories in statements You can use file statements to perform actions on and return values from files and directories. See File statements, page 329. For best results, use full paths in these statements to identify the exact files and directories to interact with. If you use relative paths, an incorrect file or directory could be used during playback if files or directories with the same names are stored in different locations QA Wizard Pro searches. See Using relative paths, page 156. To create a full path relative to a directory, use the CombinePaths statement in scripts. This statement uses the returned workspace or script directory and combines it with a filename or directory path to create a full path, which you can then use in other statements. Using this method to define full paths helps ensure correct files and directories are located when scripts run on different computers where directory paths are likely different. The following example creates a full path to a file in the directory that stores the open workspace or batch file the script is in. fullFilePathInWorkspaceDir = CombinePaths(GetDirectory(QAWWorkspace), "Filename.extension") The following example creates a full path to a file in the directory the script is in. fullFilePathInScriptDir = CombinePaths(GetDirectory(QAWScript), "Filename.extension")

Using relative paths While less specific, you can also use relative paths to identify input and output files or directories in statements.

156 Finding and replacing text in scripts

n Input files and directories are existing files and directories with information used in statements. These files and directories must exist in a location QA Wizard Pro searches to provide correct information when scripts run. For example, if you use the CompareFileContents statement to compare files, both files must exist and be stored in a location QA Wizard Pro searches to compare the contents. n Output files and directories exist as the result of actions performed by statements. If they do not exist, they are created when scripts run. For example, if you use the AppendToFile statement to add text to a file, QA Wizard Pro can create the file if it does not exist and then add the text. To locate files and directories identified by relative paths in scripts, QA Wizard Pro searches using the following methods when scripts run.

If a relative path These locations are searched in the following If the file or directory is references an: order: not found:

Input file 1. Workspace or batch file An error occurs 2. Directory that stores the open workspace or batch file the script is in 3. Directory the script is in

Output file 1. Workspace or batch file The file is created 2. Directory that stores the open workspace or batch file the script is in

Input directory 1. Directory that stores the open workspace or An error occurs batch file the script is in 2. Directory the script is in

Output directory Directory that stores the open workspace or batch The directory is created file the script is in

Finding and replacing text in scripts You can search for and replace text in individual open scripts, multiple open scripts, or all scripts in a workspace. For example, to change a product name in statements and comments, you can search for the text string and replace it in an individual script or in all scripts that include it. n To find or replace text in one script, open it and choose Edit > Find or Edit > Replace. See Finding and replacing text in individual scripts, page 158. n To find text in multiple scripts, choose Edit > Find in Workspace. See Finding text in multiple scripts, page 159. n To replace text in multiple scripts, choose Edit > Replace in Workspace. See Replacing text in multiple scripts, page 160.

Tip: To find all references to a variable, function, or subroutine in the workspace, select it in a script and choose Script > Find All References. See Finding variable, function, and subroutine references in scripts, page 153.

157 Finding and replacing text in individual scripts

Finding and replacing text in individual scripts You can search for and replace text in a script. For example, if you change a variable name, you can find and replace references to the variable in the script.

Note: You can also search for text in multiple scripts. See Finding and replacing text in scripts, page 157.

1. Open the script to search. 2. To search the entire script, choose Edit > Find or Edit > Replace. To only search in a specific section, select the script steps and choose Edit > Find or Edit > Replace. The Find and Replace dialog box opens. The selected tab depends on if you chose to find or replace text.

3. Enter the text to search for in the Find what field. You can enter a text string or use a regular expression for a more flexible search. 4. Enter the text to replace the returned text with in the Replace with field.

Note: You can use a regular expression in the Find what or Replace with fields. Expand the Find Options and select Use regular expressions. Click next to text fields to view regular expression characters.

5. Select an option from the Look in list to indicate where to search in the script.

n From cursor searches down from the current cursor location and then returns to the top of the script.

n Entire scope searches the entire script, starting from the top.

n Selection only searches only the selected text. 6. Select any Find Options.

158 Finding text in multiple scripts

n Match case searches for text that matches the case of characters in the search text.

n Match whole word searches for text that matches the search text exactly. For example, 'click' does not find 'clicks' or 'double-click'.

n Search hidden text searches for text in collapsed blocks of script steps.

n Search up searches from the current cursor location up to the beginning of the script.

n Use regular expressions searches for a text pattern that matches the regular expression in the Find what field.

n Prompt on replace prompts you to confirm before replacing text. 7. Click Find Next to search for more occurrences of the text. 8. Click Replace to replace the selected text. 9. Click Replace All to replace all occurrences of the text.

Finding text in multiple scripts You can search for text in multiple open scripts or all scripts in a workspace.

Note: To replace text in multiple scripts or the workspace, see Replacing text in multiple scripts, page 160.

1. Choose Edit > Find in Workspace. The Find and Replace in Workspace dialog box opens.

2. Enter the text to search for in the Find what field. You can enter a text string or use a regular expression for a more flexible search. 3. Select an option from the Look in list. You can search all scripts in the workspace or all open scripts in the Scripts pane. You can also search the current script, which only finds text in the script displayed in the Scripts pane. 4. Select any Find Options.

159 Replacing text in multiple scripts

n Match case searches for text that matches the case of characters in the search text.

n Match whole word searches for text that matches the search text exactly. For example, 'click' does not find 'clicks' or 'double-click'.

n Use regular expressions searches for a text pattern that matches the regular expression in the Find what field. 5. Click Find All. The number of results found in the workspace is displayed in Find Results pane. Each result shows the script name, line number, and text with the text you searched for underlined.

6. Double-click a result to view the text in the script.

Replacing text in multiple scripts You can replace text in multiple open scripts or all scripts in a workspace. For example, if a control name changes in the application repository, you can update all scripts that interact with the control at the same time.

1. Choose Edit > Replace in Workspace.

The Find and Replace in Workspace dialog box opens.

2. Enter the text to search for in the Find what field. You can enter a text string or use a regular expression for a more flexible search. 3. Enter the text to replace the returned text with in the Replace with field.

160 Replacing text in multiple scripts

4. Select an option from the Look in list. You can search all scripts in the workspace or all open scripts in the Scripts pane. You can also search the current script, which only finds text in the script displayed in the Scripts pane. 5. Select any Find Options.

n Match case searches for text that matches the case of characters in the search text.

n Match whole word searches for text that matches the search text exactly. For example, 'click' does not find 'clicks' or 'double-click'.

n Use regular expressions searches for a text pattern that matches the regular expression in the Find what field. 6. Click Replace All. The Replace All Preview dialog box opens.

7. Expand a script to preview the text replacement. Click Expand All to expand all scripts or Collapse All to collapse expanded scripts.

n To exclude text from the replacement and leave it as is, clear the check box next to the script line.

n To exclude all changes to a script from the replacement, clear the check box next to the script name.

n Click Select All to select all scripts and lines or click Select None to clear the selection. 8. Click Apply to replace the text. You are prompted to confirm the changes. 9. Click Yes. The text is replaced in the scripts.

n If updated scripts are not open in the Scripts pane, the changes are automatically saved.

n If updated scripts are open in the Scripts pane, choose File > Save or File > Save All to save the changes.

161 Encrypting text

Encrypting text You can encrypt text strings to make the text unreadable. Text encryption conceals the actual text entered in fields, such as passwords. Passwords are automatically encrypted during recording, but you can re-encrypt values that have been modified to plain text.

Note: Encrypted text is not secure. Do not use sensitive or confidential test data in scripts.

1. Choose Tools > Text Encryption. The Text Encryption dialog box opens.

2. Enter the Original text. The encrypted text is automatically generated. 3. Click Copy. The encrypted text is copied to the clipboard. 4. Click Close when you finish. 5. Select the text to replace in the script and paste the encrypted text.

Note: You can also use the EncryptString statement to encrypt text. See EncryptString, page 394.

Working with text in HTML elements Text in HTML elements is not captured and saved in the application repository during recording because it is not a property of a window or control. To perform actions based on text on a web page or verify that the text is correct, you can add HTMLFindByID, page 450 and HTMLFindByTag, page 451 statements that examine HTML code and return text to scripts.

HTMLFindByID The HTMLFindByID statement returns a string that contains the inner text of the tag with the specified HTML element ID. The following example uses this statement to return the ticket number from a confirmation web page. htmlText = Window("Thank You").ExtractHTMLToString() ticketNum = HTMLFindByID(htmlText, "ticket") If ticketNum = "" Then

162 Modifying script properties

Fail("Cannot find ticket number") Else PrintLn("Ticket number: " & ticketNum) End If n The htmlText variable is declared. The variable value is the HTML returned from the Thank You page using the ExtractHTMLToString statement. n The ticketNum variable is declared. The variable value is the string returned by the HTMLFindByID statement, which examines the HTML returned to the htmlText variable and returns the text with the "ticket" element ID. For example, the following HTML shows the ticket element ID and value: W72236 n The If statement fails the script if no text is returned by the HTMLFindByID statement. If text is returned, "Ticket number:" followed by the ticket number is printed in the Output pane.

HTMLFindByTag The HTMLFindByTag statement returns an array of strings that contains the inner text from the HTML element with the specified tag. The following example uses this statement to return the text starting at an index of the tags in a list. htmlText = Window("Customers List").ExtractHTMLToString() tag = HTMLFindByTag(htmlText, "p") If Left(tag(2), 9) <> "CustomerB" Then Fail("Could not find the customer") Else PrintLn("The customer is " & tag(2)) End If n The htmlText variable is declared. The variable value is the HTML returned from the Customers List page using the ExtractHTMLToString statement. n The tag variable is declared. The variable value is an array of strings returned by the HTMLFindByTag statement, which examines the HTML in the htmlText variable and returns the text within all of the tags. For example, if the page contains three tags, the array contains three strings. Each string is accessed using the array index (1, 2, or 3). n The If statement fails the script if the characters returned by the Left statement are not equal to "CustomerB". The Left statement returns the first 9 characters of the string stored as index 2 of the array in the tag variable. If "CustomerB" is returned, "The customer is" followed by the value of array index 2 is printed in the Output pane.

Modifying script properties You can modify properties to rename a script or associate a datasheet with the script. As you add scripts and make changes to existing ones, you may find that a script name is no longer clear or does not accurately describe its purpose. 1. Select a script. 2. Choose File > Properties. The Properties dialog box opens.

163 About drag-and-drop scripting

3. Enter a new script Name. 4. Click OK to save the changes.

About drag-and-drop scripting You can drag elements from different QA Wizard Pro panes directly into the Script pane to more quickly create and modify scripts. Following are examples of elements you can drag and drop: n Controls from the Application Repository and Preview panes to add statements to scripts. This opens the Add Statement dialog box with the control pre-selected if parameters need to be set. Controls can also be dropped into the Statements pane to generate statements in an active script. See Modifying Scripts, page 145. n Application versions from the Application Repository pane to add a SetContext statement to a script. See Script.SetContext, page 534. If the script already contains a context, a ClearContext statement is added before the new context statement. See Script.ClearContext, page 529. n Scripts onto other scripts to create CallScript statements. See Script.CallScript, page 528. n Statements from the Statements pane. This opens the Add Statement dialog box with the statement pre- selected. Statements can also be dropped into the Application Repository or Preview panes to add statements to an active script. Statements can only be dropped onto controls that can perform the action. See Statements, page 321. n Datasheets onto scripts to assign data sources. See Creating Data-Driven Scripts, page 187. n Lines in Keyword View to rearrange a script's steps. You can Ctrl+click to select multiple lines to drag at the same time. Blocks of steps, such as If statements, are dragged as a single unit.

164 Using Checkpoints

Checkpoints help you verify the tested application is working as expected. Checkpoints verify that attributes of an application exist or are correct when compared to an expected value during playback. For example, a checkpoint can verify that a drop-down list includes the correct number of values. If the property or image you are verifying does not exist or match the expected value or image during playback, the checkpoint fails. You can configure the failure behavior to stop or continue playback and display an error or warning in the Errors pane. You can create window, control, and exists checkpoints during or after recording. Image and OCR checkpoints can only be created after recording. See Checkpoint types, page 165 for additional information and examples.

Note: You can also use checkpoints to verify if expressions are true and substrings are part of text strings.

Checkpoint types QA Wizard Pro includes the following types of checkpoints.

Type Use to: More information

Window Verify the property values of application windows against an expected Creating value. For example, you can verify a window is maximized or has focus. checkpoints, page 169

Control Verify the property values of application controls against an expected value. Creating For example, you can verify a control contains specific text, has focus, or checkpoints, that some controls contain a specific number of items. page 169

Exists Check if windows or controls exist in the application. For example, you can Creating verify that a contact form contains a Submit button. exists checkpoints, page 171

Expression Verify that an expression evaluates to True. For example, you can verify a Creating variable value is less than a specified limit or that values returned by two expression variables are different. checkpoints, page 176

Image Verify an image in the application against an expected image. For example, Creating you can verify an image contains the correct colors or is displayed in the image correct location. checkpoints, page 173

165 Creating record-time checkpoints

Type Use to: More information

Optical Verify graphical text in images, controls QA Wizard Pro cannot recognize, Creating Character or a region in a window or control against an expected value. For example, OCR Recognition you can verify text in web pages and images, such as charts and graphs. checkpoints, (OCR) page 183

String Check that a text substring exists or does not exist in another text string. Creating Exists For example, you can check for keywords in a label or verify data returned string exists from a URL in a load test script. checkpoints, page 177

Creating record-time checkpoints You can create checkpoints when recording a script or add them after recording. It is generally easiest to create checkpoints during recording. As you follow the steps in a test case and perform actions for QA Wizard Pro to record, click the Checkpoint button on the Recording toolbar to quickly create a checkpoint.

Tip: To add a checkpoint that uses an expression, datasheet value, variable, or function, create the checkpoint when recording a script and then edit the checkpoint statement after recording. See Editing checkpoints, page 171.

1. Click the Checkpoint Recording toolbar button when recording a script.

QA Wizard Pro switches to checkpoint mode. In this mode, the selected window or control is outlined with a red box. 2. Click the window or control to create the checkpoint for. The Add Statement dialog box opens with the Checkpoint statement selected.

166 Creating record-time checkpoints

Tip: Right-click a window or control to display a list of available controls to check. As you mouse over a control, it is outlined with a red box. Click the control in the list to create the checkpoint on it. This method is helpful for checking items in tables or nested controls that are not visible or easy to select.

3. Select the Property to check. The Expected Value is automatically populated with the value in the Current Value column. 4. Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. 5. Select the Failure Behavior.

n Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report.

n Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report. 6. Enter an optional Comment, such as the purpose of the statement. 7. Click OK to add the statement to the script. 8. When you finish adding checkpoints, click the Checkpoint Recording toolbar button to exit checkpoint mode and continue recording.

167 Creating record-time check exists checkpoints

Creating record-time check exists checkpoints During recording, you can create exists checkpoints that verify that a specific window or control exists in the application. For example, you verify that a contact form on your web site contains a Submit button. 1. Click the Checkpoint Recording toolbar button when recording a script.

QA Wizard Pro switches to checkpoint mode. In this mode, the selected window or control is outlined with a red box. 2. Click the window or control to create the checkpoint for. The Add Statement dialog box opens with the Checkpoint statement selected. 3. Select Check Exists to create a checkpoint for the selected window or control.

4. Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. 5. Select the Failure Behavior.

n Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report.

n Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report. 6. Enter an optional Comment, such as the purpose of the statement. 7. Click OK to add the statement to the script. 8. When you finish adding checkpoints, click the Checkpoint Recording toolbar button to exit checkpoint mode and continue recording.

168 Creating checkpoints

Note: When the script runs, QA Wizard Pro waits for up to 30 seconds for the window or control to appear. The checkpoint fails if QA Wizard Pro cannot verify that the window or control exists.

Creating checkpoints Checkpoints verify that the value of a property in an application window or control matches an expected value. During recording, QA Wizard Pro captures properties of windows and controls in the application. These properties are saved in the application repository and used during playback to locate objects. If the script interacts with a window or control and the value of one of the properties used as search criteria changes, the script fails. If a property that is not used as search criteria changes, the script continues. You can use checkpoints to check any window or control property, even if it is used as search criteria, and fail the script if the expected and actual values do not match. The available properties vary based on the type of control. Checkpoints can help you verify both the tested application's user interface and its internal structure. For example, you can check that a window includes the correct buttons on the title bar or check a text field to make sure that it is in the correct location relative to the parent window.

Note: If windows or controls are added to an application after recording the script, you may need to capture the new objects before you can create checkpoints for them. You can record a new script to capture the objects or populate the repository to add windows and controls without recording. See Populating repositories, page 60.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select Checkpoint in the Checkpoint category.

169 Creating checkpoints

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window to check. A screenshot of the selected window is displayed. 6. If you are creating a control checkpoint, select the Control to check. The selected control is outlined with a red box in the screenshot. 7. If you are creating a context menu item checkpoint, select Context Menu Item. See Testing context menus, page 144. 8. Select Item within to check items in a combo box, menu, list box, tab, or tree. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 9. Select the Property to check. The available properties change based on the selected window or control. You can use a constant (default), a text string, an expression, a datasheet column value, a variable, or a function that returns the value.

Note: If you need to create an HTML table checkpoint, see Creating HTML table checkpoints, page 240.

170 Editing checkpoints

10. Enter or select the Expected Value to compare against the actual value. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 11. Expand the Advanced options to indicate what happens if the checkpoint fails.

n Select the Failure Behavior. Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report. Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report.

n Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 12. Click OK to add the statement to the script.

Editing checkpoints You can modify a checkpoint to change the selected window, control, or properties and to change the expected value. 1. Select the step that contains the checkpoint you want to edit. 2. Choose Script > Edit Statement. The Edit Statement dialog box opens. 3. Make any changes. 4. Click OK to save the changes.

Creating exists checkpoints Exists checkpoints verify that a window or control exists in the application. The checkpoint fails if the window or control is not found during playback.

Note: If windows or controls are added to an application after the script is recorded, you may need to capture the new objects before you can create checkpoints for them. You can record a new script to capture the objects or populate the repository to add windows and controls without recording. See Populating repositories, page 60.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select Check Exists in the Checkpoint category.

171 Creating exists checkpoints

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window to check. A screenshot of the selected window is displayed. 6. If you are creating a control checkpoint, select the Control to check. The selected control is outlined with a red box in the screenshot. 7. Select Item within to check items in a combo box, menu, list box, tab, or tree. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 8. If you are creating a context menu item checkpoint, select Context Menu Item. See Testing context menus, page 144. 9. Expand the Advanced options to indicate what happens if the checkpoint fails.

n Select the Failure Behavior. Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report. Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report.

n Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 10. Enter an optional Comment, such as the purpose of the statement. 11. Click OK to add the statement to the script.

172 Creating image checkpoints

Creating image checkpoints Image checkpoints verify that an image in an application matches an expected image. For example, you can verify that a logo on a web page is in the correct location. Image checkpoints use a test area in the screenshot captured for the action performed in the previous statement as the expected image. If the test area in the application does not match the expected image within a minimum percentage of accuracy, the checkpoint fails. 1. Select the script line above where to add the statement. You must select a statement that performs an action in the application. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select Checkpoint Image in the Checkpoint category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534.

173 Creating image checkpoints

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Click the Actual screenshot and drag the red rectangle to select the area to check or enter the Test Area information to specify the area to verify. The Test Area fields are automatically populated based on the location and size of the rectangle relative to the actual screenshot captured from the previous statement.

n Left specifies the pixel location of the left side of the rectangle that contains the area to check.

n Top specifies the pixel location of the top side of the rectangle that contains the area to check.

n Width specifies the width of the rectangle that contains the area to check.

n Height specifies the height of the rectangle that contains the area to check.

Note: If the screenshot does not include the image you need to check, run the script before adding the checkpoint.

6. Click Save As Expected to save the actual image as the expected image to compare with the application during playback. The Save Image File As dialog box opens. 7. Choose a location to save the file in and enter a File name. 8. Click Save. The expected image is saved. 9. Enter the minimum percentage of Accuracy between the actual and expected image required to pass the checkpoint. The actual and expected images may not match exactly. For example, if the minimum percentage of accuracy is 80% and the accuracy calculated during playback is 85%, the checkpoint passes without requiring an exact match. The default accuracy is 100%.

Note: If you click Test before adding the statement, the actual and expected image always match because the expected image is the same as the image in the application repository. If a checkpoint fails during playback, you can edit it and click Test to compare the expected image against the actual image captured when the script ran. This can help you determine if changes are needed to the expected image or minimum accuracy percentage. See Editing image checkpoints, page 175.

10. Expand the Advanced options to indicate what happens if the checkpoint fails.

n Select the Failure Behavior. Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report. Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report.

n Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 11. Enter an optional Comment, such as the purpose of the statement. 12. Click OK to add the statement to the script.

174 Editing image checkpoints

Editing image checkpoints You can edit an image checkpoint to change the area to check, the expected image, or the accuracy percentage required for it to pass. 1. Select the step that contains the checkpoint to edit. 2. Choose Script > Edit Statement. The Edit Statement dialog box opens. 3. If the checkpoint failed, click Test to compare the actual and expected image. The Comparison Test Result dialog box opens. The percentage difference between the actual and expected images is displayed.

Note: If the difference percentage is within an acceptable range to pass the checkpoint, you may want to adjust the accuracy percentage in the Edit Statement dialog box. For example, if the minimum accuracy is 92% and the difference percentage during playback is 90%, the checkpoint fails.

4. Select Flicker from the Mode list to flash the differences in the expected image. This can help you identify subtle differences between the images. 5. Click OK to close the test dialog box. 6. Make any other changes to the checkpoint information. See Creating image checkpoints, page 173. 7. Click OK to save the changes.

175 Creating expression checkpoints

Creating expression checkpoints Expression checkpoints verify if a value returned by an expression is True. The checkpoint fails if the expression evaluates to False. 1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select Checkpoint Expression in the Checkpoint category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Enter the Expression to evaluate. You can also use a variable or a function that returns a value. 6. Expand the Advanced options to indicate what happens if the checkpoint fails.

n Select the Failure Behavior. Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report. Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report.

n Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 7. Enter an optional Comment, such as the purpose of the statement. 8. Click OK to add the statement to the script.

176 Creating string exists checkpoints

Creating string exists checkpoints String exists and does not exist checkpoints verify that a substring does or does not exist in a text string. String exists checkpoints fail if the substring is not found. String does not exist checkpoints fail if the substring is found.

Note: These are the only checkpoints you can add to load test scripts. They are typically used to verify data returned from WebGet and WebPost statements. See Load Testing, page 103.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select Checkpoint String Exists or Checkpoint String Not Exists in the Checkpoint category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Enter the Full string to search in. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 6. Enter the Substring to seek. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value.

Note: The search is case sensitive.

7. Enter an optional Comment, such as the purpose of the statement. 8. Click OK to add the statement to the script.

Deleting checkpoints 1. Select the step that contains the checkpoint you want to delete. 2. Choose Edit > Delete.

177 Checkpoint examples

The checkpoint is deleted.

Checkpoint examples The following examples show statements that verify properties of windows and controls. The properties you can use to create checkpoints vary based on the type of window or control you are checking.

Note: The examples show statements as you would enter them in Text View. You can also use the Add Statement dialog box to add these statements and view the resulting statement in Keyword View.

Verifying window properties In the following example, a checkpoint verifies a window is maximized. The Checkpoint statement verifies the value of the Window Is Maximized window property is True, which indicates the window is maximized. If the window is not maximized, the checkpoint fails, playback stops, and "The WysiCorp CRM window is not maximized" is displayed in the Errors pane. Window("WysiCorp CRM").Checkpoint("Window Is Maximized", True, True, "The WysiCorp CRM window is not maximized")

Verifying static text in a control In the following example, a checkpoint verifies text on a button. The Checkpoint statement verifies the Text property for the buttonConnect button in the WysiCorp CRMLogin window is Connect. If the button text is not Connect, the checkpoint fails, playback stops, and "The Connect button text is incorrect" is displayed in the Errors pane. Window("WysiCorp CRMLogin").Button("buttonConnect").Checkpoint("Text", "Connect", True, "The Connect button text is incorrect")

Verifying dynamic text in a control In the following example, a checkpoint verifies an HTML element matches the specified text string pattern. The text is a ticket number that changes every time a form is submitted. The Checkpoint statement verifies the Inner Text value for the Ticket HTML element control starts with a W. The @@ at the beginning of the value indicates to use a regular expression to check that the string starts with W. The .* indicates that the remaining characters can be any value. If the ticket number does not start with W, the checkpoint fails, playback stops, and "The ticket number does not begin with W" is displayed in the Errors pane. Window("WysiCorp Thank You").HTMLElement("Ticket").Checkpoint("Inner Text", "@@W.*", False, "The ticket number does not begin with W")

Verifying focus on a control In the following example, a checkpoint verifies a tab has focus, or is currently selected. The Checkpoint statement verifies the Focused property for the Accounts tab on the tabControl tab bar in the WysiCorp CRM window is True, which indicates the tab has focus. If the tab does not have focus, the checkpoint fails, playback stops, and "The Accounts tab does not have focus" is displayed in the Errors pane. Window("WysiCorp CRM").TabBar("tabControl").Tab("Accounts").Checkpoint("Focused", True, True, "The Accounts tab does not have focus")

Verifying the number of items in lists In the following example, a checkpoint verifies a combo box contains a specific number of items. The

178 Capturing and checking property values during playback

Checkpoint statement verifies Number of Items property for the projectNameComboBox control in the WysiCorp CRMLogin window is 5. If the list contains more or less than five items, the checkpoint fails, playback stops, and "The Projects list does not contain the correct number of items" is displayed in the Errors pane. Window("WysiCorp CRMLogin").ComboBox("projectNameComboBox").Checkpoint("Number of Items", 5, True, "The Projects list does not contain the correct number of items")

Verifying items in lists In the following example, a checkpoint verifies a combo box contains the correct values. The Checkpoint statement verifies the ListItems property for the projectNameComboBox control in the WysiCorp CRMLogin window contains the following items: WysiCorp and ACME Bank. If the list does not contain all of these items, the checkpoint fails, playback stops, and "The Projects list does not contain the correct values" is displayed in the Errors pane. Window("WysiCorp CRMLogin").ComboBox("projectNameComboBox").Checkpoint("ListItems", "WysiCorp,ACME Bank", True, "The Projects list does not contain the correct values")

Verifying enabled or disabled controls In the following example, a checkpoint verifies a button is disabled. The Checkpoint statement verifies the Enabled property for the buttonEdit button in the WysiCorp CRM window is False, which indicates the button is disabled. If the button is enabled, the checkpoint fails, playback stops, and "The Edit button is enabled, but an item is not selected" is displayed in the Errors pane. Window("WysiCorp CRM").Button("buttonEdit").Checkpoint("Enabled", False, True, "The Edit button is enabled, but an item is not selected")

Verifying a control exists In the following example, a checkpoint verifies a tab exists. The CheckExists statement verifies the Account tab in the tabControl tab bar in the WysiCorp CRM window exists. If the tab does not exist, the checkpoint fails, playback stops, and "The Accounts tab does not exist" is displayed in the Errors pane. Window("WysiCorp CRM").TabBar("tabControl").Tab("Accounts").CheckExists(True, "The Accounts tab does not exist")

Verifying properties match database values See the DatabaseCheckpoints sample workspace for examples of using checkpoints to verify property values against database records.

Capturing and checking property values during playback The Property statement, which performs actions similar to checkpoints, captures window and control property values from the application during playback. You can compare the returned value to an expected value. Use this statement instead of checkpoints when you want to continue running a script if the property value does not match an expected value or when you do not know the expected value until the script runs. You can also use this statement to verify values used in conditional statements. See Property, page 509. For example, you are testing a login page. The values entered in the Username and Password field are pulled from a datasheet. You do not know the value entered in the Username field until the script runs.

179 Capturing and checking property values during playback

In the following script, the Property statement captures the value entered in the Username field and assigns it to a variable named myUser. Next, the If statement evaluates the myUser variable value. If the variable value is sales, the TypeText statement enters 'money" in the Password edit box in the WysiCorp CRMLogin window. If the variable value is not sales, the TypeText statement in the Else block enters 'guest' in the Password edit box. myUser = Window("WysiCorp CRMLogin").EditBox("textBoxUser").Property("Text") If myUser = "sales" Then Window("WysiCorp CRMLogin").EditBox("textBoxPassword").TypeText("money") Else Window("WysiCorp CRMLogin").EditBox("textBoxPassword").TypeText("guest") End If

Tip: You can also use the Property statement to capture the Text property of a generic control that was changed to a different control type. QA Wizard Pro uses optical character recognition (OCR) to interpret the text. Keep in mind that OCR technology is not exact and the results may vary.

180 Using OCR to Work with Graphical Text

QA Wizard Pro uses optical character recognition (OCR) technology to read graphical text in applications and convert it to text strings. You can use the OCRGetText, page 497 statement to return text from images, control types QA Wizard Pro cannot recognize, or a specified region in a window or control for use in other statements. Other OCR statements are also available to perform different OCR actions, such as checkpoints. See OCR statements, page 342. Some OCR statements use a specific region relative to a window or control to find graphical text in applications. To provide the most accurate region to check, use the Add Statement dialog box to add OCR statements.

Note: The following information shows how to add the OCRGetText statement. Steps for adding other OCR statements are similar.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select OCR Get Text in the OCR category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window to check for text in. A screenshot of the selected window is displayed.

181 Using OCR to Work with Graphical Text

6. If you are checking for text in a control, select the Control. The selected control is outlined with a red box in the screenshot. 7. Enter the OCR Region information to specify where to find the text. These fields are automatically populated based on the location and size of the selected window or control. You can also click the screenshot and drag the red rectangle to select the region to use, which updates the values.

n Left specifies the pixel location of the left side of the rectangle that contains the text, relative to the selected window or control.

n Top specifies the pixel location of the top side of the region that contains the text, relative to the selected window or control.

n Width specifies the width of the rectangle that contains the text.

n Height specifies the height of the rectangle that contains the text. 8. Click Test to make sure the expected text is found before adding the statement to the script. A dialog box opens and displays the found text. By default, the OCR playback options are used when reading graphical text. If the found text is incorrect, you can adjust the default contrast, image scale, and grayscale conversion options to improve the accuracy of found text and change the OCR language file to identify non-English characters before adding the statement. See Setting playback options, page 76.

Note: OCR technology is not exact. See Troubleshooting OCR issues, page 186 for tips that can help provide best results.

9. Click OK to close the test dialog box. 10. If you are adding a function, select an optional Output variable to assign the return value to. The list includes script variables declared before the current line and repository variables for the application. To create a new variable, enter a variable name. 11. Enter an optional Comment, such as the purpose of the statement. 12. Click OK to add the statement to the script.

Example The following example shows a script with an OCRGetText statement that returns converted graphical text from a specified region in the elementLoginTester control on the WysiCorp Home page and assigns it to the password variable. The variable is then set in the editboxPassword control and used to log in to the web site. The conditional If statement includes a SaveRegionToImageFile statement to save an image of the region on the web page where OCR was performed if the WysiCorp Report a Bug page does not load because the log in fails. This image can then be used during debugging to help determine if the text returned by OCR or some other issue caused the log in to fail. Script.SetContext("WysiCorp Web Site/2.0") Script.RunApp() Window("WysiCorp Home").EditBox("editboxUsername").SetText("[email protected]") 'Uses OCR to get the password from the HTML element

182 Creating OCR checkpoints

password = Window("WysiCorp Home").HTMLElement("elementLoginTester").OCRGetText(80, 31, 61, 17) Window("WysiCorp Home").EditBox("editboxPassword").SetText(password) Window("WysiCorp Home").Button("buttonLogIn").Click() If (Not Window("WysiCorp Report a Bug").EditBox("editboxSummary").WaitForExists(1000)) Then Script.CloseApp() Script.RunApp() 'Saves an image of the region OCR was performed on for debugging purposes Window("WysiCorp Home").HTMLElement("elementLoginTester").SaveRegionToImageFile ("C:\\OCRTests\\Images\\DebugPassword.png", 80, 31, 61, 17) End If Script.CloseApp()

Creating OCR checkpoints Optical character recognition (OCR) reads graphical text in applications and converts it to a text string. Create OCR checkpoints to verify text in images, controls QA Wizard Pro cannot recognize, or in a specified region in a window or control. For example, you can use these checkpoints to verify text in web pages or images, such as charts and graphs. OCR technology is not exact. The actual text returned from the application and the expected text may not match exactly due to factors such as font, font size, and contrasting background colors. Because of this, you can specify the minimum level of accuracy for the checkpoint to pass. You can also change the default options used to read images using OCR during playback or use additional statements to adjust OCR settings. See Troubleshooting OCR issues, page 186 for tips that can help provide best results. 1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select OCR Checkpoint in the OCR category.

183 Creating OCR checkpoints

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window to check for text in. A screenshot of the selected window is displayed. 6. If you are checking for text in a control, select the Control. The selected control is outlined with a red box in the screenshot. 7. Enter or select the Expected text to compare to the actual text. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 8. Enter the minimum percentage of Accuracy required between the actual and expected text to pass the checkpoint. The text in the application and the expected text may not match exactly. For example, if the minimum accuracy percentage is 80% and the accuracy during playback is 85%, the checkpoint passes without requiring an exact match. The default accuracy is 92%.

184 Creating OCR checkpoints

9. Enter the OCR Region information to specify where to find the text. These fields are automatically populated based on the location and size of the selected window or control. You can also click the screenshot and drag the red rectangle to select the region to use, which updates the values.

n Left specifies the pixel location of the left side of the rectangle that contains the text, relative to the selected window or control.

n Top specifies the pixel location of the top side of the region that contains the text, relative to the selected window or control.

n Width specifies the width of the rectangle that contains the text.

n Height specifies the height of the rectangle that contains the text. 10. Click Test to make sure the checkpoint passes before adding it to the script. A dialog box opens that indicates if the expected text matches the actual text and the accuracy percentage calculated when comparing the values. You can use this information to change the expected text or minimum accuracy to make sure the checkpoint passes during playback. For example, if the test fails with 90% accuracy, you can decrease to the minimum accuracy to 90%. 11. Click OK to close the test dialog box. 12. Expand the Advanced options to indicate what happens if the checkpoint fails.

n Select the Failure Behavior. Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report. Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report.

n Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 13. Enter an optional Comment, such as the purpose of the statement. 14. Click OK to add the statement to the script. You can edit checkpoints if graphical text in the application changes. You can also delete checkpoints that are no longer needed. See Editing checkpoints, page 171 and Deleting checkpoints, page 177.

Example The ACME Bank login page menu bar uses images as buttons. You need to verify the text in each image when the login script runs. The first menu bar button is PRODUCTS, which is the expected text in the checkpoint. When the script runs, if the selected area in the tested application matches the expected text (PRODUCTS) with 92% or more accuracy, the checkpoint passes. If the text matches with 91% or less accuracy, the checkpoint fails, playback stops, and "Products button text is incorrect" is displayed in the Errors pane. The following example shows the OCRCheckpoint statement: Window("ACME Bank").OCRCheckpoint(92, "PRODUCTS", 222, 66, 59, 12, True, "Products button text is incorrect")

185 Troubleshooting OCR issues

Troubleshooting OCR issues Optical character recognition (OCR) technology is not exact. The following tips can help you successfully use OCR in QA Wizard Pro. n Use the test computer the script will run on to record scripts and add or debug OCR statements. Changes to the test environment, such as different screen resolutions, web browsers, or Windows themes, may affect the region where graphical text is found and cause playback errors. n When using OCR statements in web scripts, do not resize the browser window in the during recording because it can change the location of graphical text and cause playback errors. n OCR recognizes a wide variety of fonts, but it may not accurately read all fonts. n OCR best recognizes horizontally aligned text. OCR may incorrectly read or convert text positioned vertically or at an angle. n OCR best recognizes dark-colored text on a contrasting background (e.g., black text on a white background). OCR may not recognize white or light-colored text, especially on a light-colored background. You can change the default amount of contrast OCR uses or add the OCRSetContrast statement to scripts to adjust it during playback. See Setting playback options, page 76 and OCRSetContrast, page 501. n Use the SaveRegionToImageFile statement to capture a screenshot of the region OCR reads text from if OCR statements fail. You can use this screenshot to review the graphical text and change the region to return text from. See SaveRegionToImageFile, page 527. After verifying the region is correct, use the OCRGetTextFromFile statement to check the text returned from it. See OCRGetTextFromFile, page 498. If the text is incorrect, you can use the OCRConvertToGrayscale, OCRSetContrast, and OCRSetScale statements to adjust the settings used for OCR. See OCRConvertToGrayscale, page 493, OCRSetContrast, page 501, and OCRSetScale, page 503. n QA Wizard Pro uses the Tesseract OCR engine. QA Wizard Pro includes the English language file (eng.traineddata). If you need to test other languages, download additional language files from Tesseract. Language files must be stored in a directory named tessdata. You can then change the default OCR language file or add the OCRSetLanguageFilePath statement to scripts to specify the language file to use during playback. See Setting playback options, page 76 and OCRSetLanguageFilePath, page 502.

186 Creating Data-Driven Scripts

Data-driven testing allows you to test multiple scenarios and data ranges with one script. Instead of using hard-coded values or creating a script for each set of data, data-driven scripts use a different set of test data each time the script runs. Data-driven testing also separates test data from the script, making it easier to modify both the script and the test data. To use data-driven scripts, you associate a datasheet with a script and replace data in the script with datasheet values. When the script runs, the input values are read from the datasheet. The script repeats to use each row in the datasheet, allowing you to quickly test large amounts of data with one script.

About datasheets QA Wizard Pro supports both local and external datasheets. You can create test data in QA Wizard Pro using a local datasheet, which is a simple spreadsheet that is stored locally. You can also link to external test data stored in Microsoft Access, Microsoft Excel, Microsoft SQL Server, Oracle, PostgreSQL, SQLite, or text files. n Local datasheets are useful for testing a small amount of data or maintaining test data in QA Wizard Pro. See Creating local datasheets, page 187. n External datasheets are useful if you have a large amount of existing test data to access. See Configuring external datasheets, page 190.

Tip: By default, QA Wizard Pro workspaces contain Local Datasheets and External Datasheets folders. You can rename these folders or create new folders to organize datasheets. See Using folders, page 24.

Creating local datasheets Local datasheets are helpful if you have a small amount of data to test or you want to create and maintain test data in QA Wizard Pro. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select Create a local datasheet. 3. Click Next. 4. Enter a Column Name and press Enter.

187 Adding existing local datasheets

Tip: Right-click and choose Insert Row or Delete Row to add or remove a column name.

5. Click Next after you finish entering the column names. 6. Click Browse to select the Datasheet Path and name the datasheet. 7. Optionally enter a datasheet Description. 8. Click Finish. The datasheet is saved and opened in the Script pane. 9. Click a cell to enter test data in the datasheet. Press Tab to move to another column. Press Enter to move to the first cell in the next row. 10. Choose File > Save to save the changes.

Note: To use the data in a script, you need to associate the datasheet with the script and then replace the data in the script with datasheet values. See Associating datasheets with scripts, page 203 and Using datasheet values in scripts, page 203.

Adding existing local datasheets If you want to use a local datasheet stored in another workspace, you can add it as an existing datasheet. When you add an existing datasheet, the datasheet file is shared and not copied. Any changes you make to the datasheet are simultaneously made in all workspaces. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select Add existing local datasheet. 3. Click Next. 4. Click Add. The Add Datasheet dialog box opens. 5. Select the local datasheet you want to add and click Open. 6. Click Finish.

188 Importing external test data

Importing external test data You can import test data into QA Wizard Pro. This is helpful if you want to be able to change the test data in QA Wizard Pro without affecting the external data source.

Note: If you want to automatically update local test data when changes are made in the external data source or vice versa, link to the data source instead. See Linking to external test data, page 189.

1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select Import data from external source. 3. Click Next. 4. Select a Datasheet type. The fields are different depending on the datasheet type. See Configuring external datasheets, page 190. 5. Enter or select the Datasheet Options. 6. Click Next. 7. Click Browse to select the Datasheet Path and name the datasheet. 8. Optionally enter a datasheet Description. 9. Click Finish. The datasheet is saved and opened in the Script pane.

Note: To use the data in a script, you need to associate the datasheet with the script and then replace the data in the script with datasheet values. See Associating datasheets with scripts, page 203 and Using datasheet values in scripts, page 203.

Linking to external test data You can retrieve test data from an external data source by creating a linked datasheet. Linked datasheets are synced between QA Wizard Pro and the external data source, which eliminates the need for manual updates. When changes are made to the test data in QA Wizard Pro or from scripts, the external source is automatically updated and vice versa.

Note: You can only edit linked Microsoft Excel datasheets if Excel is installed on the test computer. You cannot edit linked text datasheets from QA Wizard Pro or scripts.

If you only want to copy test data to a datasheet and make changes locally without affecting the external source, import the data instead. See Importing external test data, page 189. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select Link to data in external source. 3. Click Next. 4. Select a Datasheet type. The fields are different depending on the datasheet type. See Configuring external datasheets, page 190.

189 Configuring external datasheets

5. Enter or select the Datasheet Options. 6. Click Next. 7. Enter a Datasheet Name. 8. Click Finish. The datasheet is saved and opened in the Script pane.

Note: To use the data in a script, you need to associate the datasheet with the script and then replace the data in the script with datasheet values. See Associating datasheets with scripts, page 203 and Using datasheet values in scripts, page 203.

Configuring external datasheets QA Wizard Pro can retrieve test data from external sources, including Microsoft Access, Microsoft Excel, Microsoft SQL Server, Oracle, PostgreSQL, SQLite, and text files. There are two options for retrieving external data: importing data from an external source or linking to external data. If you want to copy test data into a datasheet and change it in QA Wizard Pro without modifying data in the external source, import the test data from the external source. After the data is imported to QA Wizard Pro, you can modify it locally to test different scenarios. See Importing external test data, page 189. If you want to sync the data between the external source and QA Wizard Pro, link to the data. When changes are made in the external source, data in the linked datasheet is automatically updated and vice versa. See Linking to external test data, page 189.

Creating Microsoft Access datasheets If you have a large amount of existing test data in a Microsoft Access database, you can create an external datasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, or use a script-generated query to retrieve data during playback. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa. 3. Click Next. 4. Select Microsoft Access database as the Datasheet type.

190 Creating Microsoft Access datasheets

5. Enter the path to the Access file or click Browse to select it. 6. Enter the User and Password if user-level security is configured for the database. The default Access user is Admin and there is no password. 7. Select Use workgroup information file if the database uses a workgroup information file for security. Click Browse to select the file. 8. Select Use database password and enter the password if it is required to access the database. 9. Select a Source to use to retrieve data from the database.

n Table retrieves all data from the specified table.

n Query uses the specified query to retrieve a subset of data from a database table. The query must return data from the source database to populate the datasheet. See Retrieving external data with database queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 10. Click Next. 11. Specify the datasheet properties.

191 Creating Microsoft Excel datasheets

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 12. Click Finish to add the datasheet to the workspace.

Creating Microsoft Excel datasheets If you have a large amount of existing test data in a Microsoft Excel file, you can create an external datasheet to use it in data-driven scripts. You can retrieve all data from a worksheet in the file or use a script-generated query to retrieve data during playback. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa.

Note: Excel must be installed on the test computer to modify linked Excel datasheets.

3. Click Next. 4. Select Microsoft Excel sheet as the Datasheet type.

5. Enter the path to the Excel file or click Browse to select it. 6. Select a Source to use to retrieve data from the file.

192 Creating Microsoft SQL Server datasheets

n Sheet retrieves all data from the specified worksheet in the file.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 7. Select First row contains column headers if the Excel sheet contains column headers. If this option is not selected, the datasheet uses default column names (F1, F2, F3, etc.). 8. Click Next. 9. Specify the datasheet properties.

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 10. Click Finish to add the datasheet to the workspace.

Creating Microsoft SQL Server datasheets If you have a large amount of existing test data in a Microsoft SQL Server database, you can create an external datasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, or use a script-generated query to retrieve data during playback. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa. 3. Click Next. 4. Select Microsoft SQL Server database as the Datasheet type.

193 Creating Microsoft SQL Server datasheets

5. Enter the Server host name or IP address. 6. Enter the Database name. 7. Select a Network protocol.

n Named pipes uses pipes to communicate with SQL Server.

n TCP/IP uses TCP/IP to communicate with SQL Server. Enter the TCP/IP port. 8. Select an Authentication type.

n Use Windows authentication uses the username and password of the user logged in to the computer running QA Wizard Pro to validate the SQL Server account name and password.

n Use SQL Server authentication uses the SQL Server username and password. Enter the User and Password. 9. Select a Source to use to retrieve data from the database.

194 Creating Oracle datasheets

n Table retrieves all data from the specified table.

n Query uses the specified query to retrieve a subset of data from a database table. The query must return data from the source database to populate the datasheet. See Retrieving external data with database queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 10. Specify the datasheet properties.

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 11. Click Finish to add the datasheet to the workspace.

Creating Oracle datasheets If you have a large amount of existing test data in an Oracle database, you can create an external datasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, or use a script-generated query to retrieve data during playback.

Note: Oracle 8i release 3 and later databases are supported.

1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa. 3. Click Next. 4. Select Oracle database as the Datasheet type.

195 Creating Oracle datasheets

5. Select a database connection type and enter the connection details.

n TNS alias connection uses a TNS alias to connect to the database.

n Basic connection uses the specified Oracle Server address and Server port. The default port is 1521. Select a database connection option and enter the SID/Service name. Connect via SID connects to the database using a system identifier. Connect via Service Name connects to the database using the service name. 6. Select an Authentication type.

n Use integrated security uses the built-in Oracle authentication to access the database.

n Use specified user and password uses a specific username and password to access the database. Enter the User and Password. 7. Select a Source to use to retrieve data from the database.

196 Creating PostgreSQL datasheets

n Table retrieves all data from the specified table.

n Query uses the specified query to retrieve a subset of data from a database table. The query must return data from the source database to populate the datasheet. See Retrieving external data with database queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 8. Click Next. 9. Specify the datasheet properties.

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 10. Click Finish to add the datasheet to the workspace.

Creating PostgreSQL datasheets If you have a large amount of existing test data in a PostgreSQL database, you can create an external datasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, or use a script-generated query to retrieve data during playback. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa. 3. Click Next. 4. Select PostgreSQL database as the Datasheet type.

197 Creating PostgreSQL datasheets

5. Enter the Server host name or IP address. 6. Enter the Database name. 7. Enter the TCP/IP port used to communicate with the PostgreSQL server. 8. Select an Authentication type.

n Use Windows authentication uses the username and password of the user logged in to the computer running QA Wizard Pro to validate the PostgreSQL account name and password.

n Use PostgreSQL authentication uses the PostgreSQL username and password. Enter the User and Password. 9. Select a Source to use to retrieve data from the database.

n Table retrieves all data from the specified table.

n Query uses the specified query to retrieve a subset of data from a database table. The query must return data from the source database to populate the datasheet. See Retrieving external data with database queries, page 206.

198 Creating SQLite datasheets

n Script-generated query uses a function in a script to retrieve a subset of data during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 10. Click Next. 11. Specify the datasheet properties.

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 12. Click Finish to add the datasheet to the workspace.

Creating SQLite datasheets If you have a large amount of existing test data in a SQLite database, you can create an external datasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, or use a script-generated query to retrieve data during playback. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa. 3. Click Next. 4. Select SQLite database as the Datasheet type.

199 Creating text file datasheets

5. Enter the path to SQLite file or click Browse to select it. 6. Select a Source to use to retrieve data from the database.

n Table retrieves all data from the specified table.

n Query uses the specified query to retrieve a subset of data from a database table. The query must return data from the source database to populate the datasheet. See Retrieving external data with database queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 7. Click Next. 8. Specify the datasheet properties.

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 9. Click Finish to add the datasheet to the workspace.

Creating text file datasheets If you have a large amount of existing test data in a text file, you can create an external datasheet to use it in data-driven scripts. Comma-delimited and fixed-width text files are supported. 1. Choose Data > Create Datasheet. The Create Datasheet wizard opens. 2. Select an external data source option.

200 Creating text file datasheets

n Import data from external source imports data from the source and maintains it in QA Wizard Pro. Any changes to the imported data in the datasheet are not synced with the source.

n Link to data in external source links the datasheet to the source. Any changes to the data in the QA Wizard Pro datasheet are synced with the source and vice versa. 3. Click Next. 4. Select Text file as the Datasheet type.

5. Enter the path to the text file or click Browse to select it. 6. Select First row contains column headers if the text file contains column headings. If this option is selected, QA Wizard Pro uses the values in the first row of the file to identify columns. If this option is not selected, the datasheet uses default column names (F1, F2, F3, etc.). 7. Select Script-generated query to use a function in a script to retrieve a subset of data from the text file during playback. This option is only available if the datasheet links to an external data source. If this option is selected, you cannot view or edit the datasheet in QA Wizard Pro or modify the data source using scripts. See Retrieving external data with script-generated queries, page 207. 8. Select the Format of data in the text file.

n Comma-delimited columns indicates the columns are separated by commas.

n Fixed-width columns indicates the columns are set at a fixed width.

Note: You may need to create a schema.ini file for the text file. If you are using a comma-delimited file with different data types in the same column, you must create a schema.ini file to identify the data types in the file. If you are using a fixed-width file, you must always create a schema.ini file to identify the file contents and column width. This file must be saved in the same directory as the text file. See Creating a schema.ini file for text files, page 202.

9. Specify the datasheet properties.

201 Creating text file datasheets

n If you are importing data, click Browse to select the Datasheet path to save the file in and enter a File name. Datasheets are saved with a .qawsheet extension. You can also enter an optional Description for the datasheet.

n If you are linking to the external data source, enter a Datasheet name. 10. Click Finish to add the datasheet to the workspace.

Creating a schema.ini file for text files To use a fixed-width text file or a comma-delimited text file that contains mixed data types in the same column as a data source, you need to create a schema.ini file to identify the contents of the file. The schema file includes entries that specify characteristics of the text file including the filename, file format, field names, widths, and types, character set, and data type conversions. You can use any text editor to create the schema file, which must be stored in the same directory as the text file. The following example shows the information that must be included in the schema file for a fixed-width text file. [filename.txt] Format=FixedLength ColNameHeader=False Col1=ColName1 TEXT Width 15 Col2=ColName2 TEXT Width 15 Col3=ColName3 TEXT Width 40 Col4=ColName4 TEXT Width 20 CharacterSet=ANSI The following example shows the information that must be included in the schema file for a comma-delimited text file that contains mixed data types. [filename.txt] Format=CSVDelimited ColNameHeader=False Col1=ColName1 TEXT Col2=ColName2 TEXT CharacterSet=ANSI

Item Description

Filename Text file name; must be enclosed in brackets

Format Text file format: FixedLength or CSVDelimited

ColNameHeader Indicates if the first record in the text file contains column headings (true) or not (false)

Col Column by number; required for fixed-width files but optional for comma-delimited files

ColName Column name; used to identify the column in QA Wizard Pro

202 Associating datasheets with scripts

Item Description

DataType Type of data in the column:

n TEXT—Text values; unspecified length returns 255 bit width

n FLOAT—Signed, approximate, numeric values; maximum width includes the sign and decimal point

n INTEGER—Non-decimal numeric values (whole numbers); valid width values are 32767 to -32766

n LONGCHAR—Text values; unspecified length returns 65500 KB width

n DATETIME—String that specifies date/time format

Width Column width

CharacterSet Character set: ANSI or OEM

Associating datasheets with scripts When a datasheet is associated with a script, the script runs once using the first datasheet row and then repeats for each additional row until it reaches the end of the datasheet. Associate a datasheet with a script if: n You want to run the entire script once for each datasheet row. n The script only uses one datasheet. n You do not want to add or delete rows in the datasheet when the script runs. n Called scripts are not associated with a datasheet or are only associated with the same datasheet as the script that called them. If you want to perform advanced data-driven testing, you may want to use datasheet statements instead of associating scripts with datasheets. Use datasheet statements if: n You only want to run the script once and use one datasheet row per run. n You want to run a small portion of the script once for each datasheet row. n You want to append a row to the datasheet when the script runs. n The script uses data from more than one datasheet. See Navigating datasheets, page 205. 1. Open the script you want to associate the datasheet with. 2. Select the datasheet from the Data Source list in the Script pane.

Tip: You can also select a datasheet in script properties. See Modifying script properties, page 163.

Using datasheet values in scripts After you associate a datasheet with a script, you can edit the script to use data from the datasheet. When a script runs, it uses the values from the first datasheet row and repeats the script until all rows are used.

203 Using datasheet values in scripts

Note: The following steps apply to Keyword View and Text View.

1. Select the step that contains the data you want to replace with a datasheet value. 2. Choose Script > Edit Statement. The Edit Statement dialog box opens. 3. Select Datasheet and select the datasheet column to use from the corresponding list.

Tip: To view the script and datasheet at the same time, right-click the script or datasheet tab in the Script pane and select New Horizontal Tab Group or New Vertical Tab Group.

4. Click OK. The datasheet reference is added to the script step.

Note: You can use datasheet statements to navigate datasheets and perform tasks. For example, you can read and write values in database fields or delete database records. See Navigating datasheets, page 205.

Examples In this example, a script with an associated datasheet enters data in a web page form. The Cell statement retrieves data from the associated datasheet cell and assigns values to variables. The data is entered in the corresponding form fields. The script continues to enter data based on the current datasheet row until all rows are used. firstName = Cell("first name") lastName = Cell("last name") email = Cell("email address") company = Cell("company") phone = Cell("phone number") Window("WysiCorp Feedback Acknowledgment").Editbox("editboxFirst").TypeText(firstName) Window("WysiCorp Feedback Acknowledgment").Editbox("editboxLast").TypeText(lastName) Window("WysiCorp Feedback Acknowledgment").Editbox("editboxEmail").TypeText(email)

204 Navigating datasheets

Window("WysiCorp Feedback Acknowledgment").Editbox("editboxCompany").TypeText(company) Window("WysiCorp Feedback Acknowledgment").Editbox("editboxPhone").TypeText(phone) In this example, a script with an associated datasheet enters data in a web form and sets a cell value in a datasheet row. The Cell statement retrieves data from the associated datasheet cell and assigns a new value for the emailAddress variable. The data is entered in the corresponding form fields. The SetCell statement is also used to write the variable value to a datasheet cell. emailAddress = Cell("B") + "@wysicorp.com" Window("WysiCorp Report a Bug").Editbox("First Name").TypeText(Cell("A")) Window("WysiCorp Report a Bug").Editbox("Last Name").TypeText(Cell("B")) SetCell("C", emailAddress) Window("WysiCorp Report a Bug").Editbox("Email Address").TypeText(Cell("C")) Window("WysiCorp Report a Bug").Editbox("Company Field").TypeText(Cell("D")) Window("WysiCorp Report a Bug").Editbox("Phone Number").TypeText(Cell("E")) Window("WysiCorp Report a Bug").Button("Send to WysiCorp").Click()

Navigating datasheets You can use datasheet statements in scripts to navigate, read from and write to local or external datasheets, limit the data in a datasheet, and return values from datasheets. See Datasheet statements, page 325. Use datasheet statements if: n You only want to run the script once and use one datasheet row per run. n You want to run a small portion of the script once for each datasheet row. n You want to append a row to the datasheet when the script runs. n The script uses data from more than one datasheet. n The script uses an external datasheet set to use a script-generated query to retrieve data during playback.

Note: You cannot use datasheet statements if the datasheet is associated with a script.

1. Add the statements to perform. 2. Before the statements you want to use datasheet values in, add a variable equal to the OpenRecordset statement and datasheet to access. The OpenRecordset syntax is OpenRecordset("DatasheetName").

Note: If the datasheet uses a script-generated query to retrieve data during playback, add a variable equal to the OpenRecordsetQuery statement. See OpenRecordsetQuery, page 505.

3. Add variables for each datasheet column used in the script. Set each variable equal to the GetRowValue statement. The GetRowValue syntax is GetRowValue (Recordset, "ColumnName"). 4. Select the statement you want to assign data to. 5. Choose Script > Edit Statement. The Edit Statement dialog box opens. 6. Select Expression. 7. Enter the variable that contains the datasheet column to use.

205 Retrieving external data with database queries

8. Click OK. The datasheet reference is added to the statement.

Example In the following example, database statements open a recordset named AccessDatabase and retrieve values from the First_Name, Last_Name, Company, Phone_Number, and Email_Address datasheet columns. The SetRowValue statement writes the value of the lastName variable plus '@wysicorp.com' to the Email_ Address column in the current datasheet row. The datasheet values are entered in the form, the form is submitted, and the script navigates back to the form page. The Do...Loop Until statement instructs the script to continue entering the corresponding datasheet values in the form until the last datasheet row is used. When the last row is used, the browser window closes. Recordset = OpenRecordset("AccessDatabase") Do firstName = (GetRowValue(Recordset,"First_Name")) lastName = (GetRowValue(Recordset,"Last_Name")) company = (GetRowValue(Recordset,"Company")) phoneNumber = (GetRowValue(Recordset,"Phone_Number")) SetRowValue(Recordset,"Email_Address",lastName +"@wysicorp.com") emailAddress = (GetRowValue(Recordset,"Email_Address")) Window("WysiCorp Report a Bug").Editbox("First Name").TypeText(firstName) Window("WysiCorp Report a Bug").Editbox("Last Name").TypeText(lastName) Window("WysiCorp Report a Bug").Editbox("Email Address").TypeText(emailAddress) Window("WysiCorp Report a Bug").Editbox("Company").TypeText(company) Window("WysiCorp Report a Bug").Editbox("Phone Number").TypeText(phoneNumber) Window("WysiCorp Report a Bug").Button("Send to WysiCorp").Click() Window("Browser").Navigate("http://www.wysicorp.com/wysicorp/reportbug.html") NextRow(Recordset) Loop Until RecordsetEOF(Recordset) Window("Browser").Close()

Note: Additional examples are available in the DatabaseOperations and DatabaseCheckpoints sample workspaces.

Retrieving external data with database queries When creating external datasheets, you can add a query in the datasheet options to return a subset of data from a Microsoft Access, Oracle, PostgreSQL, SQLite, or SQL Server database. Any query supported by the database application can be used to import subsets of data to a datasheet or to update a datasheet linked to an external data source each time it is opened in QA Wizard Pro.

Note: You can also use script-generated queries to access data during script playback. See Retrieving external data with script-generated queries, page 207.

1. Use the Create Datasheet wizard to create an external datasheet. See Configuring external datasheets, page 190. 2. Select Query.

206 Retrieving external data with script-generated queries

3. Enter the query.

Tip: You can create the query in the database application, copy it, and paste it in the Query field.

4. Click OK. The datasheet opens and contains the returned data. If the datasheet is linked to an external data source, the query updates the data each time the datasheet is opened.

Example In the following query, a subset of data is retrieved from a Microsoft Access database. The SELECT statement returns the First_Name, Last_Name, Email_Address, Company, and Phone_Number data. The FROM statement specifies that the data should be returned from the WysiCorpData table. SELECT WysiCorpData.ID, WysiCorpData.First_Name, WysiCorpData.Last_Name, WysiCorpData.Email_Address, WysiCorpData.Company, WysiCorpData.Phone_Number FROM WysiCorpData;

Retrieving external data with script-generated queries If you use multiple sets of data from one external data source, you can configure a single external datasheet and use a script-generated query to retrieve a recordset during playback instead of creating multiple external datasheets to retrieve multiple recordsets. This allows you to perform a dynamic query on a data source during playback. Script-generated queries can only be used for external datasheets linked to a data source. All data is stored in the external source and you cannot view the data in QA Wizard Pro. You can use the OpenRecordsetQuery statement to perform the query on the data source. 1. Use the Create Datasheet wizard to create an external datasheet that links to a data source. Make sure you select the Link to data in external source option in the datasheet options. See Configuring external datasheets, page 190. 2. Select Script-generated query in the datasheet information.

207 Editing local datasheets

3. Add the OpenRecordsetQuery statement to a script to specify the data to open from the external data source during playback. See OpenRecordsetQuery, page 505.

Example In the following script, the OpenRecordsetQuery statement uses the SELECT * FROM Email SQL query to retrieve all columns and rows from the Email table in the database linked to the Customers external datasheet. The recordset is assigned to the myRecordset variable. The RecordsetRowCount statement returns the number of rows in the recordset and assigns the number to the count variable. The PrintLn statement prints the number of rows stored in the count variable. myRecordset = OpenRecordsetQuery("Customers", "SELECT * FROM Email") count = RecordsetRowCount(myRecordset) PrintLn(count)

Editing local datasheets You can edit the column names and the description of local datasheets. You can also add columns to the datasheet. 1. Select the datasheet and choose Data > Edit Datasheet. The Edit Datasheet dialog box opens. 2. Make any changes.

Tip: Right-click and choose Insert Row or Delete Row to add or remove a column.

3. Click OK. The datasheet is updated.

Modifying local datasheet properties You can rename a local datasheet or view the location where it is saved. 1. Select the local datasheet in the Workspace pane.

208 Deleting local datasheets

2. Choose File > Properties. The Properties dialog box opens.

3. Optionally enter a new datasheet Name. If you rename the datasheet, it is no longer associated with scripts. You must associate the renamed datasheet with scripts. 4. Click OK to save the changes.

Deleting local datasheets 1. Select the local datasheet you want delete in the Workspace pane. 2. Choose Edit > Delete. 3. Optionally select Also delete the file from the disk to delete the datasheet from the workspace and the hard drive. 4. Click OK to delete the datasheet.

Modifying external datasheet properties You can rename an external datasheet, change its data source, or select a different set of data. 1. Select the external datasheet in the Workspace pane. 2. Choose File > Properties. The Properties dialog box opens. The fields are different depending on the datasheet type.

209 Deleting external datasheets

3. Optionally enter a new Datasheet Name. If you rename the datasheet, it is no longer associated with scripts. You must associate the renamed datasheet with scripts. 4. Make any changes to the Datasheet Options. You cannot change the datasheet type. 5. Click OK to save the changes.

Deleting external datasheets When you delete an external datasheet, it is only deleted from the workspace. 1. Select the datasheet you want to delete in the Workspace pane. 2. Choose Edit > Delete. You are prompted to confirm the deletion. 3. Click Yes. The datasheet is deleted.

210 Debugging Scripts

QA Wizard Pro's built-in debugging tools can help you troubleshoot and fix script errors. Use the following options to debug scripts: n Run scripts in debug mode to step through script lines to troubleshoot failures. n Add breakpoints to stop script playback at a specific line that may need to be evaluated. n Use the INDEBUGMODE variable to skip script actions while debugging scripts. For example, use this variable to prevent submitting Helix ALM issues when scripts run in debug mode. n Change script and repository variable values in the Variables pane to troubleshoot steps without modifying the script.

Running scripts in debug mode Run scripts in debug mode to troubleshoot and fix script errors. Keep the following in mind before debugging scripts: n Make sure the Debug toolbar is open. Choose View > Toolbars > Debug to open it. n If QA Wizard Pro is integrated with Helix ALM, and a script includes statements to add issues to a Helix ALM project, comment them out so issues are not submitted while debugging. You can also use the INDEBUGMODE variable to prevent submitting issues when running scripts in debug mode. See Using the INDEBUGMODE variable, page 213. n QA Wizard Pro does not send results emails for scripts running in debug mode. 1. Open a script and then choose Debug > Debug Script.

Note: If a script is set as the main script for the workspace, you can debug it without opening it. Choose Debug > Debug Main Script. See Setting and running a main script, page 74.

The script stops running when an error occurs or the first breakpoint is reached. Breakpoints indicate the step to stop playback on. See Using breakpoints, page 212. 2. Troubleshoot the script using the following debug commands.

Command Description

Toggle Adds or removes a breakpoint. Breakpoint

Remove All Removes all breakpoints. Breakpoints

Continue Runs script steps up to the next breakpoint or the end of the script.

Step Runs the next script step.

If the next step is a CallScript statement, QA Wizard Pro runs the entire called script.

211 Using breakpoints

Command Description

Step Into Pauses playback and allows you to step through a called script, using the Step command.

If the next step is a CallScript statement, QA Wizard Pro runs the entire called script. If there is a breakpoint on a CallScript statement, QA Wizard Pro opens the called script and allows you to step through it.

Set Next Sets the next statement to run when playback continues. Use to run statements again Statement or skip some statements while debugging. You can only set the next statement when playback is paused.

Stop Stops running the script in debug mode. You must stop running in debug mode before you can modify scripts.

Note: You can use the call stack to trace the functions called to the point when an error occurs or a breakpoint is reached. Choose View > Call Stack to display the stack information.

Using breakpoints Breakpoints stop script playback at a specific step during debugging and allow you to step through the script so you can evaluate each step and fix the problem. 1. Run the script and determine where problems occur. 2. Select a script step and choose Debug > Toggle Breakpoint. A breakpoint, indicated by a red circle, is inserted. You can add multiple breakpoints.

Note: Breakpoints cannot be set for comments, outlined steps, or empty lines.

3. To remove a breakpoint, select the step with the breakpoint and choose Debug > Toggle Breakpoint. To remove all breakpoints, choose Debug > Remove All Breakpoints.

Tip: You can also click the area left of the script line number to toggle a breakpoint.

212 Using the INDEBUGMODE variable

Using the INDEBUGMODE variable The INDEBUGMODE Boolean variable determines if a script is running in debug mode. Use this variable with an If statement to skip a task if a script is in debug mode. In the following example, an issue is added to Helix ALM if the value returned from the combobox items count is less than 5 and the script is not in debug mode. Script.SetContext("BugReporter/1.0") Script.RunApp() value = Window("BugReporter Dialog").ComboBox("combobox1").Property("Number of Items") If NOT(INDEBUGMODE) Then If value < 5 Then AddIssue("Error", "Number of items < 5", "Attached Script", "") End If End If Window("BugReporter Dialog").Editbox("editbox8").TypeText("This is a test") Window("BugReporter Dialog").Button("Quit").Click()

Troubleshooting variables As a script runs in debug mode, script and repository variables that are included in steps are displayed in the Variables pane. You can change the variable value during debugging without changing the script. This allows you to view the variable value and figure out why it is not working. To change a variable value, select the value in the Variables pane and enter the value to use during debugging. You can enter other variables, numbers, strings, and constants, such as Pi, true, false, and FunctionError Number, or leave the value empty. The next step that uses the variable uses the Variables pane value instead of the script value.

213

Using Repository Variables

Repository variables store values that can be used in all scripts recorded or run against an application version. Repository variables can help you test dynamic components of an application or web site without needing to make extensive script modifications or maintain a large number of scripts. For example, repository variables can be used for server names in web site addresses and login IDs/passwords. Unlike variables defined at the script level, repository variables are defined once and saved with a version in the application repository. They can be shared by all scripts that use the version. When a repository variable is created, a default variable value is identified. This value is used every time a script is recorded or run against the application version. Depending on the variable settings, users can be prompted to enter or select a different value for each recording or playback session. This value is used every time the variable is referenced in the script. See Entering repository variable values during recording and playback, page 221. For example, a web application is hosted on a development server, test server, and production server. You want to record and run the same scripts against all three servers. You can create a repository variable that contains values for each server address. QA Wizard Pro can prompt you to select the variable value that corresponds with the server you are recording or running a script against. Repository variables can be used anywhere in scripts. Use the Assignment statement to assign variable values in scripts, which can be a text string, expression, or value from an associated datasheet. See Assignment, page 358. Repository variables can also be used in expected values for application window and control properties. For example, a property for a web page changes based on the web site address. This property is used as search criteria during playback. Use a repository variable in the property's expected value so QA Wizard Pro can locate the window when the address changes. See Modifying window and control properties, page 122.

Note: You can also use repository variables in URL format rules. See Creating URL format rules, page 227.

Creating repository variables Repository variables store values that can be used in all scripts recorded or run against an application version. Create repository variables if multiple scripts test the same data and the data changes based on the application conditions or inputs. Repository variables can be defined for each version in the application repository and shared between any scripts recorded or run against the version. 1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the Repository Variables tab. 3. Click Add. A new row is added to the variables list.

215 Creating repository variables

4. Enter a Variable Name. Variable names must conform to the following identifier rules:

n Must start with an alphabetic character

n Cannot contain spaces

n Can only contain alphanumeric characters or underscore characters 5. Enter a Description. 6. Click in the Value Type column and select a variable Type.

n Text assigns one value to the variable.

n List assigns multiple values to the variable. See Adding repository variable list values, page 218. 7. Enter the Default Value. The value can be a text string, expression, value from an associated datasheet, or a variable. If you selected List as the Value Type, enter the list values separated with a comma or click to add the values. The first list value is the default value used when recording and running scripts. See Adding repository variable list values, page 218. 8. Select Replace to automatically replace all instances of the variable value with the variable name during recording. The script and expected values for window and control properties are populated with the variable name instead of the variable value. You may want to select this option if you run scripts against different web servers so you do not have to make extensive modifications to scripts and the application repository. For example, if you use the URLROOT variable, all instances of the variable value used during recording are replaced with %URLROOT% in the script and application repository. When scripts run, the variable is replaced with the value assigned for the playback session.

Note: Only select this option to replace unique values such as web server addresses. If the value is not unique, you may unintentionally replace the wrong value in scripts and the application repository, which can cause scripts to fail.

9. Select Prompt to prompt users to enter a variable value. See Entering repository variable values during recording and playback, page 221.

216 Editing repository variables

Note: If this option is selected, users are prompted to enter a variable value when the RunApp or ConnectToProcess statements run. If the repository variable is set in the script before these statements, users are not prompted and the value set in the script is used.

10. Click OK. The variables are saved.

Editing repository variables You can edit repository variable names, values, and options. 1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the Repository Variables tab. 3. Click a value and make any changes. 4. Click OK to save the changes.

Deleting repository variables You can delete repository variables if they are no longer used. 1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the Repository Variables tab. 3. Select the variable you want to delete. 4. Click Delete. You are prompted to confirm the deletion. This action cannot be undone. 5. Click Yes. The variable is deleted.

Managing repository variable list values Repository variables can contain multiple list values that users can select from when they are prompted to enter a variable value. 1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the Repository Variables tab.

217 Adding repository variable list values

3. Click the plus sign in the Default Value column. The Manage List Values dialog box opens.

4. Click Add to add a value. See Adding repository variable list values, page 218. 5. Click a value to modify it. See Editing repository variable list values, page 219. 6. Select a value and click Delete to delete it. See Deleting repository variable list values, page 219. 7. Select a value and click Move Up and Move Down to reorder the list. The first value in the list is used as the default value when recording or running scripts. 8. Click OK to save the changes.

Adding repository variable list values You can add list values to repository variables if you want to prompt users to select a value from a list during recording or playback. Users can also enter a value that is not included in the list. See Editing repository variable list values, page 219.

Note: You can also enter list values in the Default Value column on the Repository Variables tab in the Properties dialog box. Separate values with a comma. The first value is the default value.

1. Select a version in the application repository and choose File > Properties.

218 Editing repository variable list values

The Properties dialog box opens. 2. Click the Repository Variables tab. 3. Click in the Default Value column. The Manage List Values dialog box opens.

4. Click Add to add a value. A new row is added. 5. Enter the value in the new row. 6. Repeat steps 4 and 5 to add additional values. 7. Click OK when you finish. The values are added.

Editing repository variable list values You can edit repository variable list values if they change. 1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click a value and make any changes. 3. Click OK to save the changes.

Tip: You can also edit values on the Repository Variables tab in the Properties dialog box. See Editing repository variables, page 217.

Deleting repository variable list values You can delete repository variable list values that are no longer used. 1. Click the plus sign in the Default Value column on the Repository Variables tab in the Properties dialog box. The Manage List Values dialog box opens. 2. Select a value and click Delete.

219 About the URLROOT repository variable

You are prompted to confirm the deletion. 3. Click Yes. The value is deleted.

Tip: You can also delete values on the Repository Variables tab in the Properties dialog box. See Editing repository variable list values, page 219.

About the URLROOT repository variable When you create a web application in QA Wizard Pro, you can automatically create a URLROOT repository variable to help with testing a web site hosted on multiple servers. The variable value is the server address that hosts the web site you are testing. For example, if the URL for the new application is www.wysicorp.com/login, the URLROOT variable value is www.wysicorp.com. After the URLROOT variable is created, you can use it anywhere in scripts and expected values for window and control properties. For example, you can add the variable before the RunApp statement to specify the address used to open the web site and replace other references to the variable throughout the script. See Running web scripts against different servers, page 226. By default, the URLROOT variable has the following settings: n Variable type is List n Auto-record substitution is enabled n Prompt is disabled

Tip: You can modify variable settings after you add the application. See Editing repository variables, page 217.

Using repository variables in scripts Script variables can only be used in the script they are created in. Repository variables can be used in all scripts recorded or run against an application. Repository variables are defined once and saved with a version in the repository. For example, a repository variable named loginID is defined for the application. To use the variable in a script, enter the variable name where you want to use it. For example: PrintLn (loginID) During playback, the default variable value or the value entered when playback started is used. See Entering repository variable values during recording and playback, page 221. Keep the following in mind: n If a script variable and repository variable have the same name, the script variable value overrides the repository variable value during playback. n If a repository variable is declared explicitly before the RunApp or ConnectToProcess statement, users are not prompted to select a variable value unless other repository variables require prompting.

220 Entering repository variable values during recording and playback

n Repository variables are text values. To use variable values in statements that use other value types, you must convert the values. For example, a variable named Time has a value of 30000. To use the variable in the SetControlSearchTimeout statement, which requires an integer value, you must use the following Integer statement to convert the text value before the SetControlSearchTimeout statement is used: var=Integer(Time).

Entering repository variable values during recording and playback Repository variables can be configured to prompt users to enter a variable value when recording or running. Depending on the variable settings, you can enter a value or select a predefined value from a list. n If a repository variable is set to prompt and you use the QAWRunScript command to run scripts and batch files, you must set the variable value in the QAWRunScript command or the script will fail. See Running scripts from a command prompt, page 80. n If a script variable and a repository variable have the same name, the script variable value overrides the repository variable value during playback. 1. If a repository variable is set to prompt, the Enter Variable Value dialog box opens when you record or run a script. The variables configured for the version and their default values are displayed.

2. Optionally select a row and enter or select the value to use in the Value column. If you enter a new value, it is saved and used as the default value the next time you record or run scripts against the application version. 3. Select Do not prompt again if you do not want the Enter Variable Values dialog box to open when you record or run subsequent scripts against the application version. If this option is selected, the current value is used until QA Wizard Pro is restarted. 4. Click OK. The value you entered is saved in the variable.

221

Testing Dynamic Web Applications

Scripts that test dynamic web sites and applications may fail during playback because the application no longer matches the data stored in QA Wizard Pro. XPath queries and URL format rules can help you test dynamic content. XPath queries find elements in HTML documents based on the unique path to the element within the hierarchy of all elements in the document. You can use XPath queries to specify the location of an HTML element stored in the application repository, which allows QA Wizard Pro to locate it during playback or perform checkpoints, object actions, or low-levels actions on it. See About XPath queries, page 223. URL format rules handle dynamic URLs, which are used to locate controls during playback. URL format rules can compare, ignore, or perform regular expression searches on parts of URLs, such as the domain and parameters. If you are testing a web application hosted on multiple web servers, you can use URL format rules to handle multiple domain names. See Using URL format rules, page 227.

About XPath queries XML Path Language (XPath) can be used to find elements in HTML documents. Each element in a document has an XPath, which is the unique path to the element based on the hierarchy of all elements in the document, similar to a file path in an operating system. XPath queries help QA Wizard Pro more accurately locate controls when running scripts against dynamic web sites.

Note: XPath language is defined by the W3C (www.w3.org/TR/1999/PR-xpath-19991008.html).

You can use XPath queries to: n Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 223. n Interact with an HTML element that is not stored in the repository. See Using XPath queries in statements, page 225.

Note: XPath queries can only be used for controls in web scripts.

Using the XPath search method When new HTML controls in web applications are added to the application repository, the XPath search method is selected in the control properties by default. This search method uses an XPath query to search for an HTML control. Each control in the repository has a unique XPath, which is captured when the repository is populated. If the application changes, you can modify the XPath query for a control to make sure it is located. During playback, the XPath query is performed and QA Wizard Pro interacts with the first HTML element that matches the query. See About XPath queries, page 223. For example, a web site with a shopping cart has a Buy button for every item available for purchase. During playback, QA Wizard Pro can distinguish between the Buy buttons because each one has a unique XPath query that specifies its exact location. Keep the following in mind when using the XPath search method:

223 Using the XPath search method

n Some controls require using the XPath search method and the method cannot be changed. n If you upgrade QA Wizard Pro, some HTML controls in the application repository may use the Standard search method. If these controls are not located during playback, you can modify them to use the XPath search method. This helps improve playback accuracy by using the unique XPath for a control to specify its exact location in the HTML document hierarchy instead of the control properties and expected values criteria used by the Standard search method, which may be the same for similar HTML controls. n You can also use XPath queries in statements to interact with HTML elements not stored in the application repository. See Using XPath queries in statements, page 225. 1. Select a control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected.

2. Select XPath as the Search method. 3. Select the XPath query to use to find the control during playback.

n Relative XPath uses the original XPath captured for the control during recording. If the page has ID attributes, the XPath is truncated and uses the ID to locate the control.

n Full XPath uses the full hierarchical XPath captured for the control during recording.

n Custom XPath uses a custom XPath query. The value in the Relative XPath field is used by default, but you can modify it if the application changes. For example, if a control on a web page has a dynamic ID attribute that changes every time the web page refreshes, QA Wizard Pro may not find any control to perform the action on during playback. You can use a custom XPath that does not include the ID attribute to locate the control instead of the truncated XPath.

Note: Do not modify the XPath unless you are familiar with XPath and understand how changing QA Wizard Pro search options can impact scripts.

4. Click OK to save the changes.

Tip: To switch between relative and full XPath for multiple HTML controls at the same time, Ctrl+click them in the repository, right-click a selected control, and choose Search Method. See Changing the search method for multiple controls, page 128.

224 Using XPath queries in statements

Using XPath queries in statements Some HTML elements in web applications may not be stored in the application repository if actions cannot be performed on them when recording, they are not recognized as controls, or they are dynamic. You can use an XPath query to identify these elements in statements so QA Wizard Pro can interact with them when running web scripts. For example, use an XPath query in a checkpoint to verify that the image path for an SRC attribute on a web page matches an expected value. When adding XPath queries to statements, replace the control the action is performed on with the GetControlFromXPathQuery statement. You can also use the PerformXPathQuery statement to return an array of results that matches a specific XPath query. See GetControlFromXPathQuery, page 425 and PerformXPathQuery, page 506.

Note: You can also use the XPath search method to identify HTML controls stored in the application repository if they are not located during playback. See Using the XPath search method, page 223.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select the statement to add. 4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window that contains the element. 6. Select as the Control. 7. Select the XPath Search Criteria.

n Control Type specifies the control type to search for.

n XPath Query specifies the query to use to locate the control. You can use a text string (default), an expression, a datasheet column value, a variable, or a function that returns the query.

Note: QA Wizard Pro automatically adds the GetControlFromXPathQuery statement based on the selected search criteria. For example, the following statement uses an XPath query to locate and click a button on the WysiCorp Home window: Window("WysiCorp Home").Button(Window("WysiCorp Home").GetControlFromXPathQuery ("html[1]/body[1]/table[2]/tbody")).Click()

225 Running web scripts against different servers

8. Enter or select any additional statement information. 9. Click OK to add the statement to the script.

Running web scripts against different servers To test a web application hosted on multiple web servers, use repository variables and URL format rules to handle URL changes. This helps you successfully run scripts recorded against a different web server.

Modifying the URL with a repository variable When you use a different web server, the application URL most likely changes. To run scripts against different servers, use the URLROOT repository variable with values for each server address. For example, you need to test an application on a development server and a test server. You can add values of http://dev.example.com and http://test.example.com to the URLROOT repository variable. After the variable is set up, add it to the script and assign it the value for the server the script is running against. See About the URLROOT repository variable, page 220 and Creating repository variables, page 215.

Modifying search criteria with URL format rules By default, QA Wizard Pro uses the URL of a web page as a search criteria. To ensure that windows and controls are located during playback, use URL format rules to search on individual parts of the URL. For example, you recorded a script on a development server that logs in to a web page. Now, you need to run the same script on a test server. The script fails on the because the application repository was populated with information associated with the development server, not the test server. You can create a URL format rule that searches for only the specific part of the URL that does not change. If you create a URL format rule to search for the login. file value, QA Wizard Pro skips the server information in the URL and the script runs correctly.

226 Using URL format rules

See Creating URL format rules, page 227.

Using URL format rules If you are testing a web application with dynamic URLs, you may have to modify the application repository so QA Wizard Pro can locate controls during playback. If a control property, such as Href, URL, or Src, is selected as search criteria and the expected value contains a URL, QA Wizard Pro cannot locate the control when the URL changes because the expected and actual URLs are different. Dynamic URLs may also cause QA Wizard Pro to add the same web page and controls to the application repository multiple times, which makes the repository unmanageable over time. To handle this scenario, you can create URL format rules to compare, ignore, or perform regular expression searches on individual parts of URLs, such as the domain and parameters. For example, if a URL has a session ID parameter, you can create a URL format rule to ignore the parameter. During playback, QA Wizard Pro ignores the session ID parameter and searches for controls based on the rest of the URL. If you are testing a web application hosted on different web servers, you can create a URL format rule that compares the domain name in URLs to multiple domain names specified in a regular expression. QA Wizard Pro successfully locates a control if the domain matches a value returned by the regular expression. See Running web scripts against different servers, page 226. URL format rules can also be automatically applied to window and control properties captured when you record scripts or populate the repository. For example, if a URL format rule ignores the session ID parameter and formats are automatically applied during recording, URLs for control properties added to the repository do not include the session ID. You can create rules and apply them globally to all URLs in control properties for an application version, including existing controls in the repository. See Creating URL format rules, page 227. You can also modify control properties individually to specify URL format rules to apply during playback. See Editing URL format rules in control properties, page 230.

Creating URL format rules If you are testing a web application hosted on different web servers, you can create a URL format rule that compares the domain name in URLs to multiple domain names specified in a regular expression. QA Wizard Pro successfully locates a control if the domain matches a value returned by the regular expression. See Running web scripts against different servers, page 226. Use URL format rules to specify how to handle parts of dynamic URLs. This allows QA Wizard Pro to locate controls when the URL changes. Format rules can always be applied to URLs or only be applied when URLs meet specified conditions. See Using URL format rules, page 227. Following is an example of a dynamic URL: http://www.wysicorp.com/wysicrm/news/2008/index.htm?date=20081015&lang=en#latest The parameters in this URL are likely to change after recording, which may cause scripts to fail if control properties used as search criteria use this URL as the expected value. You can create URL format rules to ignore specific parameters during playback. Following are the parts of the URL you can create format rules for.

227 Creating URL format rules

Part Description Example

Protocol Protocol used to retrieve the requested page from the web server http

Domain Domain where the web server is hosted www.wysicorp.com

Path Location on the web server wysicrm news 2008

File File requested from the web server index.htm

Parameters Name/value pair appended to a URL that passes information from the date=20081015 browser to the web server; parameters start with a question mark (?) lang=en and are separated by ampersands (&)

Anchor Named anchor, or bookmark, that identifies an internal section of a latest web page; anchors start with a pound sign (#)

1. Select a web application version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the URL Formats tab.

3. Click Add. An empty row is added to the Rules list. 4. In the new row, select or enter a Part.

Note: If the URL path has multiple levels, you can specify each path value separately. For example, if the path is three levels deep, add Path(1), Path(2), and Path(3) parts. Any values entered except Protocol, Domain, Path, File, or Anchor are interpreted as URL parameters.

5. Select an Action.

228 Applying URL format rules

n Equals searches for exact matches to the expected value. This is the default action.

n Starts with searches for values that begin with the expected value.

n Ends with searches for values that end with the expected value.

n Contains searches for values that include the expected value.

n Matches regex searches for values in the URL part based on a regular expression. QA Wizard Pro supports .NET regular expressions.

n Exists verifies the expected value exists. This action is only available for anchors and parameters.

n Ignore ignores the part. This action is only available for anchors and parameters. 6. Enter the Expected Value. QA Wizard Pro searches for the expected value in the URL and applies the rule if it is found. An expected value is not required if Exists or Ignore is selected in the Action column.

Tip: If repository variables are configured for the application version, you can use them in URL format expected values. Repository variables are displayed on the Repository Variables tab in the version Properties dialog box. See Creating repository variables, page 215.

7. Select a Condition to indicate when to apply the rule to URLs.

n Always applies the rule to all URLs. This is the default condition.

n When applies the rule to URLs based on a specified condition. If you select When, a nested row is added under the current row. Select an Action and enter the URL to apply the rule to. 8. Optionally click Apply Formats to update URLs in the repository. See Applying URL format rules, page 229. 9. Optionally select Automatically apply formats during record to apply the rules during future recording sessions. If this option is selected, the action of every control property with a URL value in the application version is set to Matches format. The format rules are applied when controls are added to the repository after recording or populating. 10. Click OK to save the changes.

Applying URL format rules If URL format rules are defined for an application version, you can apply them to all existing windows and controls in the version in the application repository. Applying URL formats compares the format rules to all control properties with URL expected values and updates each URL if the rule conditions apply.

Note: If you need to create a URL format rule, see Creating URL format rules, page 227.

1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the URL Formats tab. 3. Click Apply Formats. The Repository Changes dialog box opens. Windows and controls with URL format changes are displayed. See Reviewing and saving repository changes, page 116.

229 Editing URL format rules

4. Click Save to save the repository changes. The repository is updated. 5. Click OK to close the Properties dialog box.

Editing URL format rules You can edit URL format rules and apply changes to existing control property values in the application repository.

Note: For information about editing format rules for individual control properties, see Editing URL format rules in control properties, page 230.

1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the URL Formats tab. 3. Click a value and make any changes. 4. Optionally click Apply Formats to update URLs in existing control properties in the version in the application repository. See Applying URL format rules, page 229. 5. Click OK to save the changes.

Editing URL format rules in control properties If you only need to change the URL format for a few controls in the repository, you can modify each control individually.

230 Editing URL format rules in control properties

You can set window and control properties that use URL expected values, such as Href, URL, and SRC, to match a specified format during playback. URL format rules let you to specify how to handle parts of dynamic URLs, such as domain and parameters. This allows QA Wizard Pro to locate controls during playback, even when the URL changes. For example, if a URL has a session ID parameter, you can create a URL format rule to ignore the parameter. During playback, QA Wizard Pro ignores the session ID parameter and searches for controls based on the rest of the URL.

Tip: You can also create and apply URL format rules to all window and control properties in the application repository for a version. See Editing URL format rules, page 230.

1. Select a window or control in the Application Repository pane and choose File > Properties. The Properties dialog box opens with the Search Method tab selected. 2. In the row for the property with the URL in the expected value, select Matches format as the Action used to search for the URL. 3. Mouse over the URL in the Expected Value column and click Edit. The Edit URL Format dialog box opens. The following information is displayed for each part of the URL:

n Part—URL part name.

n Action—How QA Wizard Pro searches for the expected value in the URL.

n Expected Value—Value QA Wizard Pro searches for in the URL based on the selected action.

Note: Click Edit URL to modify the expected URL. See Editing window and control properties, page 126.

4. Select an Action to specify how QA Wizard Pro searches for the expected value.

n Equals searches for exact matches to the expected value in the URL part. This is the default action.

n Starts with searches for values in the URL part that begin with the expected value.

n Ends with searches for values in the URL part that end with the expected value.

231 Deleting URL format rules

n Contains searches for values in the URL part that include the expected value.

n Matches regex searches for values in the URL part based on a regular expression. QA Wizard Pro supports .NET regular expressions.

n Exists verifies the expected value exists in the URL part. This action is only available for anchors and parameters.

n Ignore ignores the URL part. This action is only available for anchors and parameters. 5. Enter the Expected Value. QA Wizard Pro searches for the expected value in the URL and applies the rule if it is found. An expected value is not required if Exists or Ignore is selected in the Action column.

Tip: If repository variables are configured for the application version, you can use them in URL format expected values. Repository variables are displayed on the Repository Variables tab in the version Properties dialog box. See Creating repository variables, page 215.

6. Click OK to save the changes. 7. Click OK to close the Properties dialog box.

Deleting URL format rules You can delete URL format rules that are no longer used. 1. Select a version in the application repository and choose File > Properties. The Properties dialog box opens. 2. Click the URL Formats tab. 3. Select the rule you want to delete. 4. Click Delete. You are prompted to confirm the deletion. 5. Click Yes. The rule is deleted.

Note: If a URL property, such as URL, Href, or Src is selected as search criteria and you delete a URL format rule, you need to manually update the search criteria if you no longer want the URL to match a specific format. In the window or control Properties dialog box, change the Matches format value in the Action column to another action. See Modifying window and control properties, page 122.

232 Testing Nested Controls

QA Wizard Pro can perform actions on controls that are nested in other controls. For example, you may want to test different items in a combo box on a toolbar. The best way to create scripts that test nested controls is to record them, but you can also manually add or modify statements. During recording, only container controls, which are the highest level control in the nesting hierarchy, are added to the application repository.

Supported nested controls Container controls are controls that have other controls and items nested in them. When recording scripts, container controls are added to the application repository. QA Wizard Pro uses container controls to locate nested controls. QA Wizard Pro recognizes the following control types as container controls:

n ComboBox n ListBox n Menu n ToolBar

n Grid n ListView n TabBar n Tree

Adding statements to test nested controls You can add statements to perform actions on controls nested in other controls in applications. For example, you can add a ClearCheckBox statement to clear a nested checkbox item in a listbox control. You can also create checkpoints for nested controls. See Nested control object action examples, page 234. 1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select a statement in one of the following categories: Checkpoint, Integrated Actions, Keyboard Actions, Mouse Actions, Object Actions, or Touch Actions. 4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window that includes the nested control. A screenshot of the selected window is displayed. 6. Select the container control as the Control. The selected container control is outlined with a red box in the screenshot.

233 Nested control object action examples

7. Click Add Control to add a nested control to perform the action on. Controls can be deeply nested in other controls. You must add each control in the hierarchy until you reach the control to perform the action on. 8. Select the control type for the nested control. 9. Enter the Index that identifies the nested control. You can use a value or text string (default), an expression, a variable, or a function that returns the value. 10. To remove a nested control from the statement, click Remove Control. 11. Enter or select any additional statement information. 12. Enter an optional Comment, such as the purpose of the statement. 13. Click OK to add the statement to the script.

Nested control object action examples The following examples show statements that perform actions on nested controls.

Note: The examples show the statement syntax as you would enter it in Text View. You can also use the Add Statement dialog box to add these statements and view the result statement in Keyword View.

Setting a check box in a combo box In this example, a check box is set in a combo box. The Set statement selects the Abby Adams check box in the activeUsersComboBox combo box in the WysiCorp CRM window.

234 Nested control object action examples

Window("WysiCorp CRM").ComboBox("activeUsersComboBox").Item("Abby Adams").CheckBox().Set ()

Setting a check box in a grid cell In this example, a check box in a grid cell is selected. The Set statement selects the check box in the cell in the first row of the Photo Column in the accountsDataGridView grid in the WysiCorp CRM window. Window("WysiCorp CRM").Grid("accountsDataGridView").Cell(1, "Photo").CheckBox().Set()

Setting a check box in a list box In this example, a check box item in a list box is selected. The Set statement checks the wysi_Develop item in the only check box in the checkedListBoxProductInterest list box in the WysiCorp CRMContact window. Window("WysiCorp CRMContact").ListBox("checkedListBoxProductInterest").Item("wysi_ Develop").CheckBox().Set()

Double-clicking an item in a list view In this example, an item is double-clicked using the text of its first two subitems. The ListView has multiple rows with an item named Susan so you need to identify another column to uniquely identify the item to double- click. The DoubleClick statement double-clicks the item named Susan that has an additional column value of Sales. Window("WysiCorp CRM").ListView("listViewContacts").Item("Susan/Sales").DoubleClick()

Note: If the item text in the application includes slashes, you must escape them in the statement with a double backslash (\\), For example, if a row has a column with Item/Number in one column and ID in the second column, you must add a double backslash in front of the slash in Item/Number to make it Item\\/Number/ID. If a column includes the text Item\Number, the text in the statement needs to be changed to Item\\\Number/ID.

Selecting a combo box item in a menu In this example, an item is selected from a combo box nested in a menu. The Select statement selects the Inactive item in the first combo box in the Account Type menu. Window("WysiCorp CRM").Menu("menuBar").Item("Edit/Account Type").Menu().Item(1).ComboBox ().Item("Inactive").Select()

Selecting a tab in a tab bar In this example, a tab is selected in a tab bar. The Select statement selects the Contacts tab in the tabControl tab bar in the WysiCorp CRM window. Window("WysiCorp CRM").TabBar("tabControl").Tab("Contacts").Select()

Setting text in a combo box on a toolbar In this example, text is entered in a combo box in a toolbar. The SetText statement enters the word Verdana in the combo box with an index value of 2 in the formattingToolStrip toolbar in the WysiWrite window. Window("WysiWrite").ToolBar("formattingToolStrip").Item(2).ComboBox().SetText("Verdana")

Setting a check box in a tree In this example, a check box in a tree is selected. The Set statement selects the Web Client item in the

235 Nested control object action examples

Software Development tree item in the WysiCorp CRM window. Window("WysiCorp CRM").Tree("treeViewProducts").Item("Software Development/Web Client").CheckBox().Set()

236 Testing HTML Tables

During recording, HTML tables are added to the application repository as controls. If QA Wizard Pro recognizes controls in tables, they are also added to the repository. In some cases, you may need to test a table element that is not in the repository, such as text in a cell, or search for a control during playback because the table contents are dynamic. You can identify search criteria that is used during playback to find a control in a specific cell and perform an action on it. QA Wizard Pro can perform the following actions on HTML tables: n Perform mouse actions on tables, cells, and controls in cells, and perform keyboard actions on controls in cells. For example, click a button in a table cell. See Adding statements to test HTML tables, page 237. n Verify table properties and cell contents against expected values during playback using control checkpoints. For example, verify text in a cell against an expected value. See Creating HTML table checkpoints, page 240. n Determine if a table or control in a cell exists in the application during playback. For example, verify that an edit box is in a specific cell before text is entered. See Creating HTML table checkpoints, page 240. n Retrieve control property values during playback based on table row and column position. See Capturing HTML table control property values during playback, page 244. n Find a row or column in a table that includes a specific control. See Finding HTML table row and column index values, page 244.

Adding statements to test HTML tables QA Wizard Pro can perform mouse action statements, such as Click and Mouse Move, on HTML tables, cells, and controls in cells. When you add a statement to an HTML table, you identify search criteria to help QA Wizard Pro locate the control to perform the action on it during playback. The search criteria is identified in the GetControlFromTable statement, which is used in place of the control name in statements. See Using the GetControlFromTable statement, page 243. QA Wizard Pro automatically adds the GetControlFromTable statement to mouse actions in the Add Statement dialog box, but you can also add it when modifying scripts in Text View.

Note: You may need to use multiple GetControlFromTable statements to add mouse and keyboard action statements to nested HTML tables. See Testing nested HTML tables, page 245.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select a statement in the Mouse Actions category. 4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window that includes the table.

237 Adding statements to test HTML tables

A screenshot of the selected window is displayed. 6. Select the table as the Control. The selected table is outlined with a red box in the screenshot.

7. Click Table Data to select the control search criteria. The Child Control Search Criteria dialog box opens.

8. Enter the Row Index and Column Index to search.

238 HTML table object action statement examples

You can use integers, script variables, or the ANYROW and ANYCOLUMN constant variables, which search all rows and columns in the table. The index of the first table row and column is 1.

Note: If the table is dynamic, use the GetColumnFromRowIndex or GetRowFromColumnIndex statements to find the row index or column index during playback. See Finding HTML table row and column index values, page 244.

9. Select the Control Type to search for. The HTMLElement control type can be used to search for table cells or other HTML elements, such as

tags, that are not recognized as controls. 10. Select a Property, Action, and Expected Value to use to identify the control. A control must be unique for QA Wizard Pro to differentiate it from other controls in the table. Select at least one property if the table includes more than one instance of the selected control type. See Modifying window and control properties, page 122 for information about configuring control search criteria.

Tip: Selecting the Tag ID property generally helps refine the search for the control.

11. Select any additional properties to perform a more specific search. 12. Click OK. A summary of the search criteria is displayed in the Child Control Search Criteria field. 13. Select Context Menu Item to perform the action on a context menu item. See Testing context menus, page 144. 14. Enter or select any additional statement information. 15. Click OK to add the statement to the script.

HTML table object action statement examples The following examples show script steps that click a control in an HTML table cell that includes a single control or multiple controls.

Clicking a control in cells with a single control In this example, a control is clicked in a table cell that only includes one control. The Click statement clicks the HTMLLink in the first row and second column of the Address table in the Data Entry window. The GetControlFromTable statement is used to locate the HTMLLink control. Window("Data Entry").HTMLLink(Window("Data Entry").HTMLTable ("Address").GetControlFromTable("HTMLLink",1,2)).Click()

Clicking a control in a cell with multiple controls In this example, a control is clicked in a table cell that includes multiple controls. The Click statement in clicks the button with a Text property value of Save in the second row and second column of the Address table in the Data Entry window. The GetControlFromTable statement is used to locate the button. The Text property and Save property value are used in the statement to locate the correct control in the cell. Window("Data Entry").Button(Window("Data Entry").HTMLTable("Address").GetControlFromTable ("Button",2,2,"Text","Save")).Click()

239 Creating HTML table checkpoints

Creating HTML table checkpoints QA Wizard Pro can perform control and exists checkpoints on HTML tables, table cells, and controls in cells. Control checkpoints verify properties of a table or contents of a specific table cell against an expected value. For example, you can verify that a table has a specific number of rows and columns. Exists checkpoints verify that a table or control in a table exists. For example, you can verify that a button is included in a table cell. See Creating checkpoints, page 169 and Creating exists checkpoints, page 171.

Note: You can also create checkpoints for HTML tables during recording. See Creating record-time checkpoints, page 166 and Creating record-time check exists checkpoints, page 168.

When you create a control checkpoint in an HTML table, you need to identify search criteria to locate the control. QA Wizard Pro uses this criteria during playback to search the table for the control to check. The search criteria is identified in the GetControlFromTable statement, which is used in place of the control name in checkpoints. See Using the GetControlFromTable statement, page 243. QA Wizard Pro automatically adds the GetControlFromTable statement to checkpoints in the Add Statement dialog box, but you can also add it when modifying scripts in Text View.

Note: You may need to use multiple GetControlFromTable statements to add checkpoints for nested HTML tables. See Testing nested HTML tables, page 245.

1. Select the script line above where to add the statement. 2. Choose Script > Add Statement. The Add Statement dialog box opens. 3. Select Checkpoint or Check Exists in the Checkpoint category. 4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext, page 534. If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list. 5. Select the Window that includes the table. A screenshot of the selected window is displayed. 6. Select the table as the Control. The selected table is outlined with a red box in the screenshot.

240 Creating HTML table checkpoints

7. Click Table Data to select the control search criteria. The Child Control Search Criteria dialog box opens.

8. Enter the Row Index and Column Index to search. You can use integers, script variables, or the ANYROW and ANYCOLUMN constant variables, which search all rows and columns in the table. The index of the first table row and column is 1.

241 HTML table checkpoint examples

Note: If the table is dynamic, use the GetColumnFromRowIndex or GetRowFromColumnIndex statements to find the row index or column index during playback. See Finding HTML table row and column index values, page 244.

9. Select the Control Type to search for. The HTMLElement control type can be used to search for table cells or other HTML elements, such as

tags, that are not recognized as controls. 10. Select a Property, Action, and Expected Value to use to identify the control. A control must be unique for QA Wizard Pro to differentiate it from other controls in the table. Select at least one property if the table includes more than one instance of the selected control type. See Modifying window and control properties, page 122 for information about configuring control search criteria.

Tip: Selecting the Tag ID property generally helps refine the search for the control.

11. Select any additional properties to perform a more specific search. 12. Click OK. A summary of the search criteria is displayed in the Child Control Search Criteria field. 13. If you are creating a context menu item checkpoint, select Context Menu Item. See Testing context menus, page 144. 14. If you are adding a control checkpoint, select the Property to check from the list. You can use a text string, constant, expression, datasheet column value, variable, or function that returns the value. 15. If you are adding a control checkpoint, enter or select the Expected Value to compare against the actual value. You can use a text string, expression, datasheet column value, variable, or function that returns the value. 16. Expand the Advanced options to indicate what happens if the checkpoint fails.

n Select the Failure Behavior. Generate an error and stop playback stops script playback, displays a message in the Errors pane, and adds the message to the run report. Generate a warning and continue playback continues running the script, displays a message in the Errors pane, and adds the message to the run report.

n Enter an Warning/failure message to display in the Errors pane and add to the run report when the checkpoint fails. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value. 17. Enter an optional Comment, such as the purpose of the statement. 18. Click OK to add the statement to the script.

HTML table checkpoint examples The following examples show script steps that verify table properties, table cell properties, and properties of controls in table cells against expected values.

Verifying table properties In this example, a checkpoint verifies the properties of an HTML table. The Checkpoint statement verifies the Address table in the DataEntry window includes two rows. If the table includes more or less than two rows,

242 Using the GetControlFromTable statement the checkpoint fails, playback stops, and "Number of rows is not 2" is displayed in the Errors pane. Window("DataEntry").HTMLTable("Address").Checkpoint("Number of Rows", 2, True, "Number of rows is not 2")

Verifying table cell properties In this example, a checkpoint verifies the properties of an HTML table cell. The Checkpoint statement verifies the Inner Text property value of the HTMLElement control in the first row and second column of the Address table in the Data Entry window matches the expected value of "Zip Code". The GetControlFromTable statement is used to locate the HTMLElement control. If the cell does not include the Zip Code text, the checkpoint fails and playback stops. Window("Data Entry").HTMLElement(Window("Data Entry").HTMLTable ("Address").GetControlFromTable("HTMLElement", 1, 2)).Checkpoint("Inner Text", "Zip Code", True, "")

Verifying properties of controls in table cells In this example, a checkpoint verifies the properties of a control in an HTML table cell. The GetControlFromTable statement is used to locate the button in the second row and third column of the Address table in the DataEntry window. The SubType property and BrowserPushButton value are used in the statement to locate the correct button in the cell. The returned control is stored in the DETAILS_BUTTON variable. The Checkpoint statement verifies the Text property value of the control stored in the DETAILS_ BUTTON variable matches the expected value of "Details". If the button does not include the Details text, the checkpoint fails and playback stops. DETAILS_BUTTON = Window("DataEntry").HTMLTable("Address").GetControlFromTable("Button", 2, 3, "SubType", "BrowserPushButton") Window("DataEntry").Control(DETAILS_BUTTON).Checkpoint("Text", "Details", True, "")

Using the GetControlFromTable statement The GetControlFromTable statement provides a way to parse an HTML table and find a specific control to interact with. The statement searches a specific table cell for a control and returns the control. The GetControlFromTable statement can be used instead of a control name in statements, which allows QA Wizard Pro to dynamically locate the correct control during playback. When you add a checkpoint, object action, or low-level action statement using the Add Statement dialog box, QA Wizard Pro automatically adds the GetControlFromTable statement based on the selected search criteria. You can also add this statement in Text View. In the following example, the GetControlFromTable statement searches for an HTMLLink control in the second column and second row of the Admin table in the Users window. Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 2) Suppose this table cell includes more than one HTMLLink control. In this case, you can also use control properties and expected values to uniquely identify the control you want to find. In the following example, the same statement is used in addition to the Inner Text property and the Details property value. During playback, QA Wizard Pro only returns the control from the cell if the Inner Text property value is Details. Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 2, "Inner Text", "Details") If QA Wizard Pro cannot locate the control using the GetControlFromTable statement, playback stops and an error is displayed the Errors pane.

243 Capturing HTML table control property values during playback

Note: Use multiple GetControlFromTable statements to locate controls in nested tables. See Testing nested HTML tables, page 245.

Capturing HTML table control property values during playback You can use the Property statement to capture and return the property values from controls during playback. The returned value can be used anywhere in the script. For example, you can capture the number of rows in a table, store the value in a variable, and use the variable in a For...Next statement to loop through script steps for each table row. In the following example, QA Wizard Pro returns the value of the Number of Rows property for the Address table in the Contacts window. The value is stored in the ROWS variable. ROWS = Window("Contacts").HTMLTable("Address").Property("Number of Rows") The Property statement can also be used with the GetControlFromTable statement to return the property value of a control in an HTML table cell. The GetControlFromTable statement searches a specific table cell for a control and returns the control. It can be used instead of a control name in statements, which allows QA Wizard Pro to dynamically locate the correct control during playback. You can also use the data retrieved using the GetControlFromTable statement to control loops and conditional statements. In the following example, the GetControlFromTable statement searches for an HTMLLink control in the second row and third column of the Admin table in the Users window. Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 3) Suppose this table cell includes more than one HTMLLink control. In this case, you can also use control properties and expected values to uniquely identify the control you want to find. In the following example, the same statement is used in addition to the Inner Text property and the Details property value. During playback, QA Wizard Pro only returns the control from the cell if the Inner Text property value is Details. Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 3, "Inner Text", "Details")

Finding HTML table row and column index values If you are testing dynamic HTML tables, you may need to retrieve the row or column index from a table during playback to use in the GetControlFromTable statement. QA Wizard Pro includes the following statements for finding row and column indexes in HTML tables:

FindColumnByRowIndex Searches an HTML table row to locate a cell or control in a cell that matches property values and returns the column index of the cell. See FindColumnByRowIndex, page 415. Window("WindowName").Control("ControlName").FindColumnByRowIndex(SearchRowIndex, "PropertyName", "ExpectedValue", ...)

FindRowByColumnIndex Searches an HTML table column to locate a cell or control in a cell that matches property values and returns the row index of the cell. See FindRowByColumnIndex, page 416. Window("WindowName").Control("ControlName").FindRowByColumnIndex(SearchColIndex, "PropertyName", "ExpectedValue", ...)

244 Testing nested HTML tables

Note: If the control is not found, -1 is returned as the index value.

Example Suppose you are testing a web page that includes a table with hyperlinks to documents in a database. When a document is added to the database, a new row with the document ID and hyperlink is added to the table. You want to click the hyperlink that corresponds to a specific document ID, which the script pulls from a local datasheet. The hyperlink is always in the second column in the table, but you do not know the row index because the table is dynamic. In the following example, the document ID is stored in a variable named ID. The FindRowByColumnIndex statement finds the row index of the cell in the List table in the Documents window that contains an Inner Text property value that matches the value of the ID variable. The row index is stored in a variable named ROWINDEX, which is used in the Click statement to indicate the row index of the cell that includes the hyperlink to click. ID = Cell("D") ROWINDEX = Window("Documents").HTMLTable("List").FindRowByColumnIndex(1, "Inner Text", ID) Window("Documents").HTMLLink(Window("Documents").HTMLTable("List"). GetControlFromTable ("HTMLLink", ROWINDEX, 2)).Click()

Testing nested HTML tables When QA Wizard Pro performs a GetControlFromTable statement during playback, tables are searched recursively. Parent tables are searched first followed by any nested tables. In some rare cases, QA Wizard Pro may not locate a control in a nested table because the same control is located in the same cell in the parent table and nested table. If a control in a nested table cell has the same property and value as a control in the parent table but has different row and column indexes than the parent table, QA Wizard Pro can usually locate the correct control in the nested table. If a parent table cell and nested table cell both include a control with the same property, value, row index, and column index, you need to use nested GetControlFromTable statements to locate the nested table and then locate the control in the nested table.

Note: Use Text View to create nested GetControlFromTable statements.

For example, the Items table includes a nested table in the fourth column. You want to click a button with a Text property value of Buy in the first row and fourth column of the nested table. The parent table includes a button with the Text property of Buy, but it is in the second row and second column. In this case, you can use a single GetControlFromTable statement in the Click statement to locate the control. Window("Cart").Button(Window("Cart").HTMLTable("Items").GetControlFromTable("Button", 1, 4, "Text", "Buy")).Click() If the parent table and nested table both include buttons with a Text property value of Buy in the first row and fourth column, the button in the parent table is clicked because QA Wizard Pro finds it before the button in the nested table. To locate the button in the nested table, you need to use nested GetControlFromTable statements. For example: Window("Cart").Button(Window("Cart").HTMLTable(Window("Cart").HTMLTable ("Items").GetControlFromTable("HTMLTable", 2, 2)).GetControlFromTable("Button", 1, 4, "Text", "Buy")).Click()

245 Nested HTML table examples

The inner GetControlFromTable statement searches for an HTMLTable control in the second row and second column of the Items table in the Cart window. This is the nested table. The outer GetControlFromTable statement searches for a Button control with a Text property of Buy in the first row and fourth column of the HTML table located by the inner GetControlFromTable statement. The Click action is performed on this control.

Nested HTML table examples The following examples show how nested GetControlFromTable statements are used to perform actions on nested tables.

Clicking a control in a nested table cell In this example, a button in a nested table cell is clicked. n The inner GetControlFromTable statement searches for an HTMLTable control in the first row and fourth column of the Rank table in the Statistics window. This is the nested table. n The outer GetControlFromTable statement searches for a Button control with a Text property of Details in the third row and third column of the table returned by the inner GetControlFromTable statement. The returned button is clicked. Window("Statistics").Button(Window("Statistics").HTMLTable(Window("Statistics").HTMLTable ("Rank"). GetControlFromTable("HTMLTable", 1, 4)).GetControlFromTable("Button", 3, 3, "Text", "Details")).Click()

Verifying nested table cell control properties In this example, a checkpoint verifies that text in a nested table cell matches an expected value. n The inner GetControlFromTable statement searches for an HTMLTable control in the third row and third column of the Rank table in the Statistics window. This is the nested table. n The outer GetControlFromTable statement searches for an HTMLElement control in the third row and third column of the table returned by the inner GetControlFromTable statement. n The Inner Text property of the returned HTMLElement control is verified against the expected value, which is Search Result. Window("Statistics").HTMLElement(Window("Statistics".HTMLTable(Window ("Statistics").HTMLTable("Rank").GetControlFromTable("HTMLTable", 3, 3)).GetControlFromTable("HTMLElement", 2, 1).Checkpoint("InnerText", "Search Result", True, "")

Finding nested table columns by row index and value In this example, the column index for a cell is returned from a nested table based on a specific row and property value. n The GetControlFromTable statement searches for an HTMLTable control in the first row and fourth column of the Rank table in the Statistics window. This is the nested table. n The FindColumnByRowIndex statement returns the column index of a control with a Text property value of Activities in the fifth row of the table returned by the GetControlFromTable statement. This value is saved in the columnIndex variable.

246 Nested HTML table examples

columnIndex = Windows("Statistics").HTMLTable(Window("Statistics").HTMLTable ("Rank").GetControlFromTable("HTMLTable",1,4)).FindRowByColumnIndex (5,"Text","Activities")

Finding nested table rows by column index and value In this example, the row index for a cell is returned from a nested table based on a specific column and property value. n The GetControlFromTable statement searches for an HTMLTable control in the second row and second column of the Rank table in the Statistics window. This is the nested table. n The FindRowByColumnIndex statement returns the row index of a control with a Text property value of Scores in the first column of the table returned by the GetControlFromTable statement. rowIndex = Window("Statistics").HTMLTable(Window("Statistics").HTMLTable ("Rank").GetControlFromTable("HTMLTable", 2, 2)).FindRowByColumnIndex(1, "Text", "Scores")

Retrieving property values from nested table cells In this example, the Property statement is used to return a property value from a specific cell in a nested table. This value is returned to a variable. n The inner GetControlFromTable statement searches for an HTMLTable control in the first row and fifth column of the Rank table in the Statistics window. This is the nested table. n The outer GetControlFromTable statement searches for a Button control with a Subtype property value of BrowserPushButton in the first row and third column of the table returned by the inner GetControlFromTable statement. n The Property statement returns the Text property of the Button control to the VALUE variable. myValue = Window("Statistics").Button(Window("Statistics").HTMLTable(Window ("Statistics").HTMLTable("Rank").GetControlFromTable("HTMLTable", 1, 5)).GetControlFromTable("Button", 1, 1, "Subtype", "BrowserPushButton").Property("Text")

247

Running Scripts on Remote Computers

You can distribute automated testing across remote computers to more quickly run through tests. For example, you can run a script on a computer in your QA lab to test it on an operating system that you do not have installed locally. Before you can run scripts remotely, you must configure remote computers and start QAWRemote.exe. See Configuring remote computers, page 249 and Starting QAWRemote.exe, page 250. After the remote configurations are set up, you can run individual or multiple scripts remotely. See Running scripts remotely, page 250 and Running multiple scripts remotely, page 251.

Configuring remote computers Before you can run scripts remotely, you need to configure the remote computer options.

Note: Each remote computer must have QA Wizard Pro installed, QAWRemote.exe running, and a valid license.

1. Choose Tools > Options. The Options dialog box opens. 2. Click the Remote Computers tab.

3. Click Add to add a remote computer.

n Enter a Name. This can be the computer name or another descriptive name.

n Enter the Hostname or IP Address.

n Enter the Port Number. The default is 6001.

n Click OK. 4. Select a computer and click Test to test the connection. If the connection fails, check the information you entered and retest the connection. 5. Select a computer and click Edit to change the name, hostname or IP address, or port number. 6. Select a computer and click Delete to delete it. 7. Click OK to save the changes.

249 Starting QAWRemote.exe

Note: Scripts use the playback options set on the remote computer, which you may need to change. See Setting playback options, page 76.

Starting QAWRemote.exe QAWRemote.exe, which is used to run scripts remotely, must be started on the remote computer. See Running scripts remotely, page 250. 1. Browse to the QA Wizard Pro directory on the remote computer. Double-click qawremote.exe.

Running scripts remotely You can run scripts remotely to distribute automated tests across multiple computers and more quickly run tests. For example, you can run a script on a computer in your QA lab to test it on a different operating system version. Keep the following in mind before you run scripts remotely: n A QA Wizard Pro license must be available on each remote computer. n Remote playback is only supported through QAWRemote.exe, which must be started on the remote computer. See Starting QAWRemote.exe, page 250. n If you are testing a web application, the web server can be hosted on another computer, but the browser must be installed on the computer running the script. n The remote computer must have access to the application in the global or local repository. n If scripts include CallScript statements, the called script name must be a text string. n If an OpenRecordset statement is used to access a local datasheet, the datasheet name must be a text string. Variables and other expressions are not supported. 1. Open the script to run remotely and choose Script > Run Remote.

Note: If a script is set as the main script for the workspace, you can run it remotely without opening it. Choose Script > Run Main Script Remote. See Setting and running a main script, page 74.

The Run Remote dialog box opens.

2. Select the remote computer. Click Add if you need to add a remote computer. See Configuring remote computers, page 249.

250 Running multiple scripts remotely

3. Select Monitor remote run to automatically start the status tool when remote scripts run. This lets you monitor script playback line-by-line. See Viewing playback information in the status tool, page 99. 4. Click OK. The script runs on the remote computer. A dialog box opens to confirm the script is running.

Note: You may be prompted to enter information before playback starts, such as a session name, repository variable values, or server login credentials. See Running scripts, page 73.

5. Click OK to close the dialog box. When the script finishes running, the run report is saved on the remote computer in C:\Users\\Documents\My Documents\QA Wizard Reports.

Note: If you want to email the results and run report, you must configure email notifications on the remote computer. See Setting email notification options, page 44.

Running multiple scripts remotely You can run multiple scripts on remote computers. For example, run scripts on multiple computers simultaneously to perform tests while you work on other tasks.

Note: QA Wizard Pro must be installed and QAWRemote.exe must be running on the remote computer. To start QAWRemote, double-click the executable in the QA Wizard Pro directory. The remote computer must also have access to the tested application in the global or local application repository.

1. Choose Script > Run Multiple Remote. The Select Scripts dialog box opens. 2. Select the scripts you want to run and click to add them to the Selected scripts list. To remove a script, select it in Selected scripts list and click .

3. Select a script and click , , , or to reorder the list. Scripts run in the order displayed. 4. Click Run.

251 Running multiple scripts remotely

The Run Remote dialog box opens.

5. Select the remote computer. Click Add to add a remote computer. See Configuring remote computers, page 249. 6. Click OK. The scripts run on the remote computer. A confirmation dialog box opens.

Note: You may be prompted to enter information before playback starts, such as a session name, repository variable values, or server login credentials. See Running scripts, page 73.

7. Click OK to close the dialog box. When playback finishes, the run report is saved on the remote computer in C:\Users\\Documents\My Documents\QA Wizard Reports. To email the results and run report, you must configure email notifications on the remote computer. See Setting email notification options, page 44.

Tip: Use the dashboard or status tool to monitor remote script playback. See Viewing playback information in the dashboard, page 90 and Viewing playback information in the status tool, page 99.

252 Managing the QA Wizard Pro Server

The QA Wizard Pro Server stores global application data and hosts the server database, which stores historical playback data, in a central location. The server is hosted on a computer that can be accessed over a network. See Installing the QA Wizard Pro Server, page 253. The QA Wizard Pro Server is required to: n Use the global application repository to provide access to application data to multiple users. n Use the dashboard to monitor playback information and statistics in a web browser. n Use the status tool to review script playback line-by-line. n Integrate with the Helix ALM Data Warehouse to create reports using third-party reporting tools. QA Wizard Pro clients that connect to the server do not need access to the directory where data is stored on the server computer. QA Wizard Pro communicates directly with the server through TCP/IP, and the server manages the global repository files and server database.

Server administration You can use the QA Wizard Pro Server Admin Utility to perform the following tasks. n Change the global repository directory and port number n Enable ALM Data Warehouse integration n Change the server database to a different type or location n Remove playback data from the server database n Set or change the playback data removal password

Installing the QA Wizard Pro Server The QA Wizard Pro Server application must be installed on a networked Windows computer. It does not require a QA Wizard Pro license or QA Wizard Pro to be installed on the server computer. To install the server application and admin utility, run the QA Wizard Pro installer and select the QA Wizard Pro Server option. The QAWServer directory is created in the root directory of the server computer the first time the server starts. For example, if you install the QA Wizard Pro Server in the C:\Program Files (x86)\Perforce\QA Wizard Pro directory, the server directory is C:\QAWServer. The server directory stores global application data and the server database. A SQLite server database (QAWServer.db) is automatically created in this directory. You can use this database to store playback data or use a Microsoft SQL Server, Oracle, or PostgreSQL database. See Configuring the server database, page 255. If you upgraded QA Wizard Pro, a backup copy of the global repository is created in the server directory and named with the highest version number (for example, repositoryV3). If you upgraded from QA Wizard Pro 2011.0 or earlier, the default server directory is named QAWRepository.

Note: Users must configure a connection to the server before they can access it. See Setting server connection options, page 43.

253 Starting the QA Wizard Pro Server

Starting the QA Wizard Pro Server The QA Wizard Pro Server application (QAWServer.exe) runs as a Windows service and starts automatically when the server computer starts. If the server does not start, you can manually start it. Refer to the Windows documentation for information about starting a service.

Starting the QA Wizard Pro Server Admin Utility Choose Start > Programs > Perforce > QA Wizard Pro > QA Wizard Pro Server Admin.

Configuring general server options You can change the directory where global application data is stored on the server computer and the port QA Wizard Pro clients use to connect to the server if the default port is already in use. You can also enable Helix ALM Data Warehouse integration. ALM Data Warehouse communicates with the Helix ALM License Server to retrieve data from the QA Wizard Pro server database and imports the data to the data warehouse. The data can be used for creating reports using third-party reporting tools, such as SQL Server Reporting Services (SSRS) and Oracle Reports. See the Helix ALM Data Warehouse help for information. 1. Start the QA Wizard Pro Server Admin Utility. 2. Click Server Options. The Server Options dialog box opens. 3. Click the General tab.

4. Enter the TCP/IP port number for QA Wizard Pro clients to use to connect to the global repository. The default port is 8002.

254 Configuring the server database

5. Enter the Repository directory to store global repository data in or click Browse to select a location. The default repository directory is the QAWServer directory at the root of the server computer (e.g., C:\QAWServer).

Note: If you upgraded from QA Wizard Pro 2011.0 or earlier, global application data is in the QAWRepository directory.

6. Select Enable ALM Data Warehouse integration to import QA Wizard Pro data to the data warehouse for reporting purposes. Enter the Helix ALM License Server address, port, and communications password. Leave the communications password empty if the license server does not require it. 7. Click Save to save the changes. You must restart the QA Wizard Pro Server for the changes to take effect. See Starting the QA Wizard Pro Server, page 254.

Configuring the server database The QA Wizard Pro Server stores playback data in a Relational Database Management System (RDBMS). SQLite is the default RDBMS and does not require any setup or configuration before or after installation. The server database is created automatically when the server starts, but you can change the database location. You can also use a Microsoft SQL Server, Oracle, or PostgreSQL database for the server database, but you must create an empty database before configuring it in QA Wizard Pro. See Setting Up RDBMS Databases, page 317.

Note: If you change the server database, data in the current server database is not copied to the new database. You should not need to change the database location frequently.

1. Start the QA Wizard Pro Server Admin Utility. 2. Click Server Options. The Server Options dialog box opens. 3. Click the Database tab.

4. Select the database Type. 5. Enter the database Options. The available options depend on the selected database type.

255 Removing playback data

Database Options type

SQLite By default, the Database file path is set to the QAWServer.db database file that is automatically created in the C:\QAWServer directory. If you moved the database file to a different directory, click Browse to select the database location. You can also select a different directory to automatically create a new database file in when the server restarts.

Microsoft Enter the Server address, Server port, and Database name for the database you SQL Server created. Select an authentication method to use to connect to the database. Use Windows Authentication uses the username and password of the logged in user on the server computer. Use SQL Server Authentication uses the provided SQL Server User and Password.

The database configuration may affect playback data removals. See Incorrect Playback Sessions May Be Removed from QA Wizard Pro SQL Server Databases.

Oracle Enter the Server address, Server port, and Service name for the database you created and the Oracle User and Password to connect to it.

PostgreSQL Enter the Server address, Server port, and Database name for the database you created. Select an authentication method to use to connect to the database. Use Windows Authentication uses the username and password of the logged in user on the server computer. Use PostgreSQL Server Authentication uses the provided PostgreSQL User and Password.

6. Click Save to save the changes. You must restart the QA Wizard Pro Server for the changes to take effect. See Starting the QA Wizard Pro Server, page 254.

Removing playback data You can remove unneeded historical playback data captured from QA Wizard Pro applications that send information to the server. This helps remove outdated and unimportant information from the QA Wizard Pro dashboard and status tool and frees up space in the server database. For example, you can remove inactive and canceled playback sessions to make it easier to focus on failed and succeeded sessions. You can schedule automatic removals of playback data at a set time or on a regular basis. You can also manually remove data. n To schedule data removal or manage scheduled removals, click Data Removal Schedule. See Scheduling playback data removal, page 257. n To manually remove data, click Data Removal. See Manually removing playback data, page 261.

Tip: You can set a password to prevent unauthorized data removal. See Changing the playback data removal password, page 262.

256 Scheduling playback data removal

Scheduling playback data removal You can schedule automatic removal of unneeded playback data at a set time or on a regular basis. Scheduling removals can help reduce manual effort to remove unimportant information from the dashboard and status tool, and free up space in the server database. You can also manually remove playback data. See Manually removing playback data, page 261.

Note: If the server database is hosted in SQL Server, the database configuration may cause important playback data to be unintentionally removed. Review Incorrect Playback Sessions May Be Removed from QA Wizard Pro SQL Server Databases before removing data.

1. Start the QA Wizard Pro Server Admin Utility. 2. Click Data Removal Schedule. The Data Removal Schedule dialog box opens.

3. Click Add to schedule a removal. See Adding scheduled playback data removals, page 257. 4. Select a scheduled removal and click Edit Filter to change the sessions it removes. See Editing scheduled playback data removal filters, page 259. 5. Select a scheduled removal and click Edit Schedule to change the schedule for removing data. See Editing playback data removal schedules, page 260. 6. Select a scheduled removal and click Delete to delete it. See Deleting scheduled playback data removals, page 260. 7. Click Close when you finish.

Adding scheduled playback data removals You can schedule automatic removal of unneeded playback data from the QA Wizard Pro Server at a set time or on a regular basis. For example, you can schedule to remove all canceled playback sessions at the end of each day or remove all sessions run on a computer used only for script debugging once a week. Removed playback data is permanently deleted from the database and cannot be restored or viewed in the dashboard or status tool.

Note: If the server database is hosted in SQL Server, the database configuration may cause important playback data to be unintentionally removed. Review Incorrect Playback Sessions May Be Removed from QA Wizard Pro SQL Server Databases before removing data.

1. Start the QA Wizard Pro Server Admin Utility.

257 Adding scheduled playback data removals

2. Click Data Removal Schedule. The Data Removal Schedule dialog box opens. 3. Click Add. The Add Scheduled Data Removal dialog box opens.

Note: You may be prompted to enter the data removal password first.

4. Select any options to specify the Playback Sessions to Remove.

Option Removes:

Date Sessions run during the selected date range.

n More than includes sessions run more than the specified number of hours, days, weeks, months, or years ago relative to the current date/time.

n From includes sessions run on or after the selected date and through includes sessions run on or before the selected date.

n In the last includes sessions run during the specified number of hours, days, weeks, months, or years before the current date/time.

Run state Sessions in the selected state, which is the status of a session during or after playback. You can include active sessions that are running, successful sessions, failed sessions, inactive sessions that did not send information to the server in over 30 minutes, or sessions canceled by the user who started them.

258 Editing scheduled playback data removal filters

Option Removes:

Test Sessions run on the selected computers. Click Select All to select all test computers or computers click Select None to clear all selected computers.

Session Sessions by name. You can include sessions with names that equal, start with, end with, name contain, do not equal, or do not contain specific text. Select Ignore case to ignore the case of the entered text.

5. Click OK. The Schedule Data Removal dialog box opens.

6. Select a Frequency to specify how often to remove the selected sessions. You can schedule removals to occur once, daily, weekly, monthly, or yearly. 7. Select additional schedule Options. The available options depend on the selected frequency.

n Time specifies the time of day to remove data. If you are scheduling a one-time removal, the time must be at least 5 minutes later than the current time.

n Date specifies the date for one-time and yearly removals.

n Day specifies the day of the week for weekly removals or day of the month for monthly removals. 8. Click OK. The removal is scheduled. The date and time for the next removal is displayed in the Data Removal Schedule dialog box.

Editing scheduled playback data removal filters You can edit the information used to determine playback data to remove when scheduled removals run. To change when and how often scheduled removals run, see Editing playback data removal schedules, page 260. 1. Start the QA Wizard Pro Server Admin Utility. 2. Click Data Removal Schedule. The Data Removal Schedule dialog box opens.

259 Editing playback data removal schedules

3. Select a scheduled removal and click Edit Filter. The Edit Scheduled Data Removal Filter dialog box opens.

Note: You may be prompted to enter the data removal password first.

4. Make any changes. For information about options, see Adding scheduled playback data removals, page 257. 5. Click OK to save the changes.

Editing playback data removal schedules You can edit scheduled playback data removals to change when and how often they run. To change the sessions removed, see Editing scheduled playback data removal filters, page 259. 1. Start the QA Wizard Pro Server Admin Utility. 2. Click Data Removal Schedule. The Data Removal Schedule dialog box opens. 3. Select a scheduled removal and click Edit Schedule. The Schedule Data Removal dialog box opens.

Note: You may be prompted to enter the data removal password first.

4. Make any changes. For information about options, see Adding scheduled playback data removals, page 257. 5. Click OK to save the changes.

Deleting scheduled playback data removals You can delete scheduled playback data removals that are no longer needed.

Tip: If you need reschedule a removal, edit the removal schedule. See Editing playback data removal schedules, page 260.

1. Start the QA Wizard Pro Server Admin Utility. 2. Click Data Removal Schedule. The Data Removal Schedule dialog box opens.

Note: You may be prompted to enter the data removal password first.

3. Select a scheduled removal and click Delete. You are prompted to confirm the deletion. 4. Click Yes. The scheduled removal is deleted.

260 Manually removing playback data

Manually removing playback data You can manually remove playback data that is no longer needed. Removed playback data is permanently deleted from the database and cannot be restored or viewed in the dashboard or status tool. You can also schedule automatic data removal at a set time or on a regular basis. See Scheduling playback data removal, page 257.

Note: If the server database is hosted in SQL Server, the database configuration may cause important playback data to be unintentionally removed. Review Incorrect Playback Sessions May Be Removed from QA Wizard Pro SQL Server Databases before removing data.

1. Start the QA Wizard Pro Server Admin Utility. 2. Click Data Removal. The Data Removal dialog box opens.

Note: You may be prompted to enter the data removal password first.

3. Select any options to specify the Playback Sessions to Remove.

261 Changing the playback data removal password

Option Removes:

Date Sessions run during the selected date range.

n More than includes sessions run more than the specified number of hours, days, weeks, months, or years ago relative to the current date/time.

n From includes sessions run on or after the selected date and through includes sessions run on or before the selected date.

n In the last includes sessions run during the specified number of hours, days, weeks, months, or years before the current date/time.

Run state Sessions in the selected state, which is the status of a session during or after playback. You can include active sessions that are running, successful sessions, failed sessions, inactive sessions that did not send information to the server in over 30 minutes, or sessions canceled by the user who started them.

Test Sessions run on the selected computers. Click Select All to select all test computers or computers click Select None to clear all selected computers.

Session Sessions by name. You can include sessions with names that equal, start with, end with, name contain, do not equal, or do not contain specific text. Select Ignore case to ignore the case of the entered text.

4. Click Remove. You are prompted to confirm the removal. 5. Click Yes. The data is removed.

Changing the playback data removal password You can set or change the password required to remove playback data from the QA Wizard Pro Server database, which helps prevent unauthorized removals. 1. Start the QA Wizard Pro Server Admin Utility. 2. Click Data Removal Password. The Change Data Removal Password dialog box opens. 3. Enter the current password. This field is not available if a password is not currently set. 4. Enter and confirm the new password. 5. Click Change Password. The password is changed.

Backing up the QA Wizard Pro Server The QA Wizard Pro Server database and global application repositories should be backed up regularly.

262 Backing up the QA Wizard Pro Server

Server database

SQLite By default, the server database is in SQLite format and stored in the QAWServer directory on the root of the computer the QA Wizard Pro Server is installed on. For example, if you installed in C:\Program Files (x86)\Perforce\QA Wizard Pro directory, the database is stored in C:\QAWServer.

Note: If you upgraded from QA Wizard Pro 2011.0 or earlier, the default server directory is C:\QAWRepository.

To back up the database: 1. Stop the QA Wizard Pro Server. 2. Copy the QAWServer.db file to a backup directory. 3. Restart the QA Wizard Pro Server.

Microsoft SQL Server, Oracle, or PostgreSQL If the server database is stored in Microsoft SQL Server, Oracle, or PostgreSQL, ask your DBA for help with backups.

Global application repositories To back up applications in global repositories, export them and save the copy in a backup directory. See Exporting applications, page 49.

263

Integrating with Helix ALM

QA Wizard Pro integrates with Helix ALM, which lets you create scripts from test case steps, run tests, add issues found during testing, and perform other testing-related tasks from QA Wizard Pro. Using the integration can help reduce information loss that can occur between completing testing and reporting problems, and save time by eliminating the need to switch between applications.

Note: TestTrack was renamed Helix ALM starting with the 2017.1 release.

To work with Helix ALM items in QA Wizard Pro, enable the integration and configure a project connection. See Configuring the Helix ALM integration, page 265. After configuring the integration, you can: n View lists of items in the project and add, edit, view, or delete items. n Work with test cases and test runs to set up and perform tests. n Work with issues to report problems that occur during testing. n Add events to move items through the workflow. n Duplicate items to create new items with similar information as existing items. n Use the workbook to view assigned items and track project-related tasks.

Configuring the Helix ALM integration To work with Helix ALM issues, test cases, test runs, or workbook tasks, enable the integration for the workspace and configure a connection to a project. 1. Choose Tools > Helix ALM > Configure Helix ALM. The workspace Properties dialog box opens with the Helix ALM tab selected.

2. Select Enable Helix ALM to enable the integration. 3. Click Configure. The Helix ALM Login dialog box opens.

265 Configuring the Helix ALM integration

4. Select the Server to connect to. See the Helix ALM help if you need to add a server. 5. Enter your Username and Password. If available, you can select Use single sign-on to log in with your network credentials or Use external authentication to log in with your authentication system credentials. Ask your Helix ALM administrator for help. 6. Select Always log in with this username and password to automatically log in using the credentials you entered every time you access the project from QA Wizard Pro. 7. Click Connect. The Helix ALM Project Selection dialog box opens.

8. Select the Project to work in. 9. Optionally expand Log in to and select the areas to log in to. You are logged in to the selected areas each time you connect to Helix ALM from QA Wizard Pro. All areas you have access to are selected by default. If your team uses floating licenses, you may want to reconfigure the connection before performing Helix ALM actions to only log in to the areas you will use for the current session. 10. Click OK.

266 Using Helix ALM list windows

The connection information is displayed in the workspace Properties dialog box. 11. Click OK to save the changes.

Using Helix ALM list windows You can view basic information and add, edit, view, and delete items from Helix ALM list windows. List windows are displayed in the Issues, Test Cases, Test Runs, and Workbook panes. You can customize list windows to find the information you need to work with and perform other actions, such as add events to move items through the workflow and duplicate items.

Tip: Use the Helix ALM toolbar to quickly add items and open list windows. To view the toolbar, choose View > Toolbars > Helix ALM.

Opening list windows To open a list window, select the item type to work with in the View menu. For example, to open the Issues list window, choose View > Issues. You can also choose Tools > Helix ALM and then select the list window.

Navigating list windows Following are the key components in list windows. Some of these are only available in the Issues, Test Cases, and Test Runs list windows.

# Area Use to:

Tabs Switch between multiple instances of lists that display different information. Click a tab to display it. You can also rename tabs, add tabs, and remove tabs you no longer use.

Action Add a new item to the project, or view, edit, or delete a selected item. buttons

Items n Open an item: Double-click the item.

n Perform an action on an item: Select the item and click the corresponding action button in the list window, or right-click the item and select an action from the shortcut menu.

Indicators Quickly identify new, changed, closed, and your assigned items. Mouse over an indicator to view a description.

267 Working with Helix ALM test cases and test runs

# Area Use to:

Sort Sort items based on column values. Click a column heading to sort items based on the arrows column values. An up arrow indicates ascending order and a down arrow indicates descending order. You can also Shift+click another column heading to sort on a secondary value.

Column Filter lists based on values in columns. When you select a filter value, the list is updated filter to display only items that contain the selected value.

Inline Edit item fields inline in list windows without opening the item to edit them. editing button

Filter list Apply filters to narrow the list to only items that meet specific criteria.

Finding items in lists To find items in lists, you can: n Select a Filter to display specific items. Only items that match the filter criteria are displayed. Select Not Filtered to display all items. n Use type ahead searching. Matching text is highlighted in the list window as you type.

Performing actions on items n To open an item, double-click it. n To edit, view, or delete an item, select it and click an action button in the list window. You can also right- click items to open a shortcut menu of available actions.

Note: See the Helix ALM help for information about using and customizing item list windows.

Working with Helix ALM test cases and test runs If Helix ALM integration is enabled for the workspace, you can work with test cases and test runs from QA Wizard Pro. This makes it easy to make sure information in scripts and test cases matches, and saves time by eliminating the need to switch between applications during testing. You can perform the following tasks to work with test cases and test runs. n Add new test cases manually to capture test details. n Record steps for test cases to make sure they are accurate. n Create scripts from test cases to record actions for every step to perform during a test. n View existing test cases and edit test cases to add or update information. n View test run information to set up the test environment. n Run tests and enter results.

268 Adding Helix ALM test cases

n Duplicate test cases and test runs to create new items with similar information. n Add events to move test cases and test runs through the workflow.

Note: You must be logged in to the test case management area to access test cases and test runs. See Configuring the Helix ALM integration, page 265.

Adding Helix ALM test cases You can add a test case to Helix ALM from QA Wizard Pro to capture test details, such as the conditions, steps, expected results, and other criteria used to determine if a product component works correctly and meets the specified requirements. You can also record test case steps instead of entering them manually. See Recording Helix ALM test case steps, page 270.

Tip: If you need to add a test case with the same basic information as another one, save time by duplicating the existing test case and then editing the new one. See Duplicating Helix ALM items, page 282.

1. Choose Tools > Helix ALM > Add Test Case. You can also click Add in the Test Cases list window. The Add Test Case dialog box opens.

2. Enter the general test case information in the top part of the dialog box. The fields depend on the information your team requires.

269 Recording Helix ALM test case steps

n Summary briefly describes the test.

n Type specifies the test type, such as Functional or Regression.

n Automated test indicates the test will be performed using a script. 3. Provide additional information on the following tabs.

Tab Use to:

Detail Enter the estimated time to perform the test, a test description, scope, conditions that must be met before performing the test, and overall expected test results.

Steps Enter the steps to perform the test and the expected results.

Variants Select the test variants to include or exclude when test runs are generated for the test case. Test variants are attributes of the tested application used to generate test runs. A test run is created for each unique combination of variant values selected when generating test runs.

Files Attach scripts or other files to the test case.

4. Provide any additional information on the other tabs. See the Helix ALM help for information. 5. Click Add to save the test case and add it to the Helix ALM project.

Recording Helix ALM test case steps If you need to add a new Helix ALM test case, you can record the test steps instead of manually entering them. This helps save time when documenting longer tests and reduces the possibility of incorrect or incomplete test cases. When recording test case steps, you interact with applications the same as when recording QA Wizard Pro scripts. The actions are automatically added as steps in a new test case.

Note: Helix ALM (or TestTrack 2012.0 - 2016.1) must be installed on the computer running QA Wizard Pro.

1. Choose Tools > Helix ALM > Record New Test Case. You can also click Record in the Test Cases list window. The Record New Test Case dialog box opens.

270 Recording Helix ALM test case steps

2. Select the application to record against or click New to add an application. Select Connect to running application to record against a Windows application running on the test computer. 3. Click Record. The application starts and the Recording New Test Case toolbar opens.

4. Navigate through the application, performing the actions to record.

n Click the Checkpoint Recording toolbar button to add checkpoints to the script during recording. See Creating record-time checkpoints, page 166. Click the button again to exit checkpoints mode.

n Click the Low-Level Recording toolbar button to switch to low-level recording mode. Low-level action statements perform mouse actions that QA Wizard Pro records when it does not recognize an object. See Recording low-level actions, page 70. Click the button again to exit low-level mode.

n Click the Comment Recording toolbar button to add a comment to the script. Comment statements are not run during playback. 5. Click the Stop Recording toolbar button. The Add Test Case dialog box opens and the recorded steps are displayed. A screenshot is attached to each step.

271 Creating scripts from Helix ALM test cases

6. Enter the test case Summary, Type, expected results, and any additional information. You can modify the steps before saving the test case. See Adding Helix ALM test cases, page 269. 7. Click Add to save the test case and add it to the Helix ALM project.

Creating scripts from Helix ALM test cases If you manage test cases in Helix ALM, you can create QA Wizard Pro scripts from steps in test cases. This helps ensure each test case step is represented with a statement in a script and automatically adds a link to the test case in the script. Use one of the following methods to create a script from a test case: n Record actions to include in the script that correspond with test case steps. The steps and expected results are displayed during recording to help you perform the actions. n Create a basic script that only includes the steps and expected results copied from the test case. This is helpful if you want to perform other tasks before recording, such as cleaning up script lines or populating the application repository.

Note: Helix ALM (or TestTrack 2012.0 - 2016.1) must be installed on the computer running QA Wizard Pro.

1. Click the Steps tab when you are viewing or editing a test case. 2. Click Create Script. You are prompted to open a workspace if one is not already open. The Create Automated Test Case dialog box opens.

272 Creating scripts from Helix ALM test cases

3. Enter a Script name. The default name is Automated Test Case appended with the test case number. 4. Select a script creation method.

n Create script from test case steps creates a basic script with test case steps and expected results without recording. Click Create to add the script to the workspace. No additional steps are required.

n Record script from test case steps records a script as you perform the displayed test case steps. Continue with step 5 to record the script. 5. Select the application to record against or click New to add an application. See Adding applications, page 47. Select Connect to running application to record against a Windows application running on the test computer. 6. If you are recording a web script, select a Browser. 7. Click Record. The application starts. The Recording Automated Test Case toolbar opens and displays the test case steps and expected results.

8. Perform the steps in the application.

n Click Done after completing each step to add the actions to the script. If you do not click Done after each step, all recorded actions are added to the end of the script.

273 Viewing Helix ALM test cases

n Click the Checkpoint Recording toolbar button to add checkpoints to the script during recording. See Creating record-time checkpoints, page 166. Click the button again to exit checkpoints mode.

n Click the Low-Level Recording toolbar button to switch to low-level recording mode. Low-level action statements perform mouse actions that QA Wizard Pro records when it does not recognize an object. See Recording low-level actions, page 70. Click the button again to exit low-level mode.

n Click the Comment Recording toolbar button to add a comment to the script. Comment statements are not run during playback. 9. Click the Stop Recording toolbar button when you complete all steps. The Repository Changes dialog box opens. 10. Click Save. The repository changes are saved and the script is created. The script includes the test case steps, recorded actions, and a hyperlink to the test case. Each step is added as a TestCaseStep statement. See TestCaseStep, page 559.

Note: You can modify the script or record additional steps before running the script. See Modifying Scripts, page 145 or Recording additional script steps, page 69.

Viewing Helix ALM test cases You can view read-only Helix ALM test case information without preventing other users from editing a test case at the same time. 1. Select the test case in the Test Cases list window and click View.

274 Editing and deleting Helix ALM test cases

The View Test Case dialog box opens. A summary of the workflow events and tracked email is displayed on the Overview tab. View additional information on the other tabs. See the Helix ALM help for information. 2. Click Edit to edit the test case. See Editing and deleting Helix ALM test cases, page 275. 3. Click OK when you finish.

Editing and deleting Helix ALM test cases Edit a Helix ALM test case to change the information, such as the steps to perform. When you edit a test case, related test runs are not updated to reflect the change. You must generate new test runs or regenerate test runs in Helix ALM to use the updated test case. See the Helix ALM help for information about generating or regenerating test runs. You can also delete test cases if they are not needed. Related test runs can also be deleted when you delete a test case.

Note: If you want to keep a record of a test case, but it does not need to be used to generate test runs, you may be able to add a workflow event to close it. See Moving Helix ALM items through the workflow, page 281.

1. Select the test case in the Test Cases list window. 2. Edit or delete the test case.

n To edit a test case, select it and click Edit. Make any changes and click OK. See Adding Helix ALM test cases, page 269 for information.

n To delete a test case, select it and click Delete. Click Yes to confirm the deletion. If the test case has related test runs, click Yes, delete all to delete the test case and test runs or No, only delete test cases to only delete the test case.

Running Helix ALM tests Running a Helix ALM test generally involves the following steps. 1. Open the test run and review setup information. Test variant values identify the environment to use for the test. Additional setup instructions may be included in the details and scripts or other test files required to perform the test may be attached. See Viewing Helix ALM test runs, page 276. 2. Review the steps. Steps are displayed on the Steps tab in one of the following views:

n Grid view displays steps and expected results in rows and columns.

n Detail grid view displays the entire test run and guides you step-by-step through it. You can enter results (Pass, Fail, or Undetermined) for each step in this view.

n Text view displays steps as text. Markup codes indicate the type of text on each line. 3. Perform the steps. Edit test runs to enter results. If the actual and expected results do not match, you can add problem statements and attach run reports to document the issues. See the Helix ALM help for information about entering test results in grid view, detail grid view, and text view.

275 Viewing Helix ALM test runs

4. Enter the overall test result. When you complete the test, add a workflow event to identify the test result. See Moving Helix ALM items through the workflow, page 281. If you find issues during the test, click Create Issue to report them. See Adding Helix ALM issues, page 277.

Viewing Helix ALM test runs You can view read-only Helix ALM test run information without preventing other users from editing the test run at the same time. 1. Select the test run in the Test Runs list window and click View. The View Test Run dialog box opens. A summary of the workflow events and tracked email is displayed on the Overview tab. View additional information on the other tabs. See the Helix ALM help for information. 2. Click Edit to edit the test run. See Editing and deleting Helix ALM test runs, page 276. 3. Click OK when you finish.

Editing and deleting Helix ALM test runs Edit a Helix ALM test run to enter test results or change the information. You can also delete test runs if they are not needed.

Note: If you want to keep a record of a test run, but it does not need to be performed again, you may be able to add a workflow event to ignore it. See Moving Helix ALM items through the workflow, page 281.

1. Select the test run in the Test Runs list window. 2. Edit or delete the test run.

n To edit a test run, select it and click Edit. Make any changes and click OK. See the Helix ALM help for information.

n To delete a test run, select it and click Delete. Click Yes to confirm the deletion.

Working with Helix ALM issues If Helix ALM integration is enabled for the workspace, you can work with issues in QA Wizard Pro. This makes it easy to thoroughly report problems encountered during testing and saves time by eliminating the need to switch between applications. You can perform the following tasks to work with issues. n Add new issues manually to report playback errors. n Add issues from run reports to automatically attach the results. n Use statements to add issues when scripts fail. n Configure batch files to automatically add issues when scripts in them fail. n Add issues when running scripts from a command prompt.

276 Adding Helix ALM issues

n View existing issues and edit issues to add or update information. n Duplicate issues to create new issues with similar information. n Add events to move issues through the workflow.

Note: You must be logged in to the issue management area to access issues. See Configuring the Helix ALM integration, page 265.

Adding Helix ALM issues You can add an issue to Helix ALM from QA Wizard Pro to report errors found during script playback. Instead of manually adding issues, you can also: n Add issues from run reports to automatically attach the results. n Use statements to add issues when scripts fail. n Configure batch files to automatically add issues when scripts in them fail. n Add issues when running scripts from a command prompt.

Tip: If you need to add an issue with the same basic information as another one, save time by duplicating the existing issue and then editing the new one. See Duplicating Helix ALM items, page 282.

1. Choose Tools > Helix ALM > Add Issue. You can also click Add in the Issues list window. The Add Issue dialog box opens.

2. Enter the general issue information in the top part of the dialog box. The fields depend on the information your team requires.

277 Adding Helix ALM issues from run reports

n Summary briefly describes the issue.

n Type specifies the issue type, such as Crash or Feature Request.

n Entered by specifies the user submitting the issue. The currently logged in user is selected by default, but you can choose another user. 3. On the Detail tab, enter any additional information on the corresponding mini tab.

Tab Name Use to:

Found by details Enter information about the user who found the issue and a detailed description.

Steps to reproduce Enter the steps to reproduce the issue.

Computer Enter the hardware and software configuration for the computer the issue configuration was found on.

File attachments Attach files to the issue.

4. Provide any additional information on the other tabs. See the Helix ALM help for information. 5. Click Add to save the issue and add it to the Helix ALM project.

Adding Helix ALM issues from run reports You can create Helix ALM issues from run reports to automatically attach the report to the issue. 1. Right-click the run report in the Reports pane and choose Create Issue from Report. The Add Issue dialog box opens. The report is added to the File attachments mini tab on the Detail tab.

2. Enter the issue information. See Adding Helix ALM issues, page 277. 3. Click Add to save the issue and add it to the Helix ALM project.

278 Adding Helix ALM issues from scripts

Adding Helix ALM issues from scripts You can add Helix ALM issues using statements in scripts to automatically report errors found during playback. Issues are added to the Helix ALM project configured for the workspace the script is in. Statements you use to add issues depend on the information to add to the issue and actions to perform related to the issue.

If you want to: Then:

Create an issue with information only in the Summary, Description, Steps Use the AddIssue to Reproduce, and Other Hardware and Software fields statement

Create an issue with information in other fields, add file attachments to the issue, or Use advanced get information from the issue before adding it to the project issue statements

Using the AddIssue statement Use the AddIssue statement to add an issue with information only in the Summary, Description, Steps to Reproduce, and Other Hardware and Software fields during playback. See AddIssue, page 353. To add information in other issue fields, you must either manually edit the issue after it is added to Helix ALM or use advanced issue statements.

Example In the following example, an issue is created, the Summary, Description, Steps to Reproduce, and Other Hardware and Software field values are set, and the issue is added to the Helix ALM project to report an error with the number of items available in the comboboxProduct control. numProducts = Window("BugReporter").ComboBox("comboboxProduct").Property("Number of Items") If numProducts <> 7 Then AddIssue("Incorrect number of products found", "Expected: 7 Actual: " + numProducts + " (reported by script '" + ScriptName()+ "')", "See test case", "Windows 7") End If

Using advanced issue statements Use the advanced issue statements to create an empty issue, set and work with issue fields values, attach files to the issue, and then add the issue to Helix ALM. To add an issue using advanced statements: 1. Add the NewIssue statement to create an empty issue object. 2. Use the SetFieldValue statement to set values in the specified issue fields and the AddFileAttachment statement to attach files to the issue.

Note: You can also use the GetFieldValue and RemoveField statements to work with issue fields. GetFieldValue returns values from issue fields for verification or use in other script lines. RemoveField removes values from fields.

3. Add the AddToHelixALM statement to add the resulting issue to Helix ALM.

279 Viewing Helix ALM issues

Example In the following example, a new issue object is created to report an error with the text displayed in the resultsDlg control. The issue Summary, Description, Product, Severity, and Windows Version fields are set before the issue is added to the Helix ALM project. resultMessage = Window("resultsDlg").Label("lblMessage").Property("Text") If (resultMessage <> "OK") Then ' Results dialog indicated an error occurred ' Create a new, empty Helix ALM issue issue = NewIssue() ' Format the summary string dim values(2) values(1) = ScriptName() values(2) = resultMessage summaryString = Format("Automation Test ({0}) Failed with message: \"{1}\"", values) ' Set the Summary field issue.SetFieldValue("Summary", summaryString) ' Set the Description and Product fields issue.SetFieldValue("Description", "The script played back to completion, but the results dialog indicated that an error occurred.") issue.SetFieldValue("Product", "WysiCorp") ' Determine and set the issue severity If (FindSubStr(resultMessage, "Critical", 0) <> -1) Then ' This is a critical issue issue.SetFieldValue("Severity", "Critical") Else ' This is a minor issue issue.SetFieldValue("Severity", "Minor") End If ' Set the custom Windows Version field issue.SetFieldValue("Windows Version", GetWindowsVersion()) ' Add the issue to Helix ALM issue.AddToHelixALM() End If

Viewing Helix ALM issues You can view read-only Helix ALM issue information without preventing other users from editing an issue at the same time. 1. Select the issue in the Issues list window and click View. The View Issue dialog box opens. A summary of the workflow events and tracked email is displayed on the Overview tab. View additional information on the other tabs. See the Helix ALM help for information.

280 Editing and deleting Helix ALM issues

2. Click Edit to edit the issue. See Editing and deleting Helix ALM issues, page 281. 3. Click OK when you finish.

Editing and deleting Helix ALM issues Edit a Helix ALM issue to provide additional or updated information. You can also delete issues if they are not needed.

Note: If you want to keep a record of the issue but it does not need to be fixed, you may be able to add a workflow event to close it. See Moving Helix ALM items through the workflow, page 281.

1. Select the issue in the Issues list window. 2. Edit or delete the issue.

n To edit an issue, select it and click Edit. Make any changes and click OK. See Adding Helix ALM issues, page 277 for information.

n To delete an issue, select it and click Delete. Click Yes to confirm the deletion.

Moving Helix ALM items through the workflow Helix ALM workflows define the path that issues, test cases, and test runs take from the time they are created until they are completed and closed. As you work on items, add workflow events to move them through their lifecycle and describe the work you completed, work that another team member needs to complete, or additional information about the item. For example, you can enter an Assign event to assign an item to another user who is responsible for working on it. When work is complete, the assigned user adds the appropriate event to record their work and the item moves to the next step, or state, in the workflow. Information about an item's current state and assignment information is displayed in the item Status field.

Note: The events and fields you use may be different depending on your team's workflow, but the steps to add events are similar.

1. Right-click an item in a list window and choose an event. For example, choose Assign to assign an issue to another user. The available events depend on the item's current state and workflow configuration. The event dialog box opens.

2. Enter or select the event information. All events include the following fields..

281 Duplicating Helix ALM items

n By—Defaults to the logged in user, but you can select another user.

n Date—Defaults to the current date and time, but you can enter or select another date and time.

n Notes—Provides additional information about the event. Provide as much detail as possible to help users understand the work associated with the event. 3. Click OK to add the event to the item. The item status may change based on the event type.

Duplicating Helix ALM items If you need to add a Helix ALM issue, test case, test run, or workbook task with the same basic information as another item of the same type, save time by duplicating the existing item and then editing the new one.

Note: You can also duplicate requirements and requirement documents currently assigned to you in the Workbook list window, but you can only modify the duplicated items in Helix ALM. See the Helix ALM help for information about duplicating requirements and requirement documents.

1. Right-click the item to duplicate in a Helix ALM list window and choose Duplicate. If you are duplicating a workbook task, the task is duplicated and added to the workbook. Continue with step 7. If you are duplicating an issue, test case, or test run, the Duplicate Options dialog box opens.

2. Select Link duplicated item with original to link the new item with the original item.

n Select a Definition to specify the relationship between the items. The list includes all link definitions in the Helix ALM project for the selected item type. Click View Definition to view information about the definition.

n Enter a Comment to display on the item Links tab and the link diagram.

282 Using the Helix ALM workbook

n If you select a parent/child definition, select Make original item the parent to make the original item the parent in the relationship. See the Helix ALM help for information about linking items and link definitions. 3. Select Identify original item in system comment to add a system comment to the Workflow tab on the new item that indicates the original item number and summary. 4. If you are duplicating an issue, select Identify original issue in Description text to add a line to the Description field of the new issue that indicates the original issue number and summary. 5. Select the information to copy from the original item. The available options depend on your security permissions. Information you select to copy from the original item is displayed on the corresponding tab in the new item. Folder information copies the new item to the same folders as the original if you have access to the folders.

Note: You can only copy links if only one item is selected for duplication.

6. Click OK. The item is duplicated and assigned the next available number in the project. 7. Modify the duplicated item and save the changes.

n Editing and deleting Helix ALM issues, page 281

n Editing and deleting Helix ALM test cases, page 275

n Editing and deleting Helix ALM test runs, page 276

n Editing and deleting Helix ALM workbook tasks, page 284

Using the Helix ALM workbook Use the Helix ALM workbook to organize your assigned items and track other project-related tasks. For example, you can add a task to remind you to install the latest build before running tests. Workbook tasks are private and not shared with other users. You can perform the following tasks in the Workbook list window. n Add tasks to track project-related work. n View tasks and other items assigned to you. n Edit tasks to add additional information or mark them as Done.

Adding Helix ALM workbook tasks You can add project-related tasks to the Helix ALM workbook. For example, you can add a task to remind you to install the latest build before running a test.

Tip: If you need to add a task with the same basic information as another one, save time by duplicating the existing task and then editing the new one. See Duplicating Helix ALM items, page 282.

1. Choose Tools > Helix ALM > Add Task. You can also click Add in the Workbook list window. The Add Task dialog box opens.

283 Viewing Helix ALM workbook tasks

2. Enter a Task summary to briefly describe it. 3. Select a task Priority. 4. Date defaults to the current date, but you can enter another date. You can also click to select a date. 5. To identify an optional deadline for the task, select a Need by date or enter a Need by version. 6. Enter a Description. 7. Click Add to save the task. When you complete a task, mark it as Done to change the status. See Editing and deleting Helix ALM workbook tasks, page 284.

Viewing Helix ALM workbook tasks You can view Helix ALM workbook tasks to see detailed information you entered, such as the description or need by date. You can also view Helix ALM items assigned to you. 1. Select the task in the Workbook list window and click View. The View Task dialog box opens. 2. Click Edit to edit the task. See Editing and deleting Helix ALM workbook tasks, page 284. 3. Click OK when you finish.

Editing and deleting Helix ALM workbook tasks Edit a Helix ALM workbook task to add additional information or mark it as Done when the work is complete. You can also delete tasks if they are not needed. You may also be able to edit Helix ALM items assigned to you. 1. Select the task in the Workbook list window. 2. Edit or delete the task.

n To edit a task, select it and click Edit. Make any changes and click OK. See Adding Helix ALM workbook tasks, page 283 for information.

n To delete a task, select it and click Delete. Click Yes to confirm the deletion.

284 Integrating with Source Control Tools

QA Wizard Pro integrates with Surround SCM and Microsoft Source Code Control Interface (SCCI) compliant applications to provide complete script management and facilitate team communication. After adding scripts and other files to source control, you can perform most source control tasks directly from QA Wizard Pro, easily share changes, and maintain a record of changes. Integrating with source control provides the following benefits: n Testers can store scripts and other test data in a central location. Some organizations maintain test data with the application code and design documents, while other organizations maintain test data separately from development files. n The most recent file versions are always available, ensuring that tests are performed using the correct files. n The source control application tracks who, when, and what changed for every revision of QA Wizard Pro files. You can easily revert back to previous file version, if needed. n Testers can perform source control tasks directly from QA Wizard Pro without opening the source control application.

Note: The following examples use Surround SCM. You may follow different steps depending on the source control application you are using.

Configuring source control integration Before you can work with files under source control files in QA Wizard Pro, you need to associate the workspace with a specific location in the source control application.

Note: The steps you follow depend on the source control application. The steps in this section use Surround SCM. Refer to your source control application's documentation for additional information.

1. Choose Tools > Source Control > Configure Source Control. The workspace Properties dialog box opens with the Source Control tab selected.

2. Select a Source control provider. 3. If the workspace was already added to Surround SCM, QA Wizard Pro automatically associates it with the previously selected repository. Click OK to complete the configuration. If QA Wizard Pro cannot determine the repository, you are prompted to establish an association.

285 Setting source control options

4. Click Fix. The Surround SCM Repository Browser opens.

5. Select the branch and repository to associate with the workspace. Click Create Repository to create a new Surround SCM repository. 6. Click OK. 7. If you are prompted to set a working directory, enter a working directory path or click Browse to select a directory. 8. Click OK to save the changes.

Note: If the files in the workspace have not been added to the source control application, you need to add them before you can perform other source control actions. See Adding files to source control, page 289.

Setting source control options These options control the default action to perform when you edit and save checked in source control files. The save and edit options apply to the workspace file and any source control file in the workspace. For example, if the workspace is checked in and the edit action is set to prompt for check out, you are prompted to check out the workspace file if you make any changes to it, such as adding a new script. 1. Choose Tools > Options. The Options dialog box opens. 2. Click the Source Control tab.

286 Understanding source control file status icons

3. Select the On save behavior for checked in files.

n Prompt for check out opens the source control Check Out dialog box.

n Check out automatically checks out the file without prompting.

n Save as opens the Save As dialog box so you can save a copy of the file in a different location. 4. Select the On edit behavior for checked in files.

n Prompt for check out opens the source control Check Out dialog box.

n Check out automatically automatically checks out the file without prompting.

n Do nothing leaves the file checked in. If this option is selected, you must manually check out source control files to edit them or enable the option to allow editing of read-only files. See Setting general options, page 40. 5. Click OK to save the changes.

Understanding source control file status icons When a workspace stored in a source control application, icons in the Workspace pane indicate the file status.

Icon Indicates

File has not been added to source control

File is under source control and is not checked out

You have the file checked out

You have the file checked out exclusively

Another user has the file checked out

Another user has the file checked out exclusively

Multiple users have the file checked out

File is excluded when adding files to source control

287 Opening workspaces under source control

Opening workspaces under source control If QA Wizard Pro is integrated with Surround SCM, you can open workspaces from Surround SCM to retrieve a local copy of an entire workspace or only old, modified, and missing files. 1. Choose Tools > Source Control > Open Workspace from Surround SCM. The Surround SCM Repository Browser dialog box opens.

2. Select the repository that contains the QA Wizard Pro workspace. 3. Click OK. If the repository contains multiple workspaces, you are prompted to select the workspace to open. The Get dialog box opens. All files that are old, modified, or missing locally are displayed.

4. Select the files to retrieve or select Get all files in the workspace to retrieve all files. 5. Click Advanced to select advanced get options. 6. Click OK to open the workspace. You may be prompted to replace, skip, or merge files if there are conflicts.

288 Excluding files from source control

Excluding files from source control If a workspace includes files you do not want to add to source control, you can mark them to be excluded. 1. Select the file you want to exclude in the Workspace pane. 2. Choose Tools > Source Control > Exclude from Source Control. The file is marked with a red minus sign icon and will be excluded when adding all files in the workspace to source control.

Note: To include files again, select an excluded file and choose Tools > Source Control > Exclude from Source Control to toggle the option.

Working with source control files If QA Wizard Pro is integrated with a source control application, such as Surround SCM, you can perform the following actions without switching to the source control application. n Add files. See Adding files to source control, page 289. n Get files. See Getting files from source control, page 290. n Check out files. See Checking out files from source control, page 291. n View file properties. See Viewing source control file properties, page 291. n View file history. See Viewing source control file history, page 292. n Annotate files to view line-by-line changes. See Viewing line-by-line source control file changes, page 294. n View pending changes to check in or add to source control. See Viewing pending changes, page 296. n View file differences. See Viewing file differences, page 296. n Check in files. See Checking in files to source control, page 298. n Manage changelists. See Managing changelists, page 298. n Undo check out. See Undoing source control check out, page 300. n Rename files. See Renaming source control files, page 301. n Remove files. See Removing source control files, page 301.

Adding files to source control You can add individual files or an entire workspace to a source control application to manage files, control file access, and ensure the latest files are available for other users.

Note: You can specify files to exclude when adding an entire workspace to the source control application. See Excluding files from source control, page 289.

1. In the Workspace pane, select the files you want to add or select the workspace to add all the files. 2. Choose Tools > Source Control > Add to Source Control. The Add dialog box opens. The selected files or workspace are displayed.

289 Getting files from source control

3. Select Add all files in the workspace to add the entire workspace to source control. This option is only available if you selected the workspace file. 4. Optionally enter a Comment. The comment is applied to all files. 5. Click Advanced to select advanced add options. 6. Click OK. The files are added.

Getting files from source control Get files when you want to view a file but do not need to make any changes. A read-only copy of the file is created in the working directory.

Tip: If you use Surround SCM, you can get files and open a workspace from Surround SCM simultaneously. See Opening workspaces under source control, page 288.

1. Select the files you want to get in the Workspace pane. 2. Choose Tools > Source Control > Get. The Get dialog box opens. The selected files are displayed.

3. Click OK. The files are copied to the working directory.

290 Checking out files from source control

Checking out files from source control Check out files when you need to make changes. A copy of the file is created in the working directory.

Note: If you want to add scripts to the workspace or modify scripts, you must check out the workspace.

1. Select the files you want to check out in the Workspace pane. 2. Choose Tools > Source Control > Check Out. The Check Out dialog box opens. The selected files are displayed in the Files list.

3. Optionally enter a Comment. The comment is applied to all files. 4. Click Advanced to select advanced check out options. 5. Click OK. The files are checked out.

Viewing source control file properties File properties include basic file information, such as comments and the last modified date. 1. Select a file in the Workspace pane and choose Tools > Source Control > Source Control Properties. The Properties dialog box opens.

291 Viewing source control file history

2. View the file information. You can view general information, such as size, version, and modified date, and custom field information. Depending on the file you select, you may also be able to view check out and sharing information. 3. Click OK to close the Properties dialog box.

Viewing source control file history All actions performed on a source file are stored in the source control application. You can view file history and work with historic versions. 1. Select a file in the Workspace pane and choose Tools > Source Control > History. The History dialog box opens.

292 Viewing source control file history

Note: You can change the columns in the History dialog box. To display a column, right-click a column and select the column you want to add from the shortcut menu. Click and drag the column to change its location. To hide a column, right-click a column and select the column you want to hide. The Version and Action columns cannot be hidden.

2. Optionally select Filter by user and Filter by action options. 3. Optionally select Additional events options to display workflow state changes, custom field values, and label history. 4. Select a file version and choose the action to perform.

Button Action

View history details for the selected version.

View differences for the selected versions.

Retrieve a copy of the selected version.

Check out the selected version.

View the selected version.

Edit the file.

Revert to a previous file version.

Review changes made in the selected version.

Add the selected version to a code review.

View code reviews for the selected version.

Attach the selected version to a Helix ALM item or issue in an external issue tracking tool.

View the Helix ALM item the selected version is attached to.

View the committed changelist. This option is only enabled if the action was performed as part of a changelist.

Set the workflow state for the file.

Label the selected version.

View labels applied to the selected version.

5. Click Close when you finish.

293 Viewing line-by-line source control file changes

Note: See the Surround SCM help for more information about file history.

Viewing line-by-line source control file changes If QA Wizard Pro is integrated with Surround SCM, you can use line-by-line annotation to trace the history of file changes. Annotation helps you identify new or changed lines between file versions, who made the change, when it was made, and the action that caused the change. 1. Select a file in the Workspace pane and choose Tools > Source Control > Annotate. The Annotate dialog box opens.

2. Select a Version to annotate. You can annotate the latest server version, a historic server version, the current server version based on a timestamp, the version with a specified label, or the latest version in a workflow state in the source control application. 3. Select a Show changes since option. You can view changes since a historic server version, the current server version based on a timestamp, the version with a specified label, or the latest version in a workflow state in the source control application. Changes are displayed for the version after the selected version and all versions up to the selected version. For example, if you select to annotate version 10 and select version 5 in this field, annotations are displayed for versions 6 through 10.

Note: If you select all the changes since a historic version, it can take several minutes to perform the annotation if there are many revisions or the file size is large.

4. Click Annotate. A progress indicator opens. When the annotation is complete, the Annotate window opens.

Working with annotate results Information about annotated files is displayed in the following columns in the Annotate window.

Column Description

User User who made the last change to the line

Version File version the change was included in

294 Viewing line-by-line source control file changes

Column Description

Event Type Event that caused the change, such as check in

Change Type Type of change made to the line (Add or Modify)

Line # File line number

Content The new or changed content

Consecutive lines with the same version number are grouped, indicated by different background colors. All lines in a group share the column information displayed in the first row of the block. Only the Content column information is different.

Note: If Surround SCM cannot annotate a line, a dash (-) is displayed and the line is grayed out. Deleted lines are not annotated.

You can perform the following actions in the Annotate window: n To add or remove a column, right-click a column and select the column from the menu. To move a column, drag the column to the new location. n Click a value in the User, Version, Timestamp, or Event Type columns to select all rows that contain the same value. This can help you see the relationship between changes. For example, click a version in the Version column to select all changes made in the selected version. n Mouse over a line to open a pop-up window that includes all annotation information and comments entered when the event was performed. This can help you see information in columns hidden in the Annotate window. n If the event type is Promote or Rebase, click the hyperlink in the Event Type column to annotate the version that was promoted or rebased.

295 Viewing pending changes

n To search the Content column, enter a word or phrase in the Find field and click Find. Click Find again to go to the next match. n To go to a specific line, click Go To, enter the line number, and click OK.

Viewing pending changes You can view a list of all files that are checked out, modified, or new in the workspace in the Pending Changes pane to easily keep track of added or changed files since you checked them out. You can perform source control actions, such as checking in or undoing check out, from the Pending Changes pane. 1. Choose Tools > Source Control > Pending Changes. The Pending Changes pane opens.

2. Select a file and choose the action to perform.

n Click Check In to check in a modified file or add a new file to the source control application. See Checking in files to source control, page 298.

n Click Undo Check Out to discard changes and check in the file. See Undoing source control check out, page 300.

n Click Differences to view the differences between the local file and a version in the source control application server. See Viewing file differences, page 296.

Viewing file differences You can view file differences to compare differences between two file versions. After you make changes to a file, but before checking it in, you can compare the file to another copy and reconcile the differences. 1. Choose Tools > Source Control > Differences. The Differences dialog box opens.

296 Viewing file differences

2. Select a Version.

n If you have the file is checked out, you can use the checked out file version or the current server file.

n If you do not have the file checked out, the current server file version is displayed and cannot be changed. 3. Select a Second File option.

n Copy in working directory compares the server file with the working directory file.

n Selected file compares the server file with a file you select on your local drive. Click Browse to select a file. 4. Click Advanced to select a branched file, historic file version, or unrelated file. The Second File area expands with the following options:

n Branched file compares the file with a selected branched version.

n Historic version compares the current version with a selected historic version.

n Unrelated file compares the file with any other file on the Source Control Server. Click Browse to select a file.

5. Click Differences.

297 Checking in files to source control

The differences utility starts. Refer to the utility's documentation for additional information.

Checking in files to source control Check in files after you finish making changes. Check in updates the files with changes, removes the lock, and makes changes available to other users. 1. Select the files you want to check in in the Workspace pane. 2. Choose Tools > Source Control > Check In. The Check In dialog box opens. The selected files are displayed.

3. Optionally enter a Comment. The comment is applied to all files. 4. Click Advanced to select advanced check in options. 5. Click OK. The files are checked in.

Managing changelists Surround SCM changelists group related files and the actions performed on them and treat the files as one unit. You can view, edit, and changelists from QA Wizard Pro. 1. Choose Tools > Source Control > Changelists. The Changelists dialog box opens.

298 Managing changelists

Note: The changelists displayed depend on the selected filter. You can display your pending changelists, other users' changelists, your committed changelists, or all committed changelists.

2. Select a changelist or file and choose the action to perform.

Button Use to:

View Details View details about the changelist or file actions.

Commit Commit the changelist, which perform actions on all files in the changelist at the same Changelists time.

Rename Rename the changelist. Changelist

Remove Remove the changelist and all related file actions. Changelist

Set Comment Add comments to the file or all files in the changelist.

Edit Change the file action options. Action Details

Move Action Move the file action to another changelist.

299 Undoing source control check out

Button Use to:

Remove Remove the file action from the changelist. Action

Differences Compare the file to another version.

Edit File Edit the file.

Merge Merge the file with another version.

Attach Attach the file or changelist to an item in Helix ALM or an external issue tracking tool. Changelists and files are attached to items when changelists are committed.

Add to Code Add the changelist to a code review. Review

3. Click Save As to save the changelist or Print to print it. 4. Click Close when you finish.

Note: See the Surround SCM help for more information about using changelists.

Undoing source control check out If you modify a file then decide you do not want to save the changes, you can undo the check out. This discards changes, checks the file in, and does not create an entry in the version history. 1. Select the checked out files in the Workspace pane. 2. Choose Tools > Source Control > Undo Check Out. The Undo Check Out dialog box opens. The selected files are displayed.

3. Click Advanced to select advanced undo check out options. 4. Click OK. The files are no longer checked out.

300 Renaming source control files

Renaming source control files When you rename a source control file in QA Wizard Pro, you can also rename it in the source control application if you have the appropriate permissions. 1. Right-click the file you want to rename and choose Properties. The File Properties dialog box opens.

2. Enter the new Name and click OK. You are prompted to rename the file in the source control application. 3. Click Yes to rename the file in the source control application or No to only rename the local copy.

Removing source control files You can remove source control files from workspaces, the local disk, and the source control application. 1. In the Workspace pane, right-click the file you want to remove and click Delete. You are prompted to remove the file from the workspace. 2. Select Also delete the file from the disk to delete the local copy of the file. 3. Select Also remove the file from source control to remove the file from the source control application. 4. Click OK. The file is removed from the workspace. It is also deleted locally or from the source control application if you selected the corresponding option.

301

Converting QuickTest Pro Data to QA Wizard Pro

If you have existing automated tests in HP QuickTest Professional (QTP), you can convert them to QA Wizard Pro. You can convert QTP repository objects, tests, actions, and function libraries. During the conversion, QA Wizard Pro analyzes each QTP item, automatically determines an equivalent, and adds the corresponding items. Repository objects are added to the QA Wizard Pro application repository, tests are added as workspaces, actions and function libraries are added as scripts, and checkpoints are added as statements in scripts.

Conversion process Converting QTP data to QA Wizard Pro includes the following steps. 1. Get familiar with QA Wizard Pro concepts and how data is converted If you are a new QA Wizard Pro user, take the time to learn about key QA Wizard Pro concepts before converting your QTP data. This can help you more easily find and work with converted data so you can start running tests more quickly. See Key QA Wizard Pro concepts, page 8. Next, learn more about how QA Wizard Pro converts QTP data. See Understanding QTP data conversion, page 304. 2. Export data from the QTP Object Repository Before you can convert objects and checkpoints from the QTP Object Repository, you need to export the data to an XML file. See Exporting QTP repository and checkpoint data, page 304. 3. Perform the conversion You can convert only QTP repository objects and checkpoints, only tests and function libraries, or all data at the same time. See Converting QTP data, page 305. 4. Review the converted data and make any changes When the conversion is complete, review the results and data added to QA Wizard Pro. This can help you identify any errors that occurred and changes needed to make tests run correctly. See Reviewing QTP conversion results, page 312.

Supported applications QTP tests and objects for the following application types can be converted to QA Wizard Pro. See Supported Technologies and Controls, page 607 for a list of supported controls for these application types. n HTML and web applications in supported browsers and versions. See the QA Wizard Pro System Requirements for supported browsers. n Standard n Microsoft .NET Windows Forms n DevExpress and Infragistics grid controls

303 Understanding QTP data conversion

Understanding QTP data conversion When converting QTP data, each item is analyzed and converted to a QA Wizard Pro equivalent. For example, QTP tests are converted to QA Wizard Pro workspaces and actions are converted to scripts. In some cases, an equivalent may not exist in QA Wizard Pro. For example, QTP has some methods that are not supported in QA Wizard Pro. If an equivalent does not exist, QA Wizard Pro indicates it in the conversion log and resulting scripts. See Reviewing QTP conversion results, page 312. Following are QTP items and how they are converted to QA Wizard Pro. See Key QA Wizard Pro concepts, page 8 for more information about the QA Wizard Pro components.

QTP item Converted to in QA Wizard Pro

Test objects Windows and controls in the application repository stored in the Object Repository

Test (.usr file) Workspace

Action Script

VBScript Script (.vbs) file

Function Script (.qfl file)

Standard Multiple Checkpoint statements in scripts. Other QTP checkpoint types are not checkpoint converted.

Data table Local datasheet. One datasheet is created for each worksheet in a QTP data table. Database functions are not converted. Datasheets are not automatically associated with scripts during the conversion. See Associating datasheets with scripts, page 203

The following QTP data is not converted to QA Wizard Pro: n Database and DataTable statements n Reports and run results n Integration settings n Secure password strings—Strings in QTP password edit fields using the SetSecure method are not decrypted during conversion. SetSecure is replaced with the SetText statement, which contains a plain text password. See Encrypting text, page 162 for information about encrypting text strings.

Exporting QTP repository and checkpoint data Before you convert QTP repository object and checkpoint data to QA Wizard Pro, you need to export it from the QTP Object Repository. First, export the data to a Shared Object Repository (TSR) file and then export the TSR file to XML.

304 Converting QTP data

Note: You may have to export TSR and XML files for each QTP action depending on how the Object Repository is set up.

Exporting TSR files 1. In QTP, choose Resources > Object Repository. The Object Repository opens. 2. Choose File > Export Local Objects. The Save Shared Object Repository dialog box opens. 3. Select a location to save the exported file in, enter a File name, and click Save. 4. Click Save. The TSR file is exported and saved.

Exporting XML files 1. In QTP, choose Resources > Object Repository Manager. The Object Repository Manager opens. 2. Choose File > Open. The Open Shared Object Repository dialog box opens. 3. Select the TSR file you exported and click Open. The repository opens. 4. Choose File > Export to XML. The Save XML File dialog box opens. 5. Select a location to save the exported file in, enter a File name, and click Save. The XML file is exported and saved. You can now convert the exported data to QA Wizard Pro. See Converting QTP repository objects and checkpoints, page 306.

Converting QTP data During conversion, QA Wizard Pro analyzes each QTP object you choose to convert, automatically determines an equivalent, and adds the corresponding items. To start a conversion, choose Tools > Convert from QTP. The Convert from QTP - Setup dialog box opens.

305 Converting QTP repository objects and checkpoints

The information you select in the Convert from QTP dialog box depends on the QTP data you want to convert. For example, you may want to convert data in small portions depending on the size of QTP repositories and tests. n Convert only repository objects and checkpoints—Complete only the Repositories area. See Converting QTP repository objects and checkpoints, page 306. n Convert only tests and function libraries—Complete only the Workspaces area. See Converting QTP tests and function libraries, page 309. n Convert all QTP data—Complete both the Repositories and Workspaces areas.

Note: If you convert the same QTP files again, data already converted is not overwritten in QA Wizard Pro. Only new data is converted.

Converting QTP repository objects and checkpoints You can convert QTP repository objects and checkpoints to add them to the QA Wizard Pro application repository and scripts.

Note: Before you can convert QTP data, you must export it from the QTP Object Repository to a TSR file and then to an XML file. See Exporting QTP repository and checkpoint data, page 304.

306 Converting QTP repository objects and checkpoints

The application repository contains information about the applications and versions you are testing. This information is used during playback to locate and perform actions in the application. See About application repositories, page 57. QTP checkpoints are added as multiple Checkpoint statements in QA Wizard Pro scripts.

Note: You can select multiple items to add in the Repositories and Workspaces areas, but keep in mind that all selected data is added to the application version in the repository and workspace you select. To convert to different applications or workspaces, perform another conversion.

1. Choose Tools > Convert from QTP. The Convert from QTP - Setup dialog box opens.

2. In the Repositories area, click Browse to select the QA Wizard Pro application repository to convert QTP data to. The Select Application Version dialog box opens.

307 Converting QTP repository objects and checkpoints

3. Select the application version in the repository to add the converted data to or click New to add a new application. See Adding applications, page 47.

Tip: We recommend converting to an application in the local repository instead of the global repository. After the conversion, you can make any changes in the local repository before promoting to the global repository and sharing the version with other QA Wizard Pro users. See Promoting applications, page 50.

4. Click OK. 5. In the Repositories area, click Add to add the QTP repository objects and checkpoints to convert. The Open dialog box opens. 6. Select a QTP repository XML file and click Open. The XML file is added to the list on the left. A preview of items to convert is displayed on the right.

The following icons indicate the QA Wizard Pro item type.

Icon Indicates:

Window or control

Checkpoint

7. Add any additional QTP XML files to convert.

308 Converting QTP tests and function libraries

Note: To remove a file from the conversion, select it in the list and click Remove.

8. If you want to convert any QTP tests and function libraries, complete the fields in the Workspaces area. See Converting QTP tests and function libraries, page 309. 9. Click Convert. The Convert from QTP - Progress dialog box opens and displays results as items are converted.

Note: Click Stop to cancel the conversion. Any data added to QA Wizard Pro before stopping the conversion is not removed.

10. When conversion is complete, review the results to identify any issues that occurred or additional changes to make in scripts and other test data. It is important to compare the items processed against the items converted. Discrepancies between these numbers indicate you should review the converted items to see if you need to make any changes. See Reviewing QTP conversion results, page 312.

Note: Click View Log to view the conversion log, which provides details about each item processed during the conversion. See Viewing the QTP conversion log, page 314.

11. Click Close to close the progress dialog box.

Converting QTP tests and function libraries You can convert QTP tests and function libraries to add them as QA Wizard Pro scripts. Data tables associated with converted tests are added as QA Wizard Pro datasheets.

Note: You can select multiple items to add in the Repositories and Workspaces areas, but keep in mind that all selected data is added to the application version in the repository and workspace you select. To convert to different applications or workspaces, perform another conversion.

1. Choose Tools > Convert from QTP. The Convert from QTP - Setup dialog box opens.

309 Converting QTP tests and function libraries

2. In the Repositories area, click Browse to select the QA Wizard Pro application repository to convert QTP data to. The Select Application Version dialog box opens.

3. Select the application version in the repository to add the converted data to or click New to add a new application. See Adding applications, page 47.

310 Converting QTP tests and function libraries

Tip: We recommend converting to an application in the local repository instead of the global repository. After the conversion, you can make any changes in the local repository before promoting to the global repository and sharing the version with other QA Wizard Pro users. See Promoting applications, page 50.

4. Click OK. 5. In the Workspaces area, click Browse to select the QA Wizard Pro workspaces directory to convert QTP data to. The Browse for Folder dialog box opens. 6. Select the workspace directory and click OK.

Note: By default, workspace files (.qawwspace files) are saved in C:\Users\\Documents\My Documents\QA Wizard Pro Workspaces.

7. Click Add and select the data to convert.

n To convert a test, select QTP Test. Browse to select the test (.usr) file to convert and click Open.

n To convert a function library, select QTP Function Library. Browse to select the function library (.qfl or .vbs) file to convert and click Open. A preview of the items to convert is displayed.

The following icons indicate the QA Wizard Pro item type.

Icon Indicates:

Workspace

Script

Datasheet

8. Add any additional tests or function libraries to convert to the selected workspace.

Note: To remove an item from the conversion, select it in the list and click Remove.

311 Reviewing QTP conversion results

9. To change the name of a workspace, script, or datasheet during conversion, select the item in the preview and enter the new name. If you change a workspace name, it also changes in the file path for any scripts added to the workspace during conversion. 10. If you want to convert any QTP repository objects and checkpoints, complete the fields in the Repositories area. See Converting QTP repository objects and checkpoints, page 306. 11. Click Convert. The Convert from QTP - Progress dialog box opens and displays results as items are converted.

Note: Click Stop to cancel the conversion. Any data added to QA Wizard Pro before stopping the conversion is not removed.

12. When conversion is complete, review the results to identify any issues that occurred or additional changes to make in scripts and other test data. It is important to compare the items processed against the items converted. Discrepancies between these numbers indicate you should review the converted items to see if you need to make any changes. See Reviewing QTP conversion results, page 312.

Note: Click View Log to view the conversion log, which provides details about each item processed during the conversion. See Viewing the QTP conversion log, page 314.

13. Click Close to close the progress dialog box.

Reviewing QTP conversion results When the QTP conversion is complete, it is important to take the time to review the results and make any changes to make sure scripts run correctly.

312 Reviewing QTP conversion results

Review conversion statistics When the conversion is complete, statistics are displayed in the progress dialog box. Compare the items processed against the items converted. Discrepancies between these numbers indicate that you should review the converted items to see if you need to make any changes.

View the conversion log A log file is created during each conversion, which provides details about each QTP item processed and converted. If errors occur during conversion or the statistics in the progress dialog box have discrepancies, review the conversion log to troubleshoot any issues. See Viewing the QTP conversion log, page 314.

Review and modify scripts Open converted workspaces and scripts. Scan for any syntax errors or other issues. Review any comments added during the conversion. Comments are indicated with an apostrophe and appended after statements. These comments provide information about statements you should modify or remove for best results.

Note: Statements starting with QTPCompat, such as QTPCompatSetCaretPos, may be added to converted scripts. These statements help QA Wizard Pro test actions that are performed differently in QTP, but they are not supported statements in the scripting language. We recommend replacing QTPCompat statements with the recommended QA Wizard Pro statement provided in the comments for best results.

See Modifying Scripts, page 145 for information.

313 Viewing the QTP conversion log

Run scripts Run scripts to verify that they complete successfully. See Running scripts, page 73. If scripts do not run successfully, you may need to make changes to the script or application repository. Review the results report to identify any issues. See Viewing results reports, page 75.

Tip: You can also debug scripts to troubleshoot issues. See Running scripts in debug mode, page 211.

Viewing the QTP conversion log A log file is generated during each QTP conversion. The log includes details about each item converted to QA Wizard Pro and any ignored items. The log can help you or Perforce Support troubleshoot conversion issues or understand how a specific item was converted. 1. Click View Log in the Convert to QTP - Progress dialog box when the conversion is complete. The conversion log opens in the default text editor application.

Note: You can also open the log from the QA Wizard Pro directory in the AppData directory for the user who ran the conversion (e.g., C:\Users\JeffUser\AppData\Roaming\Perforce\QA Wizard Pro). Log files are named QTPConversionLog followed by the date and time the conversion was performed. For example, QTPConversionLog_1_10_2013.txt.

2. Close the log when you are finished.

Troubleshooting QTP conversions To avoid issues that prevent scripts from running successfully, make sure you review the conversion results and scripts after converting from QTP. See Reviewing QTP conversion results, page 312. Addressing any comments added to converted scripts helps resolve many issues that cause script failures. You can also view the conversion log for details about each QTP item processed and converted. See Viewing the QTP conversion log, page 314. Following are some common issues that occur after converting scripts to QTP.

Items selected using indexes are incorrect QA Wizard Pro uses 1-based indexes and QTP uses 0-based indexes. You must increment references to indexes in statements by 1. For example, in the following statement, 9 must be updated to 10 to select the correct cell in the grid. Window("WysiCorp").Grid("NameGrid").Cell(rowIndex, 9).Select()

Windows or controls are not found during playback If scripts fail because windows or controls are not found, you may want to check the window and control names in scripts against the names in the application repository. See Modifying window and control properties, page 122. If the names do not match, modify scripts or the repository to use the correct name. QTP items are only renamed during conversion if a conflict occurs. To view the original QTP object name, right-click the window or control in the application repository and choose Properties. The QTP Object Name property value is the original QTP name.

314 Troubleshooting QTP conversions

Note: If QTP items were not converted successfully and you are unable to resolve the issues, contact Perforce Support and provide any conversion logs for troubleshooting.

315

Setting Up RDBMS Databases

The QA Wizard Pro Server database is stored in a Relational Database Management System (RDBMS). SQLite is the default database type and does not require any setup or configuration before or after installation. QA Wizard Pro data can also be stored in other RDBMS types, which allows you to leverage your existing database administration process. Microsoft SQL Server, Oracle, and PostgreSQL are supported. See QA Wizard Pro Server RDBMS Support for information about supported database versions. Review the following information for help setting up databases for use with QA Wizard Pro. n Oracle n PostgreSQL n SQL Server

Setting up Oracle databases Perforce does not provide support for installing, configuring, or maintaining Oracle. A qualified Oracle database administrator should install and configure the database and create the required schemas and tablespaces. Keep the following in mind: n Do not add, delete, or modify any fields in the QA Wizard Pro tables. n Do not directly add, edit, or delete any data in the tables. n Do not create different primary keys. This will adversely affect application performance. n Do not create complex triggers on any of the tables. Triggers may cause severe database issues and correcting these issues is not covered by Perforce. n Create a process to back up database tables on a regular schedule. n Running Oracle and the QA Wizard Pro Server on the same computer can result in slow performance if not configured correctly. Make sure Oracle is configured correctly to avoid using all the system memory.

Connecting to Oracle The recommended method for using Oracle is via Oracle Call Interface (OCI). Download and install the required Oracle Instant Client libraries.

Creating database tables The QA Wizard Pro Server automatically creates tables when you start the server or convert the server database. The QAWServerDbCreate.sql script file, which is located in the Oracle directory in the QA Wizard Pro application directory, is used to create the tables.

Creating Oracle users You must create an Oracle user for the QA Wizard Pro Server. The user only requires default connection privileges and should not have any Oracle DBA privileges. Use your preferred tablespace management for the users. An easy method is to set up the user to share the USERS tablespace and to enable an unlimited quota.

317 Setting up PostgreSQL databases

Sizing, memory, and tuning Oracle sizing and tuning settings should be consistent with your corporate standards. Review the SQL scripts for schema creation installed with the QA Wizard Pro Server to determine the appropriate settings.

Setting up PostgreSQL databases Perforce does not provide support for installing, configuring, or maintaining PostgreSQL. A qualified PostgreSQL database administrator should install and configure the database. Keep the following in mind: n Do not add, delete, or modify any fields in the QA Wizard Pro tables. n Do not directly add, edit, or delete any data in the tables. n Do not create different primary keys. This will adversely affect application performance. n Do not create complex triggers on any of the tables. Triggers may cause severe database issues and correcting these issues is not covered by Perforce. n Create a process to back up database tables on a regular schedule. n Running PostgreSQL and the QA Wizard Pro Server on the same computer can result in slow performance if not configured correctly. Make sure PostgreSQL is configured correctly to avoid using all the system memory.

Creating server database tables The QA Wizard Pro Server automatically creates tables in PostgreSQL when you start the server or convert the server database. The QAWServerDbCreate.sql script file, which is located in the PostgreSQL directory in the QA Wizard Pro application directory, is used to create the tables.

Setting up SQL Server databases Perforce does not provide support for installing, configuring, or maintaining SQL Server. A qualified SQL Server database administrator should install and configure the database. Keep the following in mind: n Do not add, delete, or modify any fields in the QA Wizard Pro tables. n Do not directly add, edit, or delete any data in the tables. n Do not create different primary keys. This will adversely affect application performance. n Do not create complex triggers on any of the tables. Triggers may cause severe database issues and correcting these issues is not covered by Perforce. n Create a process to back up database tables on a regular schedule. n Running SQL Server and the QA Wizard Pro Server on the same computer can result in slow performance if not configured correctly. Make sure SQL Server is configured correctly to avoid using all the system memory.

Note: You must be a member of the db_ddladmin role and have the CREATE TABLE, CREATE PROCEDURE, and CREATE VIEW permissions to create the QA Wizard Pro tables.

318 Troubleshooting RDBMS connections

Creating server database tables The QA Wizard Pro Server automatically creates tables when you start the server or convert the server database. The QAWServerDbCreate.sql script file, which is located in the SQLServer directory in the QA Wizard Pro application directory, is used to create the tables.

Troubleshooting RDBMS connections The following information can help you troubleshoot common RDBMS issues. Refer to the database vendor documentation for additional help.

Note: If the QA Wizard Pro Server cannot connect to the server database, errors are added to the Windows Event Log.

The QA Wizard Pro Server cannot start because another QA Wizard Pro Server is using the same database This error occurs when the database is in use by a different QA Wizard Pro Server. You must manually modify the QA Wizard Pro Server connection information to point to a different database and restart the server.

SQL Server connection errors

Error Cause

System.Data.SqlClient.SqlException Login failed for The database connection was not configured to user '(null)'. Reason: not associated with a trusted use Windows Authentication in the QA Wizard SQL Server connection. Pro Server Admin Utility.

System.Data.SqlClient.SqlException Login failed for The username or password entered in the user 'xxxx'. database connection information is not valid.

Oracle connection errors

Error Cause

System.Exception The Oracle Instant client drivers are not installed. See Setting up Oracle System.Data.OracleClient databases, page 317 for information about downloading the installers. requires Oracle client software version 8.1.7 or greater.

319 Troubleshooting RDBMS connections

Error Cause

ORA-12514: TNS:listener The service name specified in the RDBMS connection information does not does not currently know of exist. Make sure that an Oracle listener was created with the specified service requested in service name on the host computer. connect descriptor QOCI This error can also occur if a version of the full Oracle client older than 10g is installed. If the full client appears in the PATH environment variable, the older oci.dll may be loaded. To resolve this issue, search for all instances of the oci.dll file. If multiple copies are found, remove the other copies or remove their directory reference from the PATH environment variable.

ORA-12154: TNS:could The computer specified in the RDBMS connection host name cannot be not resolve the connect found. Make sure the host name is correct and the host computer is running. identifier specified QOCI

ORA-12541: TNS:no The port number specified in the RDBMS connection information is not a listener QOCI valid TNS listener port on the specified host computer. Check the host port number.

ORA-01017: invalid The username or password specified in the RDBMS connection information username/password; is not valid. Check the username and password. logon denied QOCI

PostgreSQL connection errors

Error Cause

Opening the database connection failed because the The QA Wizard Pro Server cannot connect to the QA Wizard Pro Server could not connect to the server PostgreSQL service. Check the following and or translate the host name then restart the server:

n The PostgreSQL service is running.

n The host name and port number are correct.

n A firewall is not blocking the port.

n If connecting to a remote PostgreSQL server, the server is configured to accept remote connections.

320 Statements

Statements are instructions that specify how QA Wizard Pro interacts with an application. Some statements are automatically added to scripts during recording, while others must be added manually. Statements can also control the flow of scripts, perform actions outside of the application, and return values to variables. Statements are grouped in the following categories:

n Application Control n Integrated Actions n QA Wizard Pro

n Checkpoint n JSON n Script Control

n Comment n Keyboard Actions n Stress

n Conditional n Load Testing n String

n Datasheet n Loop n System

n Date/Time n Math n Timing

n Error Handling n Mouse Actions n Touch Actions

n File n Object Actions n Web

n Helix ALM n OCR n Web Browser Actions

n Image n Programming n Window Actions

Note: Some statements accept null arguments and return null values. If a statement cannot accept or return a null value, an error is returned.

Application control statements Application control statements perform actions at the application level.

Statement Description More information

BoundaryChecks Activates or inactivates BoundaryChecks, page 360 boundary checking for mouse coordinates, which prevents entering coordinates outside a control's boundary.

CaptureScreenshot Captures a screenshot after CaptureScreenshot, page 360 a statement runs and saves it as a PNG file.

GetControlSearchTimeout Returns the maximum time GetControlSearchTimeout, page 425 set to find a window or control in the application.

321 Application control statements

Statement Description More information

GetCurrentBrowserType Returns an integer that GetCurrentBrowserType, page 426 indicates the browser running the script.

GetLowLevelSpeed Returns the playback speed GetLowLevelSpeed, page 434 set for low-level actions.

GetPlaybackDelay Returns the delay set GetPlaybackDelay, page 436 between each statement.

GetPropertyMap Returns a map of all GetPropertyMap, page 437 property names and values from a window or control. Additional statements can be called on a PropertyMap, but are not available in the Add Statement dialog box. See PropertyMap statements, page 344.

GetPropertyNames Returns an array of all GetPropertyNames, page 438 property names from a window or control.

IgnoreAutocompleteDropDowns Ignores autocomplete drop- IgnoreAutocompleteDropDowns, down lists in web page 452 applications.

IsIgnoringAutocompleteDropDowns Returns True or False to IsIgnoringAutocompleteDropDowns, indicate if autocomplete page 458 drop-down lists are ignored.

Property Returns a window or control Property, page 509 property value.

Script.ClearContext Terminates the existing Script.ClearContext, page 529 connection to an application in the application repository.

Script.ClearLoadTestContext Terminates the existing Script.ClearLoadTestContext, page connection to an application 529 in the application repository when running a load test.

Script.CloseApp Closes all applications QA Script.CloseApp, page 530 Wizard Pro is currently connected to.

322 Application control statements

Statement Description More information

Script.ConnectToProcess Connects to an application Script.ConnectToProcess, page 530 running on the test computer.

Script.GetContext Returns the application Script.GetContext, page 531 name and version number the script is running against.

Script.GetLoadTestContext Returns the application Script.GetLoadTestContext, page name and version number 532 the load test is running against.

Script.RunApp Starts the application to use Script.RunApp, page 532 during playback.

Script.SetBrowser Sets the browser used to Script.SetBrowser, page 533 run the script.

Script.SetContext Establishes a connection to Script.SetContext, page 534 the application repository and specifies the application name and version to use.

Script.SetLoadTestContext Establishes a connection to Script.SetLoadTestContext, page the application repository 534 and specifies the URL and version number to use for a load test.

SetControlSearchTimeout Sets the maximum time to SetControlSearchTimeout, page 540 wait for QA Wizard Pro to search for a window or control in the application.

SetLowLevelSpeed Sets the playback speed of SetLowLevelSpeed, page 545 low-level actions.

SetPlaybackDelay Sets the number of SetPlaybackDelay, page 546 milliseconds to wait between statements during playback.

323 Checkpoint statements

Statement Description More information

WaitForExists Waits a period of time for a WaitForExists, page 567 window or control to exist before continuing with the next statement and returns True or False to indicate if it is found.

WaitForExistsTimed Waits a period of time for a WaitForExistsTimed, page 568 window or control to exist before continuing with the next statement and returns the number of milliseconds it took to find it.

WaitForProperty Waits a period of time to find WaitForProperty, page 569 a value in a window or control property before continuing with the next statement and returns True or False to indicate if it is found.

Checkpoint statements Checkpoint statements verify values and images against expected results.

Statement Description More information

CheckExists Verifies a window or control exists in the CheckExists, page 362 application.

Checkpoint Verifies the value of a window and control Checkpoint, page 363 property matches an expected value.

CheckpointExpression Verifies if the value returned by an CheckpointExpression, expression is True. page 364

CheckpointImage Verifies an image in an application matches CheckpointImage, page 364 an expected image.

CheckpointStringExists Verifies a substring exists in a text string. CheckpointStringExists, page 365

CheckpointStringNotExists Verifies a substring does not exist in a text CheckpointStringNotExists, string. page 366

324 Comment statements

Comment statements Comment statements add comments to scripts, which can help you explain how a script works to other testers.

Statement Description More information

# (Outline Block) Organizes script lines in collapsible groups. # (Outline Block), page 351

Rem Adds a comment to a script. Rem, page 516

Conditional statements Conditional statements evaluate an expression and run a block of script steps depending on the result.

Statement Description More information

Case Contains a value that is compared to the resulting value of an expression Case, page in a Select...Case statement. 361

Else Runs an alternate block of statements when an If or ElseIf statement Else, page condition is False. 392

ElseIf A combination of If and Else statements. Runs an alternate block of ElseIf, page statements when an If statement condition is False and an alternate 392 condition is True.

If Conditionally runs a block of statements based on the value of an If, page 451 expression (True or False).

Select...Case Performs one of several blocks of statements for a condition with more Select...Case, than two outcomes. Compares the result of an expression against page 536 values in one or more Case statements.

Datasheet statements Datasheet statements return values from script data sources.

Statement Description More information

Cell Returns the value from a column in the Cell, page 362 current row of the script data source.

CommitRecordsetRow Adds a data row to the current CommitRecordsetRow, page recordset. 370

CreateRecordsetRow Returns a new data row that can be CreateRecordsetRow, page populated and added to a recordset. 375

325 Datasheet statements

Statement Description More information

DeleteRecordsetRow Deletes the current row from a DeleteRecordsetRow, page recordset. 386

FirstRow Makes the first row in a recordset the FirstRow, page 417 active row.

GetDataSourceColumnNames Returns an array of column names GetDataSourceColumnNames, from the data source associated with page 427 the script.

GetRecordsetColumnNames Returns an array of column names GetRecordsetColumnNames, from a recordset or data row. page 439

GetRowValue Returns the column value from the GetRowValue, page 440 current row of a recordset.

GetSQLScalar Returns a value from a data source GetSQLScalar, page 442 linked to an external datasheet based on a SQL scalar query.

LastRow Makes the last row in a recordset the LastRow, page 472 active row.

NextRow Moves to the next row in a recordset. NextRow, page 491

OpenRecordset Returns a recordset object opened OpenRecordset, page 504 from a datasheet.

OpenRecordsetQuery Returns a recordset object from a data OpenRecordsetQuery, page source linked to an external datasheet 505 based on a SQL query.

PrevRow Moves to the previous row in a PrevRow, page 508 recordset.

RecordsetBOF Returns True or False to indicate if the RecordsetBOF, page 513 current recordset row index is before the beginning of the data.

RecordsetEOF Returns True or False to indicate if the RecordsetEOF, page 514 current recordset row index is past the end of the data.

RecordsetRowCount Returns the total number of records in RecordsetRowCount, page 515 a recordset.

RunSQLCommand Runs a SQL command on a data RunSQLCommand, page 526 source linked to an external datasheet and returns the number of rows the command is performed on.

326 Date/time statements

Statement Description More information

SetCell Sets the column value in the current SetCell, page 539 row of the script data source.

SetRowValue Sets a field value in a recordset or data SetRowValue, page 547 row.

Date/time statements Date/time statements convert, query, and return date/time values.

Statement Description More information

Date Returns the date in MM/DD/YYYY format based on integers that Date, page 376 represent the year, month, and day.

DateAdd Adds a time to a date/time value and returns the resulting value in DateAdd, page the short date and time format used on the test computer. 377

DateDiff Returns the difference between two date/time values based on an DateDiff, page interval type. 378

DatePart Returns a part from a date/time value as an integer. DatePart, page 379

DateTime Returns the date and time in MM/DD/YYYY format based on DateTime, page integers that represent the year, month, day, hour, minute, and 380 second.

DateTimeFormat Returns the date or time in a specified format. DateTimeFormat, page 381

Day Returns the day from a date/time value. Day, page 383

Hour Returns the hour from a date/time value. Hour, page 449

IsDate Returns True or False to indicate if a date/time string is valid. IsDate, page 461

Minute Returns the minute from a date/time value. Minute, page 481

Month Returns the month from a date/time value as an integer. Month, page 484

MonthName Returns a month name based on a month integer. MonthName, page 485

MonthNum Returns a month integer based on a month name. MonthNum, page 485

327 Error handling statements

Statement Description More information

Now Returns the current date and time in the format used on the test Now, page 491 computer.

Second Returns the seconds from a date/time value. Second, page 535

Time Returns the time in seconds since epoch (January 1, 1970 12:00 Time, page 560 AM).

Today Returns the current date in MM/DD/YYYY format. Today, page 560

Weekday Returns a weekday integer that represents the day of the week for Weekday, page a date. 590

WeekdayName Returns a weekday name based on a weekday integer. WeekdayName, page 591

WeekdayNum Returns a weekday integer based on a weekday name. WeekdayNum, page 591

Year Returns the year from a date/time value. Year, page 593

Error handling statements Error handling statements specify how to handle errors that occur during playback and return error information.

Statement Description More information

Err.Clear Clears error information from the Err object. Err.Clear, page 396

Err.CallStack Returns the stack of function, subroutine, script, and Try Err.CallStack, page calls up to the script line where the last error occurred. 395

Err.Description Returns a string with the last error that occurred, as defined Err.Description, in the Err.Raise statement. page 396

Err.LineNumber Returns the script line number where an error occurred. Err.LineNumber, page 397

Err.LineText Returns text from the script line where the last error Err.LineText, page occurred. 398

Err.Number Returns the error number for the last error that occurred, as Err.Number, page defined in the Err.Raise statement. 399

Err.Raise Generates a script error. Err.Raise, page 400

328 File statements

Statement Description More information

Err.ScriptName Returns the script name that an error occurred in. Err.ScriptName, page 401

Err.Source Returns a string that identifies where the last error occurred, Err.Source, page as defined in the Err.Raise statement. 401

Fail Stops script playback, displays a message in the Errors Fail, page 408 pane, and adds the message to the run report.

GetCallStack Returns the complete stack of function, subroutine, script, GetCallStack, page and Try calls up to the current script line. 423

GetVariableValues Returns all script and repository variables and the current GetVariableValues, values as a string. page 446

IgnoreErrors Stops displaying errors in the Errors pane during playback IgnoreErrors, page and in run reports. 453

IgnoreWarnings Stops displaying warnings in the Errors pane during IgnoreWarnings, playback and in run reports. page 453

IsIgnoringErrors Returns True or False to indicate if errors are displayed in IsIgnoringErrors, the Errors pane during playback and in run reports. page 458

IsIgnoringWarnings Returns True or False to indicate if warnings are displayed IsIgnoringWarnings, in the Errors pane during playback and in run reports. page 459

On Error Sets the error handling behavior for a script, function, or On Error, page 504 subroutine.

Throw Regenerates the error handled by the containing Catch Throw, page 559 block.

Try...Catch...Finally Wraps a block of statements where errors may occur. Try...Catch...Finally, Statements in the Try block run until an error occurs. If an page 565 error occurs, playback continues with statements in the Catch block. Statements in the Finally block always run even if errors do not occur.

Warning Displays a warning message in the Errors pane and adds it Warning, page 570 to the run report.

File statements File statements perform actions on and return values from files and directories.

Note: QA Wizard Pro uses full paths to search for files and directories referenced in scripts. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

329 File statements

Statement Description More information

AppendToFile Appends text to a file. Creates the file if it does not AppendToFile, page 355 exist.

CombinePaths Combines two directory paths into one and returns CombinePaths, page the combined path. 369

CompareFileContents Returns True or False to indicate if two files are CompareFileContents, identical. page 370

CopyFile Copies a file to a new location. CopyFile, page 373

CreateDirectory Creates a directory and subdirectories in a path. CreateDirectory, page 374

CreateTempFile Creates an empty temporary file and returns the full CreateTempFile, page path. 376

DeleteDirectory Deletes a directory. DeleteDirectory, page 385

DeleteFile Deletes a file. DeleteFile, page 386

DirectoryExists Returns True or False to indicate if a directory DirectoryExists, page exists. 387

FileBaseName Returns a filename without the extension or FileBaseName, page directory. 408

FileDateCreated Returns the date and time a file or directory was FileDateCreated, page created. 409

FileDateLastModified Returns the date and time a file or directory was last FileDateLastModified, modified. page 409

FileDirectoryName Returns the directory from a path from a file path or FileDirectoryName, the parent directory path from a subdirectory path. page 410

FileExists Returns True or False to indicate if a file exists. FileExists, page 410

FileExtension Returns a file extension, including the period, from a FileExtension, page 411 file path.

FileFullPath Returns a full path to a file in a relative path. FileFullPath, page 412

FileName Returns the filename and extension from a path. FileName, page 412

FileReadOnly Returns True or False to indicate if a file is read-only. FileReadOnly, page 413

FileRootDirectoryName Returns the root directory from a path. FileRootDirectoryName, page 413

330 Helix ALM statements

Statement Description More information

FileSize Returns the size of a file in bytes. FileSize, page 414

FileType Returns the type of a file or directory. FileType, page 414

GetCurDir Returns the current working directory for QA Wizard GetCurDir, page 426 Pro.

GetDirectory Returns the path to a system or QA Wizard Pro GetDirectory, page 428 directory.

GetDirectoryNames Returns an array of all subdirectory names from a GetDirectoryNames, directory or only the subdirectory names that match page 428 a search pattern.

GetFileNames Returns an array of all filenames from a directory or GetFileNames, page only the filenames that match a search pattern. 432

GetFilePath Returns the file path to a QA Wizard Pro script or GetFilePath, page 433 running application.

MoveDirectory Moves or renames a directory. MoveDirectory, page 487

MoveFile Moves or renames a file. MoveFile, page 488

ReadTextFile Reads a text file and returns the contents to a ReadTextFile, page 513 variable.

SetAllFilesReadOnly Sets or clears the read-only attribute on all files in a SetAllFilesReadOnly, directory. page 539

SetFileReadOnly Sets or clears the read-only attribute on a file. SetFileReadOnly, page 543

Helix ALM statements Helix ALM statements add issues to Helix ALM projects and identify test case steps.

Note: TestTrack was renamed Helix ALM starting with the 2017.1 release.

Statement Description More information

AddFileAttachment Attaches a file to a Helix ALM issue. AddFileAttachment, page 352

331 Image statements

Statement Description More information

AddIssue Adds an issue to the Helix ALM project configured for the AddIssue, page 353 workspace. Specified text is added to the Summary, Description, Steps to Reproduce, and Other Hardware and Software fields.

AddToHelixALM Adds an issue created by the NewIssue statement to the AddToHelixALM, Helix ALM project configured for the workspace after all field page 354 values to include are set.

GetFieldValue Returns the value of a Helix ALM issue field as a string. GetFieldValue, page 431

NewIssue Creates an empty Helix ALM issue. NewIssue, page 490

RemoveField Removes a field value from a Helix ALM issue. RemoveField, page 517

SetFieldValue Sets the value of a Helix ALM issue field. SetFieldValue, page 542

TestCaseStep Indicates the beginning of a Helix ALM test case step. TestCaseStep, page 559

Note: The following statements can also be called directly on a Helix ALM issue object: AddFileAttachment, AddToHelixALM, GetFieldValue, RemoveField, and SetFieldValue.

Image statements Image statements return values based on image comparisons and capture images of specified regions in applications relative to windows, controls, or the test computer screen.

Statement Description More information

CompareImage Returns True or False to indicate if an application CompareImage, page image captured during playback matches an 371 expected image within an accuracy percentage.

SaveRegionToImageFile Saves a region relative to a window, control, or the SaveRegionToImageFile, test computer screen as a PNG file. page 527

Integrated action statements Integrated action statements perform accessibility actions on controls, run statements against .NET properties, and retrieve data from the .NET framework.

332 JSON statements

Statement Description More information

GetDotNETProperty Returns the value of a .NET GetDotNETProperty, page 429 property.

GetDotNETPropertyWithArgs Returns the value of a .NET GetDotNETPropertyWithArgs, property with parameters in an page 430 array.

InvokeDotNETMethod Invokes a .NET method and returns InvokeDotNETMethod, page the method value. 454

InvokeDotNETMethodWithArgs Invokes a .NET method with InvokeDotNETMethodWithArgs, parameters in an array and returns page 455 the method value.

MSAADoDefaultAction Uses Active Accessibility to MSAADoDefaultAction, page perform a control's default action. 488

MSAASetName Uses Active Accessibility to set the MSAASetName, page 488 name of a control.

MSAASetValue Uses Active Accessibility to set the MSAASetValue, page 489 value of a control.

SetDotNETProperty Sets the value of a .NET property. SetDotNETProperty, page 544

SetDotNETPropertyWithArgs Sets the value of a .NET property SetDotNETPropertyWithArgs, with parameters in an array. page 545

JSON statements JavaScript Object Notation (JSON) statements validate, return, set, and remove values in JSONObjects and JSONArrays.

Note: The following statements are available in the Add Statement dialog box. Additional statements can be called on instances of JSONObjects and JSONArrays, but are not available in the Add Statement dialog box. See JSONArray statements, page 334 and JSONObject statements, page 335.

Statement Description More information

JSONArrayGetValue Returns the value of an index from a JSONArray JSONArrayGetValue, or a default value if the index is out of range. page 463

JSONArraySetValue Sets or adds the value to an index in a JSONArraySetValue, JSONArray and returns the modified array. page 464

JSONCanParseAsArray Returns True or False to indicate if an JSONCanParseAsArray, expression contains a JSONArray. page 465

333 JSON statements

Statement Description More information

JSONCanParseAsObject Returns True or False to indicate if an JSONCanParseAsObject, expression contains a JSONObject. page 465

JSONIsValid Returns True or False to indicate if an JSONIsValid, page 466 expression is valid JSON.

JSONNewArray Creates and returns an empty JSONArray. JSONNewArray, page 467

JSONNewObject Creates and returns an empty JSONObject. JSONNewObject, page 467

JSONObjectGetValue Returns the value of a property from a JSONObjectGetValue, JSONObject or a default value if the property page 467 name is not found.

JSONObjectSetValue Sets or adds the value to a property name in a JSONObjectSetValue, JSONObject and returns the modified object. page 468

JSONParse Returns a value after parsing an object using JSONParse, page 469 JSON syntax.

JSONArray statements The following statements can be called directly on an instance of a JSONArray class.

Statement Description More information

GetAllValues Returns values from a JSONArray as a user array. GetAllValues, page 422

GetLength Returns the number of values in a JSONArray. GetLength, page 433

GetValue Returns the value of an index in a JSONArray or a default value if the GetValue - index is out of range. JSONArray, page 444

InsertAt Inserts a value at an index in a JSONArray and pushes all values InsertAt, page 453 after it in the array back one position.

Pop Returns the last value in a JSONArray and then removes it. Pop, page 507

Push Appends a value to the end of a JSONArray. Push, page 511

RemoveAt Removes the value at an index in a JSONArray and returns True or RemoveAt, page False to indicate if it was successfully removed. 516

334 Keyboard action statements

Statement Description More information

SetValue Sets or adds a value to an index in a JSONArray. SetValue - JSONArray, page 549

ToString Converts a JSONArray type to a string and returns the string. ToString - JSONArray, page 561

JSONObject statements The following statements can be called directly on an instance of a JSONObject class.

Statement Description More information

GetPropertyNames Returns the property names for a JSONObject. GetPropertyNames - JSONObject, page 439

GetValue Returns the value of a property in a JSONObject or a GetValue - default value if the property name is not found. JSONObject, page 445

HasProperty Returns True or False to indicate if a property name exists HasProperty - in a JSONObject. JSONObject, page 447

RemoveProperty Removes a property from a JSONObject and returns True RemoveProperty, page or False to indicate if it was successfully removed. 518

SetValue Sets or adds a value to a property name in a JSONObject. SetValue - JSONObject, page 550

ToString Converts a JSONObject type to a string and returns the ToString - string. JSONObject, page 561

Keyboard action statements Keyboard action statements perform actions using the keyboard. These actions can be performed on a specified window or control or at the application level.

Statement Description More information

KeyDown Presses and holds one or more keyboard keys on a window or control, or at KeyDown, the application level. page 470

KeyPress Presses and releases one or more keyboard keys on a window or control, or KeyPress, at the application level. page 470

KeyUp Releases one or more keyboard keys on a window or control, or at the KeyUp, page application level. 471

335 Load testing statements

Statement Description More information

TypeText Enters text in a control or at the application level. TypeText, page 566

Load testing statements Load testing statements exchange data between an application and a web server in load test scripts.

Statement Description More information

GetVirtualUserID Returns the integer ID of the GetVirtualUserID, page 446 current virtual user.

WebAddNetworkCredential Adds a set of credentials to the WebAddNetworkCredential, page cache of network credentials 570 sent with all web requests.

WebAddSessionVariable Adds a form variable to look for in WebAddSessionVariable, page input fields on responses from 571 the WebGet and WebPost statements and replaces the variable value captured during recording with the value returned from the web server.

WebClearAllCustomHeaders Clears all custom headers WebClearAllCustomHeaders, created by page 572 WebSetCustomHeader statements sent with all web requests.

WebClearNetworkCredentials Clears the cache of network WebClearNetworkCredentials, credentials created by page 572 WebAddNetworkCredential statements sent with all web requests.

WebCloseAllConnections Closes all open connections to WebCloseAllConnections, page all web servers. 572

WebCloseConnection Closes the connection to a web WebCloseConnection, page 573 server.

WebDelete Sends a DELETE command and WebDelete, page 573 returns the data received from a web page.

336 Load testing statements

Statement Description More information

WebGet Sends a GET command and WebGet, page 574 returns the data retrieved from a web page.

WebGetCookie Returns the cookie value set by a WebGetCookie, page 575 WebSetCookie, WebGet, or WebPost statement.

WebGetAllCustomHeaders Returns an array of custom WebGetAllCustomHeaders, page header names set by 574 WebSetCustomHeader statements.

WebGetCustomHeader Returns the header value set by WebGetCustomHeader, page 576 a WebSetCustomHeader statement.

WebGetReferrer Returns the referrer set by a WebGetReferrer, page 577 WebSetReferrer statement.

WebGetUserAgent Returns the browser user agent. WebGetUserAgent, page 578

WebHead Sends a HEAD command and WebHead, page 578 returns the data received from a web page.

WebOptions Sends an OPTIONS command WebOptions, page 579 and returns the requests accepted by the web server that hosts the URL.

WebPatch Sends a PATCH command and WebPatch, page 579 returns the data received from a web page.

WebPatchFromFile Sends a PATCH command from WebPatchFromFile, page 580 a file and returns the data received from a web page.

WebPatchJSON Sends a PATCH command from WebPatchJSON, page 581 a JSON statement and returns the data received from web page.

WebPost Sends a POST command and WebPost, page 581 returns the data received from a web page.

337 Load testing statements

Statement Description More information

WebPostFromFile Sends a POST command from a WebPostFromFile, page 582 postdata file and returns the data received from a web page.

WebPostJSON Sends a POST command from a WebPostJSON, page 583 JSON statement and returns the data received from a web page.

WebPut Sends a PUT command and WebPut, page 584 returns the data received from a web page.

WebPutFromFile Sends a PUT command from a WebPutFromFile, page 584 file and returns the data received from a web page.

WebPutJSON Sends a PUT command from a WebPutJSON, page 585 JSON statement and returns the data received from a web page.

WebRemoveAllSessionVariables Stops updating all form variables WebRemoveAllSessionVariables, set by WebAddSessionVariable page 586 statements for all web requests.

WebRemoveCustomHeader Removes a custom header set WebRemoveCustomHeader, by a WebSetCustomHeader page 586 statement from the list of headers sent with all web requests.

WebRemoveSessionVariable Stops updating a form variable WebRemoveSessionVariable, set by a page 587 WebAddSessionVariable statement for all web requests.

WebSetCookie Sets a cookie to send with other WebSetCookie, page 588 load testing statements.

WebSetCustomHeader Sets a custom header to send WebSetCustomHeader, page 588 with other load testing statements.

WebSetReferrer Sets the referrer URL used by WebSetReferrer, page 589 other load testing statements.

WebSetUserAgent Overrides the browser user agent WebSetUserAgent, page 590 sent by the client with a custom user agent.

338 Loop statements

Loop statements Loop statements repeat a block of script steps a specific number of times or while a condition is true or false.

Statement Description More information

Do...Loop Repeats a block of statements as long as a condition is False or until an Exit Do...Loop Until Do statement runs. Until, page 388

Do...Loop Repeats a block of statements as long as a condition is True or until an Exit Do...Loop While Do statement runs. The condition is evaluated at the end of the loop. While, page 389

For Repeats a block of statements once for each element in a group, such as an For Each...Next array. Not available in the Add Statement dialog box. Each...Next, page 418

For...Next Repeats a block of statements a specified number of times or until an Exit For...Next, For statement runs. page 419

While Repeats a block of statements as long as a condition is True or until an Exit While, page While statement runs. The condition is evaluated at the beginning of the 592 loop.

Math statements Math statements convert values, return different representations of values, and generate random numbers.

Statement Description More information

Abs Returns the absolute value of a number. Abs, page 352

ASCII Returns the ASCII value of a character. ASCII, page 357

Cos Returns the cosine of a number. Cos, page 373

Float Returns the floating point representation of a value. Float, page 418

Integer Returns the integer representation of a value. Integer, page 454

Max Returns the larger of two numbers. Max, page 479

Min Returns the smaller of two numbers. Min, page 480

Rand Returns a random number between two integers. Rand, page 511

339 Mouse action statements

Statement Description More information

SRand Sets the random number generator seed, or starting point, for random SRand, page 554 integers.

Sin Returns the sine of a number. Sin, page 553

Mouse action statements Mouse action statements perform actions using the computer's mouse. Most of these actions can be performed on a specified window or control or at the application level.

Statement Description More information

Click Clicks a control or the mouse at Click, page 367 the pointer's current location.

DoubleClick Double-clicks a control or the DoubleClick, page 390 mouse at the pointer's current location.

Hover Moves the mouse pointer to a Hover, page 449 control and holds it.

LMouseClick Clicks the left mouse button in a LMouseClick, page 473 location.

LMouseDoubleClick Double-clicks the left mouse LMouseDoubleClick, page 474 button in a location.

LMouseDown Presses the left mouse button in LMouseDown, page 475 a location.

LMouseUp Releases the left mouse button in LMouseUp, page 476 a location.

MMouseClick Clicks the middle mouse button MMouseClick, page 481 in a location.

MMouseDoubleClick Double-clicks the middle mouse MMouseDoubleClick, page 482 button in a location.

MMouseDown Presses the middle mouse button MMouseDown, page 483 in a location.

MMouseUp Releases the middle mouse MMouseUp, page 484 button in a location.

340 Object action statements

Statement Description More information

MouseMove Moves the mouse pointer to a MouseMove, page 486 location.

MouseMoveFromCurrentPosition Moves the mouse pointer a MouseMoveFromCurrentPosition, number of pixels from the current page 487 location.

RMouseClick Clicks the right mouse button in a RMouseClick, page 521 location.

RMouseDoubleClick Double-clicks the right mouse RMouseDoubleClick, page 522 button in a location.

RMouseDown Presses the right mouse button in RMouseDown, page 523 a location.

RMouseUp Releases the right mouse button RMouseUp, page 523 in a location.

Object action statements Object action statements perform actions on application controls.

Statement Description More information

Clear Clears a check box control. Clear, page 367

Collapse Collapses an expanded node in a tree control. Collapse, page 368

DragTo Drags an HTML link or element to a location. DragTo, page 391

Expand Expands a node in a tree control. Expand, page 404

GetNumItems Returns the number of items in a control. GetNumItems, page 436

InvokeJavaScript Returns the result of JavaScript evaluated in a window. InvokeJavaScript, page 456

Range Selects a range based on cursor position. Range, page 512

Select Selects an item in a control. Select, page 537

SelectRow Selects a row in a grid control by index number. SelectRow, page 538

Set Selects a check box control. Set, page 538

SetDate Sets the date in a calendar or date/time picker control. SetDate, page 540

SetDateRange Sets a date range in a calendar control. SetDateRange, page 541

341 OCR statements

Statement Description More information

SetDateTime Sets the date and time in a date/time picker control. SetDateTime, page 541

SetText Enters a value in a control and replaces existing text. SetText, page 548

SetTime Sets the time in a date/time picker control. SetTime, page 548

SetValue Sets a value on a slider or spin box control. SetValue, page 549

OCR statements Optical character recognition (OCR) statements read graphical text in applications and convert it to text strings, adjust settings to improve the accuracy of the returned text, and return information about the settings used during playback.

Statement Description More information

OCRCheckpoint Verifies graphical text OCRCheckpoint, page 491 against an expected value using OCR comparison.

OCRCheckpointPreviousStatement Verifies graphical text in the OCRCheckpointPreviousStatement, screenshot captured for the page 493 action performed in the previous statement against an expected value using OCR comparison.

OCRConvertToGrayscale Converts an image to OCRConvertToGrayscale, page 493 grayscale before reading it using OCR.

OCRGetContrast Returns the amount of color OCRGetContrast, page 494 contrast used for OCR.

OCRGetLanguageFilePath Returns the path to the OCRGetLanguageFilePath, page language file used for OCR. 495

OCRGetScale Returns the image scale OCRGetScale, page 496 used for OCR.

OCRGetText Returns the text found OCRGetText, page 497 using OCR in a specified region, window, or control.

OCRGetTextFromFile Returns the text found OCRGetTextFromFile, page 498 using OCR in an image file.

342 Programming statements

Statement Description More information

OCRGetTextPreviousStatement Returns the text found OCRGetTextPreviousStatement, using OCR in the page 499 screenshot captured for the action performed in the previous statement.

OCRIsConvertingToGrayscale Returns True or False to OCRIsConvertingToGrayscale, indicate if images are page 500 converted to grayscale before reading them using OCR.

OCRSetContrast Sets the amount of color OCRSetContrast, page 501 contrast in an image before reading it using OCR

OCRSetLanguageFilePath Sets the path to the OCRSetLanguageFilePath, page language file to use when 502 reading an image using OCR.

OCRSetScale Sets the scale of an image OCRSetScale, page 503 before reading it using OCR.

Programming statements Programming statements return information about scripts and other components.

Statement Description More information

ArrayClear Clears an array. ArrayClear, page 356

ArraySize Returns the size of an array in a dimension. ArraySize, page 356

ArrayToJSONArray Converts an array to a JSONArray and returns it. ArrayToJSONArray, page 357

Assignment Declares a variable and a value that can be used Assignment, page 358 later.

Boolean Returns the Boolean representation of a value. Boolean, page 359

CreateGUID Creates and returns a globally unique identifier CreateGUID, page 374 (GUID) string.

CreateObject Creates and returns a COM object instance. CreateObject, page 375

343 PropertyMap statements

Statement Description More information

EvaluateRegExpression Evaluates a regular expression and returns True or EvaluateRegExpression, False to indicate if it matches a value. page 402

ExternalAssemblyCall Loads a .NET assembly, creates an instance of the ExternalAssemblyCall, class, and calls the requested method. page 404

ExternalCall Invokes a public method on an instance of a class ExternalCall, page 406 loaded by the LoadExternalAssembly statement and returns the value of the method.

GetScriptVariable Returns the value of a variable defined in a called GetScriptVariable, page script. 442

IsArray Returns True or False to indicate if an expression is IsArray, page 457 an array.

IsJSONArray Returns True or False to indicate if an expression is IsJSONArray, page 459 a JSONArray type.

IsJSONObject Returns True or False to indicate if an expression is IsJSONObject, page 460 a JSONObject type.

IsJSONType Returns True or False to indicate if an expression is IsJSONType, page 460 a JSONObject or JSONArray type.

IsNull Returns True or False to indicate if a value is null. IsNull, page 462

IsNumeric Returns True or False to indicate if an expression is IsNumeric, page 462 numeric.

IsObject Returns True or False to indicate if an expression is IsObject, page 463 a dynamic COM object.

LoadExternalAssembly Returns an instance of a class loaded from a .NET LoadExternalAssembly, assembly. page 476

ScriptName Returns the name of the running script. ScriptName, page 535

SetScriptVariable Sets the value of a variable defined in a called SetScriptVariable, page script. 547

PropertyMap statements PropertyMap statements return information about PropertyMap object properties.

Statement Description More information

HasProperty Returns True or False to indicate if a property name exists in a HasProperty - PropertyMap. PropertyMap, page 448

344 QA Wizard Pro statements

Statement Description More information

Property Returns the value of a property in a PropertyMap or a default Property - PropertyMap, value if the property is not found. page 510

Size Returns the number of properties in a PropertyMap. Size, page 554

QA Wizard Pro statements QA Wizard Pro statements control actions performed by QA Wizard Pro.

Statement Description More information

Alert Displays a message in an alert dialog box. Alert, page 355

Beep Plays a beep sound. Beep, page 359

ClearOutput Clears any messages displayed in the Output ClearOutput, page 367 pane.

General Used to add any statement or function to a General, page 422 script from the Add Statement dialog box, including advanced statements only available in Text View.

GetPlaybackSessionName Returns the name set for the playback GetPlaybackSessionName, session sent to the QA Wizard Pro Server. page 437

Print Displays a message in the Output pane. Print, page 508

PrintLn Displays a message on a new line in the PrintLn, page 509 Output pane.

SetPlaybackSessionName Sets the name for the playback session sent SetPlaybackSessionName, to the QA Wizard Pro Server. page 546

Script control statements Script control statements control how QA Wizard Pro interacts with applications and runs scripts.

Statement Description More information

Exit Exits the Do, While, For, Select, Function, and Sub Exit, page 403 statements.

GetDiagnostics Returns True or False to indicate if playback diagnostic GetDiagnostics, page information logging is enabled. 427

RunScriptRemote Runs a script on a remote computer. RunScriptRemote, page 526

345 Stress statements

Statement Description More information

Script.CallScript Runs another script in the workspace and then returns Script.CallScript, page to the current script. 528

Script.GetLineNumber Returns the current line number for the script. Script.GetLineNumber, page 531

SetDiagnostics Enables or disables playback diagnostic information SetDiagnostics, page logging to help with troubleshooting if QA Wizard Pro 542 cannot identify a control.

Stress statements Stress statements simulate stress conditions in the target application.

Statement Description More information

DisableNetworking Disables all network DisableNetworking, page 387 adapters and returns the number of adapters successfully disabled.

EnableNetworking Enables all network adapters EnableNetworking, page 393 disabled by the DisableNetworking statement and returns the number of adapters successfully enabled.

SimulateDriveReadOnly Simulates a read-only drive. SimulateDriveReadOnly, page 551

SimulateDriveRemainingSpace Simulates a drive with SimulateDriveRemainingSpace, remaining free space. page 551

SimulateMemoryPerAllocationLimit Simulates the maximum SimulateMemoryPerAllocationLimit, amount of memory available page 552 to the application for each allocation attempt.

SimulateMemoryRemainingSpace Simulates memory with an SimulateMemoryRemainingSpace, amount of remaining free page 552 space.

String statements String statements convert and query strings and return values.

346 String statements

Statement Description More information

Chr Returns the character representation of a Unicode value. Chr, page 366

ContainsSubStr Returns True or False to indicate if a string contains a ContainsSubStr, substring. page 372

DecimalSeparator Returns the decimal separator based on regional settings. DecimalSeparator, page 384

DecryptString Decrypts an encrypted text string and returns it in plain DecryptString, page text. 384

EncryptString Encrypts a text string. EncryptString, page 394

EndsWithSubStr Returns True or False to indicate if a string ends with a EndsWithSubStr, substring. page 394

FindSubStr Returns the index of the first occurrence of a substring in a FindSubStr, page 417 string.

Format Returns a formatted string using values from an array. Format, page 420

Left Returns a number of characters from the beginning of a Left, page 472 string.

Length Returns the number of characters in a string. Length, page 473

Lower Converts characters in a string to lowercase and returns Lower, page 477 the string.

MakeRegExpression Returns a regular expression built from a string. MakeRegExpression, page 477

MakeURL Returns a full URL constructed by combining a root URL MakeURL, page 478 and a component.

Mid Returns a number of characters starting with a position in Mid, page 479 a string.

ParseString Returns an array of substrings from an original delimited ParseString, page string. 506

Replace Replaces text in a string and returns the resulting string. Replace, page 519

Right Returns a number of characters from the end of a string. Right, page 521

StartsWithSubStr Returns True or False to indicate if a string starts with a StartsWithSubStr, substring. page 555

Str Converts a value and returns it as a string. Str, page 557

347 System statements

Statement Description More information

StrCompare Returns an integer to indicate if two strings match or the StrCompare, page string sorted first based on alphabetical order comparison. 557

StrEquals Returns True or False to indicate if two strings match. StrEquals, page 558

Trim Returns a string with the leading and trailing spaces Trim, page 564 removed.

Upper Converts characters to uppercase and returns the string. Upper, page 566

System statements System statements return values from the test computer operating system or browsers.

Statement Description More information

ComputerName Returns the name of the computer running the ComputerName, page 372 script.

GetBrowserVersion Returns the browser version running the script. GetBrowserVersion, page 423

GetEnv Returns the value of an environment variable GetEnv, page 431 from Windows or QA Wizard Pro.

GetMouseXCoordinate Returns the X coordinate of the mouse pointer GetMouseXCoordinate, relative to the screen or a window or control. page 435

GetMouseYCoordinate Returns the Y coordinate of the mouse pointer GetMouseYCoordinate, relative to the screen or a window or control. page 435

GetScreenHeight Returns the test computer's screen height. GetScreenHeight, page 441

GetScreenWidth Returns the test computer's screen width. GetScreenWidth, page 441

GetWindowsVersion Returns the concatenated string representation GetWindowsVersion, page of the Windows version and installed service 446 pack.

Is64BitWindows Returns True or False to indicate if the Is64BitWindows, page 457 Windows version is 64-bit.

ReadRegistryEntry Returns the value associated with a name in a ReadRegistryEntry, page registry key. 512

RunBackgroundCommand Runs a command from the Windows command RunBackgroundCommand, prompt on the test computer as playback page 524 continues.

348 Timing statements

Statement Description More information

RunCommand Runs a command from the Windows command RunCommand, page 525 prompt on the test computer and returns the exit code when it finishes.

UserName Returns the username of the current user UserName, page 567 logged in to Windows on the computer running the script.

WriteRegistryEntry Sets a registry key value on the test computer. WriteRegistryEntry, page 592

Timing statements Timing statements control the stopwatch and return elapsed time values.

Statement Description More information

Delay Pauses script playback for a Delay, page 385 number of milliseconds before continuing.

GetStopwatchElapsedMilliseconds Returns the elapsed GetStopwatchElapsedMilliseconds, stopwatch time in page 443 milliseconds.

GetStopwatchElapsedTime Returns the elapsed GetStopwatchElapsedTime, page stopwatch time in 443 HH:MM:SS:mm format.

ResetStopwatch Resets the elapsed ResetStopwatch, page 520 stopwatch time to zero.

StartStopwatch Starts or restarts the StartStopwatch, page 555 stopwatch to measure elapsed time.

StopStopwatch Stops the stopwatch without StopStopwatch, page 556 resetting it.

Touch action statements Touch action statements perform tap, swipe, and pinch zoom actions in scripts that test Windows 8 applications or any applications that can interpret touch actions.

Statement Description More information

TouchDown Performs a touch action in a location. TouchDown, page 562

349 Web statements

Statement Description More information

TouchMove Moves a touch action to a location. TouchMove, page 563

TouchUp Removes a touch action in a location. TouchUp, page 564

Web statements Web statements perform actions on and return values from HTML elements.

Statement Description More information

ExtractHTML Captures HTML in a web page and saves it ExtractHTML, page 407 to a text file.

ExtractHTMLToString Returns HTML from a browser window as ExtractHTMLToString, page a string. 407

FindColumnByRowIndex Returns a column index for a table cell FindColumnByRowIndex, located using the row index and page 415 property/expected value pairs.

FindRowByColumnIndex Returns a row index for a table cell located FindRowByColumnIndex, using the column index and page 416 property/expected value pairs.

GetControlFromTable Returns a control from an HTML table. Not GetControlFromTable, page available in the Add Statement dialog box. 424

GetControlFromXPathQuery Returns the first HTML element that GetControlFromXPathQuery, matches an XPath query. page 425

HTMLFindByID Returns a string that contains the inner text HTMLFindByID, page 450 of the tag with an HTML element ID.

HTMLFindByTag Returns an array of strings that contain the HTMLFindByTag, page 451 inner text from an HTML element tag.

PerformXPathQuery Returns an array of results that match an PerformXPathQuery, page XPath query. 506

Web browser action statements Web browser statements perform actions on browser windows.

Statement Description More information

Back Navigates back to the previous page in a browser. Back, page 358

CloseTab Closes the active tab or a specified tab in a browser. CloseTab, page 368

350 Window action statements

Statement Description More information

Forward Navigates forward one page in a browser. Forward, page 422

Home Navigates to the home page in a browser. Home, page 449

Navigate Navigates to a URL in a browser. Navigate, page 489

NewTab Opens a new tab in a browser. NewTab, page 490

Refresh Refreshes the current page in a browser. Refresh, page 515

SelectTab Selects a tab in a browser. SelectTab, page 538

Stop Stops loading the current page in a browser. Stop, page 556

Window action statements Window action statements perform actions on application windows.

Statement Description More information

Close Closes a window. Close, page 368

Drag Drags a window to a location based on X and Y coordinates relative to the Drag, page 391 parent window.

Help Displays help for a window. Help, page 448

Maximize Maximizes a window. Maximize, page 479

Minimize Minimizes a window to a button on the Windows taskbar. Minimize, page 481

Resize Resizes a window. Resize, page 520

Restore Restores a window to its default size and location. Restore, page 520

# (Outline Block)

Note: This statement is named Outline Block in the Add Statement dialog box.

Organizes script lines in collapsible groups. Outline blocks help make longer scripts easier to read and can be expanded or collapsed in Text View and Keyword View. When collapsed, only the first line is displayed. Optionally include a comment in the first line of the block to summarize the grouped steps. See Cleaning up scripts, page 150.

351 Abs

Syntax # 'comment Script steps #

Example # ' Low-level actions for Window("WysiCorp CRM") control. BoundaryChecks(False) Window("WysiCorp CRM").LMouseDoubleClick(351, 14, 47) BoundaryChecks(True) #

Abs

Note: This statement is named Absolute Value in the Add Statement dialog box.

Returns the absolute value of a number.

Syntax Abs(Number)

Arguments

Argument Description

Number Number to return the absolute value for.

Return value

Value Description

Value Absolute value of the number.

0 Specified number is an uninitialized variable.

Example number = Abs(-42.5) PrintLn number

AddFileAttachment Attaches a file to a Helix ALM issue.

Note: This statement cannot be used in load test scripts.

352 AddIssue

Syntax AddFileAttachment(Issue, "FilePath")

Arguments

Argument Description

Issue Issue object to attach the file to. Use the NewIssue, page 490 statement to create the issue object.

FilePath Full path to the file to attach.

Example issue = NewIssue() ' Attaches the output.xml file to the issue AddFileAttachment(issue, "C:\\OutputDir\\output.xml")

You can also call this statement directly on a Helix ALM issue object. issue = NewIssue() issue.AddFileAttachment("C:\\OutputDir\\output.xml")

AddIssue

Note: This statement was previously named AddDefect.

Adds an issue to the Helix ALM project configured for the workspace. Specified text is added to the issue Summary, Description, Steps to Reproduce, and Other Hardware and Software fields. This statement is commonly used with an If statement to add issues to Helix ALM if a condition that causes the script to fail is not met. Use the INDEBUGMODE variable if you are running scripts in debug mode and do not want to add issues to Helix ALM. See Using the INDEBUGMODE variable, page 213. This statement cannot be used in load test scripts.

Tip: You can use other Helix ALM statements to create more detailed issues and work with specific issue field values. See AddFileAttachment, page 352, AddToHelixALM, page 354, GetFieldValue, page 431, RemoveField, page 517, and SetFieldValue, page 542.

Syntax AddIssue("Summary", "Description", "StepsToReproduce", "OtherHardwareAndSoftware")

353 AddToHelixALM

Arguments

Argument Description

Summary Information to add to the issue Summary field.

Description Information to add to the issue Description field.

StepsToReproduce Information to add to the issue Steps To Reproduce field.

OtherHardwareAndSoftware Information to add to the issue Other Hardware and Software field.

Example numProducts = Window("BugReporter").ComboBox("comboboxProduct").Property("Number of Items") If numProducts <> 7 Then AddIssue("Incorrect number of products", "Expected: 7 Actual: " + numProducts + " (reported by script '" + ScriptName()+ "')", "See test case", "Windows 7") End If

AddToHelixALM

Note: This statement was previously named AddToTestTrack.

Adds an issue created by the NewIssue, page 490 statement to the Helix ALM project configured for the workspace after all field values to include are set. You can also use the AddIssue, page 353 statement to create a new issue that includes only the Summary, Description, Steps to Reproduce, and Other Hardware and Software fields and add it to the Helix ALM project at the same time.

Note: This statement cannot be used in load test scripts.

Syntax AddToHelixALM(Issue)

Arguments

Argument Description

Issue Issue object to add to the Helix ALM project. Use the NewIssue, page 490 statement to create the issue object.

Example issue = NewIssue() ' Adds the issue to Helix ALM AddToHelixALM(issue)

354 Alert

You can also call this statement directly on a Helix ALM issue object. issue = NewIssue() issue.AddToHelixALM()

Alert Displays a message in an alert dialog box. The tester must click the OK button to close the dialog box and continue running the script.

Note: Do not use this statement in scripts that run unattended because manual intervention is required.

Syntax Alert("Message")

Arguments

Argument Description

Message Message to display.

Example Alert("The Go button is disabled.")

AppendToFile Appends text to a file. Creates the file if it does not exist. For example, use this statement to capture data in a file during playback and import the data into another application to use it for other purposes.

Note: Issues may occur when using this statement in load test scripts.

Syntax AppendToFile("FilePath", "Text", Encoding)

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Text Text to append to the file.

Encoding File encoding constant. If not specified, EncodingAutoDetect is used. See Constants, page 600.

355 ArrayClear

Example AppendToFile("C:\\Testing\\Output.txt", "Value added to Product table", EncodingAutoDetect)

ArrayClear Clears an array.

Syntax ArrayClear(Array)

Arguments

Argument Description

Array Array name.

Example ArrayClear(listValues)

ArraySize Returns the size of an array in a dimension (1, 2, or 3).

Syntax ArraySize(Array, Dimension)

Arguments

Argument Description

Array Array name.

Dimension Array dimension. Valid values are 1, 2, or 3.

Return value

Value Description

Value Size of the array.

Example itemList = Window("BugReporter").ComboBox("comboboxType").Property("ListItems") count = ArraySize(itemList, 1) For x = 1 To count curItemText = itemList(x)

356 ArrayToJSONArray

Window("BugReporter").ComboBox("comboboxType").Item(curItemText).Select() Next

ArrayToJSONArray Converts an array to a JSONArray and returns it.

Syntax ArrayToJSONArray(Array)

Arguments

Argument Description

Array Array to convert. Must use only a single dimension array. Can only contain numbers, Booleans, strings, JSONArrays, JSONObjects, and null.

Return value

Value Description

Value Converted JSONArray.

Example dim arrayVal(3) arrayVal(1) = 1 arrayVal(2) = 2 arrayVal(3) = "three" ' Returns a JSONArray with 1, 2, "three" in it jsonArray = ArrayToJSONArray(arrayVal) strVal = jsonArray.ToString() PrintLn("Should be \"[1, 2, \\\"three\\\"]\": " & strVal)

ASCII Returns the ASCII value of a character.

Syntax Ascii("Character")

Arguments

Argument Description

Character Character to return the ASCII value for.

357 Assignment

Return value

Value Description

Value ASCII value of the character.

Example asciiValue = Ascii("*") PrintLn asciiValue

Assignment Declares a variable and a value that can be used later. Variables store a value that can be used throughout a script. Using variables can help you create more flexible scripts because the data can change as the application changes. See Declaring variables in Text View, page 29 for information.

Syntax Variable = Value

Arguments

Argument Description

Variable Variable name.

Value Numeric or string literal, expression, function, variable, or datasheet value.

Example loginName = ("Administrator") Window("WysiCRM").EditBox("textBoxUser").SetText(loginName)

Back Navigates back to the previous page in a browser.

Syntax Back()

Supported objects Browser

Example Browser("WysiCorp Report a Bug").Back()

358 Beep

Beep Plays a beep sound.

Syntax Beep(Frequency, Duration)

Arguments

Argument Description

Frequency Beep tone frequency in hertz.

Duration Length of beep in milliseconds.

Example Beep(100, 5000)

Boolean Returns the Boolean representation of a value. The following values are valid.

Value Notes

Number 0 is False. All other values are True.

String Matches "True" or "False". Strings are not case sensitive. White space is trimmed. If "True" or "False" is not matched, QA Wizard Pro tries to convert the value to a number.

Object Converts to strings before evaluated.

Null Converts to 0 and returns False.

Syntax Boolean(Value)

Arguments

Argument Description

Value Value to represent as a Boolean.

359 BoundaryChecks

Return value

Value Description

True Value matches True for the data type.

False Value matches False for the data type.

Example ' Returns True boolVal = Boolean(1) PrintLn("Should be True: " & boolVal) ' Returns True boolVal = Boolean("TRUE") PrintLn("Should be True: " & boolVal) ' Returns False boolVal = Boolean(0) PrintLn("Should be False: " & boolVal) ' Returns False boolVal = Boolean("false") PrintLn("Should be False: " & boolVal)

BoundaryChecks Activates or inactivates boundary checking for mouse coordinates. Boundary checking prevents using coordinates outside a control's boundary. If boundary checking is on, mouse actions that attempt to go outside the control's boundary cause the script to fail.

Syntax BoundaryChecks(True/False)

Arguments

Argument Description

True/False True activates boundary checking and False deactivates it.

Example BoundaryChecks(False)

CaptureScreenshot Captures a screenshot after a statement runs and saves it as a PNG file.

360 Case

Note: Scripts fail if you do not create the directory to save screenshots in before they are saved during playback.

Syntax CaptureScreenshot(True/False, "FilePath")

Arguments

Argument Description

True/False True captures the entire screen. False captures the active window.

FilePath Full path to the file to save the screenshot as. If only the filename is specified, the screenshot is saved in the \Screenshots directory by default. If this argument is not used, the screenshot is saved in the workspace directory as .png.

Example CaptureScreenshot(False, "C:\\Testing\\Failures\\LoginWindow.png")

Case Contains a value that is compared to the resulting value of an expression in a Select...Case, page 536 statement. If the values match, statements in the Case block run.

Note: Case statements cannot have multiple delimited values. Only define one value per Case statement.

Syntax Select Case TestExpression [Case Expression [Statements-n]]... [Case Else Expression [ElseStatements-n]] End Select

Arguments

Argument Description

Expression Numeric or string expression. For example, a > b, a < b, a = b, or a <> b.

Example SRand() random = Rand(1, 3) Select Case random

361 Cell

Case 1 PrintLn("1 is the random number") Case 2 PrintLn("The random number is 2") Case 3 PrintLn("The number 3 was randomly generated") Case 4 PrintLn("Random value = 4") Case Else PrintLn("The number 5 was chosen") End Select

Cell Returns the value from a column in the current row of the script data source.

Note: You cannot reference row numbers in this statement. For general purpose database access, use the OpenRecordset, page 504 statement.

Cell("ColumnName")

Arguments

Argument Description

ColumnName Column to retrieve the value from.

Return value

Value Description

Value Data value from the cell in the column.

Example component = Cell("component") Window("BugReporter").Editbox("editboxComponent").SetText(component)

CheckExists Verifies a window or control exists in the application. If the window or control is not found, the script fails or continues and displays a message in the Errors pane.

Syntax CheckExists(FailureBehavior, "Warning")

362 Checkpoint

Arguments

Argument Description

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("BugReporter").Label("labelProduct").CheckExists(True, "Product label not displayed")

Checkpoint Verifies the value of a window or control property matches an expected value. If the values do not match, the script fails or continues and displays a message in the Errors pane. Checkpoints can validate both visual and non-visual properties. For example, you can check that a window includes specific title bar buttons. See Using Checkpoints, page 165.

Note: Use the OCRCheckpoint, page 491 statement to verify graphical text against an expected value.

Syntax Checkpoint("PropertyName", ExpectedValue, FailureBehavior, "Warning")

Arguments

Argument Description

PropertyName Name of the property to check. You can view a list of all properties captured for the window or control when it was added to the application repository in the Properties dialog box. See Modifying window and control properties, page 122.

ExpectedValue Value to check.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

363 CheckpointExpression

Keyword View notes The property and value to check is displayed as ("Property" = "Value") in the Information column.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("WysiCorp Login").Button("buttonLogin").Checkpoint("Text", "Login", True, "Button text is incorrect")

CheckpointExpression Verifies if the value returned by an expression is True. Use to verify expressions that return True/False or numeric values.

Syntax CheckpointExpression(Expression, FailureBehavior, "Warning")

Arguments

Argument Description

Expression Expression to check.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

Example CheckpointExpression(FileSize("Output.txt") > 1000, False, "File is too big")

CheckpointImage Verifies an image in an application matches an expected image. This statement compares the screenshot captured for the action performed in the previous statement with an expected image. If it does not match the expected image to a specified accuracy percentage, the script fails or continues and displays a message in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails. See Creating image checkpoints, page 173.

364 CheckpointStringExists

Syntax CheckpointImage(MinimumAccuracy, "ExpectedImagePath", Left, Top, Width, Height, FailureBehavior, "Warning")

Arguments

Argument Description

MinimumAccuracy Minimum percentage of accuracy required to pass the checkpoint.

ExpectedImagePath Path to the expected image (e.g., C:\\Images\\myimage.png).

Left Integer pixel value of the left side of the rectangle that contains area to verify.

Top Integer pixel value of the top side of the rectangle that contains area to verify.

Width Integer pixel value of the width of the rectangle that contains area to verify.

Height Integer pixel value of the height of the rectangle that contains area to verify.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

Example CheckpointImage(90, "C:\\Testing\\Images\\logo.png", 2, 0, 318, 205, False, "Image is incorrect")

CheckpointStringExists Verifies that a substring exists in a text string. If the substring is not found, the script fails and displays a message in the Errors pane. This statement can be used to verify data returned from the WebGet, page 574 and WebPost, page 581 statements in load test scripts.

Syntax CheckpointStringExists("TextToSearch", "TextToSearchFor")

Arguments

Argument Description

TextToSearch String to search in.

TextToSearchFor Substring to search for in the TextToSearch string. The search is case sensitive.

365 CheckpointStringNotExists

Example result = WebGet("/loginpage.php", "user", "Guest") CheckpointStringExists(result, "success")

CheckpointStringNotExists Verifies that a substring does not exist in a text string. If the substring is found, the script fails and displays a message in the Errors pane. This statement can be used to verify data returned from the WebGet, page 574 and WebPost, page 581 statements in load test scripts.

Syntax CheckpointStringNotExists("TextToSearch", "TextToSearchFor")

Arguments

Argument Description

TextToSearch String to search in.

TextToSearchFor Substring to search for in the TextToSearch string. The search is case sensitive.

Example result = WebGet("/loginpage.php", "user", "Guest") CheckpointStringNotExists(result, "Server error")

Chr

Note: This statement is named Character in the Add Statement dialog box.

Returns the character representation of a Unicode value.

Syntax Chr(UnicodeValue)

Arguments

Argument Description

UnicodeValue Unicode value to convert.

Return value

Value Description

Value Converted Unicode character.

366 Clear

Example char = Chr(37) PrintLn char

Clear

Note: This statement is named Clear Check Box in the Add Statement dialog box.

Clears a check box control.

Syntax Clear()

Supported objects CheckBox

Example Window("AutoComplete Passwords").CheckBox("checkboxRemember").Clear()

ClearOutput Clears any messages displayed in the Output pane.

Syntax ClearOutput()

Example Alert("Start the server") PrintLn("Server is started") Delay(10000) ClearOutput()

Click Clicks a control or the mouse at the pointer's current location.

Syntax Click()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

367 Close

Example 'Clicks a button Window("Feedback Acknowledgment").Button("buttonSend").Click() 'Clicks the mouse at the pointer's location after moving it MouseMoveFromCurrentPosition(25, 15) Click()

Close Closes a window. Performs the same action as clicking the Close button in the application title bar.

Syntax Close()

Supported objects Browser, Window

Example Window("AddItem").Close()

CloseTab Closes the active tab or a specified tab in a browser.

Syntax CloseTab("TabText")

Arguments

Argument Description

TabText Tab name. If not specified, the tab last used during playback is closed.

Supported objects Browser

Example Browser("Report a Bug").CloseTab("Bug Report")

Collapse Collapses an expanded node, or item, in a tree control.

368 CombinePaths

Note: This statement is not added to recorded scripts. You can use this statement in scripts, but it is generally not needed.

Syntax Collapse("Item")

Arguments

Argument Description

Item Node to collapse.

Keyword View notes The node to collapse is displayed in the Information column.

Supported objects Tree

Example Window("WysiCorp CRM").Tree("treeViewProducts").Collapse("ALM Solutions/Solution Design")

CombinePaths Combines two directory paths into one and returns the combined path. Adds a backslash between the base and relative directories.

Syntax CombinePaths("BaseDirectory", "RelativePath")

Arguments

Argument Description

BaseDirectory Base directory path.

RelativePath Relative directory to combine with the base directory path.

Return value

Value Description

Value Combined directory path. If one path is a zero-length string, the other path is returned. If the second path argument is an absolute path, the absolute path is returned.

Example FullPath = CombinePaths("C:\\Testing", "TestData")

369 CommitRecordsetRow

CommitRecordsetRow Adds a data row to the current recordset. The recordset must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505. To change one field in a recordset, use the SetRowValue, page 547 statement.

Note: To add or update a row in a Microsoft Access, Oracle, or SQL Server datasheet, a primary key must be defined. To add or update a row in a Microsoft Excel datasheet, Excel must be installed on the computer running the script. If a primary key is not defined or Excel is not installed, QA Wizard Pro opens the recordset as read-only.

Syntax CommitRecordsetRow(DataRow)

Arguments

Argument Description

DataRow New row to add to the recordset or datasheet.

Example bugs = OpenRecordset("WysiCorp Bugs") row = CreateRecordsetRow(bugs) SetRowValue(row, "Summary", "Performance is slow") SetRowValue(row, "Severity", "No Workaround") CommitRecordsetRow(row)

CompareFileContents Returns True or False to indicate if two files are identical.

Syntax CompareFileContents("FirstFile", "SecondFile")

Arguments

Argument Description

FirstFile Full path to the first file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

SecondFile Full path to the second file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

370 CompareImage

Return value

Value Description

True File contents are identical.

False File contents are different.

Example If (CompareFileContents("C:\\Testing\\Output.txt", "C:\\TestDocuments\\DataSource\\Output.txt") = True) Then PrintLn("The files are identical.") Else PrintLn("The files are different.") End If

CompareImage Returns True or False to indicate if an application image captured during playback matches an expected image within an accuracy percentage.

Syntax CompareImage(MinimumAccuracy, "ExpectedImagePath", Left, Top, Width, Height)

Arguments

Argument Description

MinimumAccuracy Minimum percentage of accuracy required to return True.

ExpectedImagePath Path to the expected image used to compare with the application during playback (e.g., C:\\Images\\myimage.png).

Left Integer pixel value of the left side of the rectangle that contains area to verify.

Top Integer pixel value of the top side of the rectangle that contains area to verify.

Width Integer pixel value of the width of the rectangle that contains area to verify.

Height Integer pixel value of the height of the rectangle that contains area to verify.

Return value

Value Description

True Contents of image area match within the accuracy percentage.

False Contents of image area do not match within the accuracy percentage.

371 ComputerName

Example imageResult = CompareImage(100, "C:\\Testing\\Images\\logo.png", 0, 0, 797, 578)

ComputerName Returns the name of the computer running the script.

Syntax ComputerName()

Return value

Value Description

Value Computer name.

Example PrintLn ComputerName

ContainsSubStr

Note: This statement is named Contains Substring in the Add Statement dialog box.

Returns True or False to indicate if a string contains a substring.

Syntax ContainsSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

IsCaseSensitive Case sensitive search. True matches the substring case. False ignores the case. If not specified, True is used.

Return value

Value Description

True String contains the substring.

False String does not contain the substring.

372 CopyFile

Example productName = Window("Bug Reporter").HTMLElement("elementProductName").Property("Inner Text") CheckpointExpression(ContainsSubStr(productName, "Report", True), True, "Product name does not contain Report")

CopyFile Copies a file to a new location.

Syntax CopyFile("SourcePath", "DestinationPath", Overwrite)

Arguments

Argument Description

SourcePath Full path to the file to copy. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

DestinationPath Full path to the directory to copy the file to. If the destination path includes a different filename than the source, the file is copied and renamed in the new location. If the filename is not included, the source filename is used. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Overwrite Overwrite behavior. True overwrites existing files in the destination directory. False does not overwrite files. If is not specified, False is used.

Example CopyFile("C:\\Testing\\Output.txt", "C:\\TestDocuments\\DataSource\\", False)

Cos

Note: This statement is named Cosine in the Add Statement dialog box.

Returns the cosine of a number.

Syntax Cos(Number)

Arguments

Argument Description

Number Number to return the cosine for. To convert degrees to radians, multiply by pi/180. To convert radians to degrees, multiply by 180/pi.

373 CreateDirectory

Return value

Value Description

Value Cosine of the number.

Example cosine = Cos(345) PrintLn cosine

CreateDirectory Creates a directory and subdirectories in a path.

Syntax CreateDirectory("DirectoryPath")

Arguments

Argument Description

DirectoryPath Full path to the directory to create. All directories in the specified path are created if they do not exist. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Example CreateDirectory("C:\\Testing\\WysiCorp\\Tests\\Output")

CreateGUID Creates and returns a globally unique identifier (GUID) string.

Syntax CreateGUID()

Return value

Value Description

Value GUID string.

Example Try Script.CallScript("ComplicatedScript") Catch

374 CreateObject

fileName = CreateGUID() + ".log" AppendToFile(fileName, Err.Description, EncodingAutoDetect) PrintLn("Created log file: " + fileName) End Try

CreateObject Creates and returns a COM object instance.

Syntax CreateObject("COM ProgID", "ServerName")

Arguments

Argument Description

COM ProgID COM ProgID to create an instance for.

ServerName DCOM server to create the instance from. If not specified, the test computer is used.

Return value

Value Description

Value COM object.

Example app = CreateObject("Excel.Application") PrintLn app.Version

CreateRecordsetRow Returns a new data row that can be populated and added to a recordset.

Note: A primary key must be defined in the table if you want to add or update rows. If a primary key is not defined, QA Wizard Pro opens the table as read-only.

Syntax CreateRecordsetRow(Recordset)

Arguments

Argument Description

Recordset Recordset name to add the row to. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

375 CreateTempFile

Return value

Value Description

Value Empty data row.

Example bugs = OpenRecordset("WysiCorp Bugs") row = CreateRecordsetRow(bugs) SetRowValue(row, "Summary", "Performance is slow") SetRowValue(row, "Severity", "No Workaround") CommitRecordsetRow(row)

CreateTempFile Creates an empty temporary file and returns the full path. The file is stored in the temp folder on the test computer hard drive and is not automatically deleted.

Syntax CreateTempFile()

Return value

Value Description

Value Full path to the empty temporary file.

Example tempFile = CreateTempFile() Try ' Update the session ID before posting the file contents contents = ReadTextFile("LoginTest_1.postdata", EncodingAutoDetect) jsonObject = JSONParse(contents) jsonObject = JSONObjectSetValue(jsonObject, "sessionID", sessionID) AppendToFile(tempFile, jsonObject, EncodingAutoDetect) WebPostFromFile("http://www.wysicorp.com/login.php", "application/json", tempFile) Finally DeleteFile(tempFile) End Try

Date Returns the date in MM/DD/YYYY format based on integers that represent the year, month, and day.

376 DateAdd

Syntax Date(Year, Month, Day)

Arguments

Argument Description

Year Year integer.

Month Month integer.

Day Day integer.

Return value

Value Description

Value Date in MM/DD/YYYY format.

Example dateCreated = Date(2016, 5, 14) Window("BugReporter").Editbox("editboxCreatedDate").SetText(dateCreated)

DateAdd Adds a time to a date/time value and returns the resulting value in the short date and time format used on the test computer. Formatting depends on the operating system's regional settings.

Syntax DateAdd("IntervalType", Amount, "DateTimeString")

Arguments

Argument Description

IntervalType Time interval type.

Amount Amount of the specified time interval to add.

DateTimeString Any date/time expression. See Date/time format examples, page 605 for valid formats.

Interval types

String Interval type

d Day

377 DateDiff

String Interval type

y Day of year

h Hour

n Minute

m Month

q Quarter

s Second

w Weekday

ww Week of year (seven days)

yyyy Year

Return value

Value Description

Value Date/time value with the amount of time added.

Example NewDate = DateAdd("m", 1, "3-July-2016")

DateDiff Returns the difference between two date/time values based on an interval type.

Syntax DateDiff("IntervalType", "FromDateTime", "ToDateTime")

Arguments

Argument Description

IntervalType Time interval type.

FromDateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

ToDateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

378 DatePart

Interval types

String Interval

d Day

y Day of year

h Hour

n Minute

m Month

q Quarter

s Second

w Weekday

ww Week of year

yyyy Year

QA Wizard Pro counts interval types using the following methods: n y is the same as d (days). n w is the difference in days divided by seven, excluding fractions. n ww counts the number of weeks starting with Sunday. The from date is not counted and the to date is only counted if it is a Sunday. n q counts the number of quarter starts. For example, January 1, April 1, July 1, and October 1. n Parts of years, quarters, and months more specific than the interval type are excluded before the calculation is performed. For example, the difference between December 31, 2015 11:59:59 PM and January 1, 2016 12:00:00 AM measured in years, quarters, or months all return 1, even though the actual elapsed time is one second.

Return value

Value Description

Value Difference between two date/time values based on the interval.

Example numDays = DateDiff("d", "3 Feb 1962", Now())

DatePart Returns a part from a date/time value as an integer.

379 DateTime

Syntax DatePart("IntervalType", "DateTimeString")

Arguments

Argument Description

IntervalType Time interval type.

DateTimeString Any date/time expression. See Date/time format examples, page 605 for valid formats.

Interval types

String Interval type Returns:

d Day Day of month (1-31)

y Day of year Day of year (1-366)

h Hour Hour (0-23)

n Minute Minute (0-59)

m Month Month (1-12)

q Quarter Calendar quarter (1-4)

s Second Second (0-59)

w Weekday Day of week (1-7)

ww Week of year Week of year (1-53)

yyyy Year Year

Return value

Value Description

Value Integer that corresponds with the part of the date/time value.

Example DayOfYear = DatePart("y", Now())

DateTime Returns the date and time in MM/DD/YYYY hh:mm:ss format based on integers that represent the year, month, day, hour, minute, and second.

380 DateTimeFormat

Syntax DateTime(Year, Month, Day, Hour, Minute, Second)

Arguments

Argument Description

Year Year integer.

Month Month integer.

Day Day integer.

Hour Hour integer.

Minute Minute integer.

Second Second integer.

Return value

Value Description

Value Date and time in MM/DD/YYYY hh:mm:ss format.

Example dateCreated = DateTime(2016, 5, 14, 2, 30, 00) Window("BugReporter").Editbox("editboxCreatedDate").SetText(dateCreated)

DateTimeFormat Returns the date or time in a specified format.

Syntax DateTimeFormat("Format", "Date/Time")

Arguments

Argument Description

Format Format to use.

Date/Time Date or time string to format.

Date and time formatting characters Formatting depends on the system's regional settings.

381 DateTimeFormat

Specifier Type Format Example output

d Short date {0:d} 10/12/2016

D Long date {0:D} December 10, 2016

t Short time {0:t} 10:11 PM

T Long time {0:T} 10:11:29 PM

f Full date & time {0:f} December 10, 2016 10:11 PM

F Full date & time (long) {0:F} December 10, 2016 10:11:29 PM

g Default date & time {0:g} 10/12/2016 10:11 PM

G Default date & time (long) {0:G} 10/12/2016 10:11:29 PM

M Month day pattern {0:M} December 10

r RFC1123 date string {0:r} Tue, 10 Dec 2016 22:11:29 GMT

s Sortable date string {0:s} 2016-12-10T22:11:29

u Universal sortable, local time {0:u} 2016-12-10 22:13:50Z

Y Year month pattern {0:Y} December, 2016

Custom date and time formatting characters

Specifier Type Format Example output

dd Day {0:dd} 10

ddd Day name {0:ddd} Tue

dddd Full day name {0:dddd} Tuesday

f, ff, … Second fractions {0:fff} 932

gg, … Era {0:gg} A.D.

hh 2 digit hour {0:hh} 10

HH 2 digit hour, 24hr format {0:HH} 22

mm Minute 00-59 {0:mm} 38

MM Month 01-12 {0:MM} 12

MMM Month abbreviation {0:MMM} Dec

MMMM Full month name {0:MMMM} December

382 Day

Specifier Type Format Example output

ss Seconds 00-59 {0:ss} 46

tt AM or PM {0:tt} PM

yy Year, 2 digits {0:yy} 16

yyyy Year {0:yyyy} 2016

zz Time zone offset, 2 digits {0:zz} -05

zzz Full time zone offset {0:zzz} -05:00

: Separator {0:hh:mm:ss} 10:43:20

/ Separator {0:dd/MM/yyyy} 10/12/2016

Return value

Value Description

Value Date/time in the specified format.

Example Dim arrayValues(1) arrayValues(1) = Now() var = DateTimeFormat("{0:h:mm:ss tt}", arrayValues(1)) PrintLn(var)

Day Returns the day from a date/time value.

Syntax Day("DateTime")

Arguments

Argument Description

DateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Day from the date/time value.

383 DecimalSeparator

Example dayMonth = Day("October 25, 2016") PrintLn("Day of the month is: " + dayMonth)

DecimalSeparator Returns the decimal separator based on regional settings. The separator is the symbol that marks the boundary between the integer and fraction parts of a decimal number.

Syntax DecimalSeparator()

Return value

Value Description

Value Decimal separator.

Example retValue = DecimalSeparator() PrintLn retValue

DecryptString Decrypts an encrypted text string and returns it in plain text. Passwords are automatically encrypted during recording, but some text may have been manually encrypted using the Text Encryption dialog box or the EncryptString statement to make it unreadable. See Encrypting text, page 162.

Note: Literal encrypted text strings are automatically decrypted when scripts run.

Syntax DecryptString("EncryptedString")

Arguments

Argument Description

EncryptedString Text string to decrypt.

Return value

Value Description

Value Decrypted string in plain text.

384 Delay

Example passwords = OpenRecordset("Passwords") encryptedPassword = GetRowValue(passwords, "Password") Window("Login").EditBox("editboxPassword").SetText(DecryptString(encryptedPassword))

Delay Pauses script playback for a number of milliseconds before continuing. For example, you can use this statement if you are testing a client/server application that requires the server to be running before the client and the server takes a few seconds to start.

Syntax Delay(Time)

Arguments

Argument Description

Time Number of milliseconds to pause playback before it continues.

Example Delay(5000)

DeleteDirectory Deletes a directory.

Syntax DeleteDirectory("DirectoryPath", Recursive)

Arguments

Argument Description

DirectoryPath Full path to the directory to delete. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Recursive Recursive deletion. True deletes all subdirectories and files. False deletes only the specified directory, which must be empty. If not specified, False is used.

Example DeleteDirectory("C:\\Testing\\TestData", True)

385 DeleteFile

DeleteFile Deletes a file. For example, use this statement at the beginning of a script to delete a file created the last time the script ran so it can be created again during playback. The script continues running even if QA Wizard Pro cannot locate the file to delete.

Note: Issues may occur when using this statement in load test scripts.

Syntax DeleteFile("FilePath")

Arguments

Argument Description

FilePath Full path to the file to delete. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Example DeleteFile("C:\\Testing\\results.txt")

DeleteRecordsetRow Deletes the current row from a recordset. When a row is deleted, the rows after it move up to fill the empty index. If the last row is deleted, the active row is at RecordsetEOF.

Note: To delete a row from a Microsoft Access, Oracle, or SQL Server datasheet, a primary key must be defined. To delete a row from a Microsoft Excel datasheet, Excel must be installed on the computer running the script. If a primary key is not defined or Excel is not installed, QA Wizard Pro opens the recordset as read-only.

Syntax DeleteRecordsetRow(Recordset)

Arguments

Argument Description

Recordset Recordset name to delete the row from. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Example bugs = OpenRecordset("WysiCorp Bugs") NextRow(bugs) DeleteRecordsetRow(bugs)

386 DirectoryExists

DirectoryExists Returns True or False to indicate if a directory exists.

Syntax DirectoryExists("DirectoryPath")

Arguments

Argument Description

DirectoryPath Full path to the directory to check for. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

True Directory exists.

False Directory does not exist.

Example If (DirectoryExists("C:\\Testing\\TestDocuments") = True) Then PrintLn("Directory exists") Else PrintLn("Directory does not exist") End If

DisableNetworking Disables all network adapters and returns the number of adapters successfully disabled. This statement affects all applications running on the host or remote computer. If an application that requires a network connection is running, close the application before running scripts that disable networking. Disabled network adapters are enabled when playback is complete or canceled, errors occur, or the EnableNetworking, page 393 statement is called.

Note: If a script disables networking, email notifications are still sent when network communication is restored. See Setting email notification options, page 44.

Syntax DisableNetworking()

387 Do...Loop Until

Return value

Value Description

Value Number of network adapters disabled.

Example DisableNetworking() Window("Setup Connection").Button("Test Connection").Click() Window("Error").Button("OK").Click()

Do...Loop Until Repeats a block of statements as long as a condition is False or until an Exit Do statement runs. During playback, the statements in the loop run once. At the end of the first iteration, the condition is evaluated. If the condition is False, statements in the loop repeat. If the condition is True, statements in the loop do not repeat and playback continues.

Tip: Use the Do...Loop While, page 389 statement to repeat a block of statements while a condition is True.

Syntax Do [Statements] [Exit Do] [Statements] Loop Until [Condition]

You can also use this syntax: Do Until [Condition] [Statements] [Exit Do] [Statements] Loop

Arguments

Argument Description

Condition Numeric or string expression to evaluate. Null conditions are treated as False.

Statements One or more statements that repeat while the condition is False.

388 Do...Loop While

Note: Use the Exit, page 403 statement to exit the loop and continue playback with the first statement outside of the loop.

Keyword View notes The condition to evaluate is displayed in the Information column.

Example productCount = Window("Feedback").ComboBox("comboboxProduct").Property("Number of Items") counter = 1 Do Window("Feedback").Editbox("editboxFirst").SetText("Joe") Window("Feedback").Editbox("editboxLast").SetText("User") Window("Feedback").ComboBox("comboboxProduct").Item(counter).Select() Window("Feedback").Button("buttonSend").Click() Browser().Navigate("http://www.wysicorp.com/wysicorp/reportbug.php") counter = counter + 1 Loop Until counter >= productCount Browser().Close()

Do...Loop While Repeats a block of statements as long as a condition is True or until an Exit Do statement runs. During playback, the statements in the loop run once. At the end of the first iteration, the condition is evaluated. If the condition is True, statements in the loop repeat. If the condition is False, statements in the loop do not repeat and playback continues.

Tip: Use the Do...Loop Until, page 388 statement to repeat a block of statements while a condition is False.

Syntax Do [Statements] [Exit Do] [Statements] Loop While [Condition]

You can also use this syntax: Do While [Condition] [Statements] [Exit Do] [Statements] Loop

389 DoubleClick

Arguments

Argument Description

Condition Numeric or string expression to evaluate. Null conditions are treated as False.

Statements One or more statements that repeat while the condition is True.

Note: Use the Exit, page 403 statement to exit the loop and continue playback with the first statement outside of the loop.

Keyword View notes The condition to evaluate is displayed in the Information column.

Example productCount = Window("Feedback").ComboBox("comboboxProduct").Property("Number of Items") counter = 1 Do Window("Feedback").Editbox("editboxFirst").SetText("Joe") Window("Feedback").Editbox("editboxLast").SetText("User") Window("Feedback").ComboBox("comboboxProduct").Item(counter).Select() Window("Feedback").Button("buttonSend").Click() Browser().Navigate("http://www.wysicorp.com/wysicorp/reportbug.php") counter = counter + 1 Loop While counter <= productCount Browser().Close()

DoubleClick Double-clicks a control or the mouse at the pointer's current location.

Syntax DoubleClick()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example 'Double-clicks a grid cell Window("WysiCorp CRM").Grid("accountsDataGridView").Cell(3, "Description").DoubleClick() 'Double-clicks the mouse at the pointer's location after moving it

390 Drag

MouseMoveFromCurrentPosition(50, 10) DoubleClick()

Drag Drags a window to a location based on X and Y coordinates relative to the parent window.

Syntax Drag(xCoordinate, yCoordinate)

Arguments

Argument Description

xCoordinate X coordinate for the horizontal pixel location to move the window to relative to the parent window.

yCoordinate Y coordinate for the vertical pixel location to move the window to relative to the parent window.

Supported objects Browser, Window

Example Window("WysiCorp CRM").Drag(20, 30)

DragTo Drags an HTML link or element to a location.

Syntax DragTo(xCoordinate, yCoordinate)

Arguments

Argument Description

xCoordinate X coordinate of the link or element relative to the top left corner of the window.

yCoordinate Y coordinate of the link or element relative to the top left corner of the window.

Supported objects HTMLElement, HTMLLink

Example Window("Feedback Acknowledgment").HTMLLink("linkCompany").DragTo(20, 30)

391 Else

Else Runs an alternate block of statements when an If, page 451 or ElseIf, page 392 statement condition is False. The statements in the If or ElseIf statement are skipped and the statements in the Else block run.

Syntax If condition Then [Statements] [Else [ElseStatements]] End If

Arguments

Argument Description

ElseStatements One or more statements to run when the If or ElseIf statement condition is False.

Example currentHour = Hour(Now()) Print("Time of day is ") If (6 <= currentHour) and (currentHour < 12) Then PrintLn("morning") ElseIf (12 <= currentHour) and (currentHour < 18) Then PrintLn("afternoon") ElseIf (18 <= currentHour) and (currentHour < 24) Then PrintLn("evening") Else PrintLn("night") End If

ElseIf A combination of If, page 451 and Else, page 392 statements. ElseIf behaves like an If statement in another If statement. When an If statement evaluates to False, the ElseIf statement can evaluate an alternate condition and run a different block of statements if the alternate condition is True. An If statement can include several ElseIf statements.

Tip: The Select...Case, page 536 statement is similar to the ElseIf statement and may be easier to use when evaluating a condition with several possible results.

Syntax If Condition Then

392 EnableNetworking

[Statements] [ElseIf Condition-n Then [ElseIfStatements]] End If

Arguments

Argument Description

Condition-n Numeric or string expression that evaluates to True or False. For example, a > b, a < b, a = b, or a <> b. Null conditions are treated as False.

ElseIfStatements One or more statements to run if the associated Condition-n is True.

Keyword View notes The condition to evaluate is displayed in the Information column.

Example currentHour = Hour(Now()) Print("Time of day is ") If (6 <= currentHour) and (currentHour < 12) Then PrintLn("morning") ElseIf (12 <= currentHour) and (currentHour < 18) Then PrintLn("afternoon") ElseIf (18 <= currentHour) and (currentHour < 24) Then PrintLn("evening") Else PrintLn("night") End If

EnableNetworking Enables all network adapters disabled by the DisableNetworking, page 387 statement and returns the number of adapters successfully enabled.

Syntax EnableNetworking()

Return value

Value Description

Value Number of network adapters enabled.

393 EncryptString

Example EnableNetworking() Window("Setup Connection").Button("Test Connection").Click() Window("Succeeded").Label("succeededLabel").CheckExists() Window("Succeeded").Button("OK").Click()

EncryptString Encrypts a text string. Use to conceal sensitive text entered in fields, such as passwords. To decrypt encrypted text, use the DecryptString statement.

Syntax EncryptString("String")

Arguments

Argument Description

String Text string to encrypt.

Example 'Encrypts a password and then saves it to a text file password = EncryptString(Browser("Login Screen").EditBox("Password").Property("Text")) AppendToFile("C:\\Testing\\TestData.txt", "Encrypted password: " + password)

EndsWithSubStr

Note: This statement is named Ends with Substring in the Add Statement dialog box.

Returns True or False to indicate if a string ends with a substring.

Syntax EndsWithSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

IsCaseSensitive Case sensitive search. True matches the substring case. False ignores the case. If not specified, True is used.

394 Err.CallStack

Return value

Value Description

True String ends with the substring.

False String does not end with the substring.

Example productName = Window("Bug Reporter").HTMLElement("elementProductName").Property("Inner Text") CheckpointExpression(EndsWithSubStr(productName, "Reporter", True), True, "Product name does not end with Reporter")

Err.CallStack

Note: This statement is named Error Call Stack in the Add Statement dialog box.

Returns the stack of function, subroutine, script, and Try calls up to the script line where the last error occurred. Use to generate output that is helpful when debugging scripts.

Syntax CallStack()

Supported objects Err

Return value

Value Description

Value Call stack for the last error that occurred.

Example 'Captures errors from regression test suite Try 'Runs regression test Script.CallScript("RegressionSuite") Catch

395 Err.Clear

'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

Err.Clear

Note: This statement is named Clear Error in the Add Statement dialog box.

Clears error information from the Err object.

Syntax Clear()

Supported objects Err

Example If Err.Number() <> 0 Then errMsg = "Error: Number = " + Err.Number() PrintLn(errMsg) Err.Clear() End If

Err.Description

Note: This statement is named Error Description in the Add Statement dialog box.

Returns a string with the last error that occurred, as defined in the Err.Raise, page 400 statement. Use to generate output that is helpful when debugging scripts.

Syntax Description()

Supported objects Err

396 Err.LineNumber

Return value

Value Description

Value Error description string.

Example 'Captures errors from regression test suite Try 'Runs regression test Script.CallScript("RegressionSuite") Catch 'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

Err.LineNumber

Note: This statement is named Error Line Number in the Add Statement dialog box.

Returns the script line number where an error occurred. Use to generate output that is helpful when debugging scripts.

Syntax LineNumber()

Supported objects Err

Return value

Value Description

Value Script line number where the error occurred.

Example 'Captures errors from regression test suite Try

397 Err.LineText

'Runs regression test Script.CallScript("RegressionSuite") Catch 'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

Err.LineText

Note: This statement is named Error Line Text in the Add Statement dialog box.

Returns text from the script line where the last error occurred. Use to generate output that is helpful when debugging scripts.

Syntax LineText()

Supported objects Err

Return value

Value Description

Value Text from the script line where the error occurred.

Example 'Captures errors from regression test suite Try 'Runs regression test Script.CallScript("RegressionSuite") Catch

398 Err.Number

'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

Err.Number

Note: This statement is named Error Number in the Add Statement dialog box.

Returns the error number for the last error that occurred, as defined in the Err.Raise, page 400 statement. Use to generate output that is helpful when debugging scripts.

Syntax Number()

Supported objects Err

Return value

Value Description

1 Object action error. Indicates a control was not found or interacted with.

2 Argument error. Indicates an invalid, missing, or unexpected argument.

3 Parser error. Indicates an invalid statement.

4 Function error. Indicates a function or statement returned an error.

Example 'Captures errors from regression test suite Try 'Runs regression test Script.CallScript("RegressionSuite") Catch

399 Err.Raise

'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

Err.Raise

Note: This statement is named Raise Error in the Add Statement dialog box.

Generates a script error. This statement can be used in a Try block. See Try...Catch...Finally, page 565.

Syntax Raise(Number, "Source", "Description")

Arguments

Argument Description

Number Error code.

Source Optional text string to indicate where in the script the error occurred.

Description Optional error description.

Supported objects Err

Example Function FunctionThatFails() Err.Raise(100, "FailedFunction", "Function fails") End Function On Error Resume Next FunctionThatFails() If Err.Number() <> 0 Then errMsg = "Error: Number = " + Err.Number() errMsg = errMsg + ", Source = " + Err.Source() errMsg = errMsg + ", Description = " + Err.Description() PrintLn(errMsg) Err.Clear() End If

400 Err.ScriptName

Err.ScriptName

Note: This statement is named Error Script Name in the Add Statement dialog box.

Returns the name of the script an error occurred in. Use to generate output that is helpful when debugging scripts.

Syntax ScriptName()

Supported objects Err

Return value

Value Description

Value Script the error occurred in.

Example 'Captures errors from regression test suite Try 'Runs regression test Script.CallScript("RegressionSuite") Catch 'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

Err.Source

Note: This statement is named Error Source in the Add Statement dialog box.

Returns a string that identifies where the last error occurred, as defined in the Err.Raise, page 400 statement. Use to generate output that is helpful when debugging scripts.

Syntax Source()

401 EvaluateRegExpression

Supported objects Err

Return value

Value Description

Value Error source string.

Example 'Captures errors from regression test suite Try 'Runs regression test Script.CallScript("RegressionSuite") Catch 'Prints error information for debugging purposes PrintLn ("Script with error: " + Err.ScriptName()) PrintLn ("Error #: " + Err.Number()) PrintLn ("Error source: " + Err.Source()) PrintLn ("Error description: " + Err.Description()) PrintLn ("Script line number: " + Err.LineNumber()) PrintLn ("Script line text: " + Err.LineText()) PrintLn ("Call stack: " + Err.CallStack()) End Try

EvaluateRegExpression

Note: This statement is named Evaluate Regular Expression in the Add Statement dialog box.

Evaluates a regular expression and returns True or False to indicate if it matches a value.

Syntax EvaluateRegExpression("RegularExpression", "Value")

402 Exit

Arguments

Argument Description

RegularExpression Regular expression to evaluate. QA Wizard Pro supports .NET regular expressions.

Use two backslashes (\\) to escape the following characters for literal interpretation: ^ [ . $ { * ( + ) | ? < >

Use three backslashes (\\\) to escape the backslash (\) character.

Value Value to test the regular expression against.

Return value

Value Description

True Expression matches the value.

False Expression does not match the value.

Example charAccepted = "^[+]?[0-9]*$" extractedValue = Window("Thank You").ExtractHTMLToString() ticketNum = HTMLFindByID(extractedValue, "ticket") value = (EvaluateRegExpression(charAccepted, ticketNum)) If value = True Then PrintLn("Ticket number contains valid characters") Else PrintLn("Ticket number contains invalid characters") End If

Exit Exits the Do, While, For, Select, Function, and Sub statements. After exiting the statement, playback continues with the next statement.

Syntax Exit Do Exit While Exit For Exit Select Exit Function Exit Sub

403 Expand

Example For counter = 1 To 100 If counter >= 20 Then PrintLn("Counter reached 20 and will exit") Exit For End If PrintLn("Counter is: " + counter) Next

Expand Expands a node, or item, in a tree control. When you expand a tree node during recording, the action is recorded as a Select statement. Use the Expand statement to expand a tree node with items that are not loaded until the node is expanded.

Syntax Expand("Item")

Arguments

Argument Description

Item Node name to expand.

Keyword View notes The node to expand is displayed in the Information column.

Supported objects Tree

Example Window("WysiCorp CRM").Tree("treeViewProducts").Expand("ALM Solutions/Solution Design")

ExternalAssemblyCall Loads a .NET assembly, creates an instance of the class, and calls the requested method. You can pass any number of parameters to the method call. Any public, non-static method is supported. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax ExternalAssemblyCall("AssemblyPath", "ClassName", "MethodName", Parameters...)

404 ExternalAssemblyCall

Arguments

Argument Description

AssemblyPath Full path to the assembly.

ClassName Fully qualified class name to load, including namespaces.

MethodName Public, non-static method to call.

Parameters Optional parameters to pass to the method call, separated with commas.

Return value

Value Description

Value Method value.

Null Method does not return a value.

Return value types The following value types can be returned to the called method and used in scripts.

Category Value type

Signed integers 16-bit (short, Int16)

32-bit (int, Int32)

64-bit (long, Int64)

Unsigned integers 16-bit (ushort, UInt16)

32-bit (uint, UInt32)

64-bit (ulong, UInt64)

Unicode characters Individual characters (char)

Series of characters (string)

.NET DateTime object Object set to the system time and date

Note: To return values from other .NET objects, create an override for ToString() that outputs the data from the objects in a formatted string. To access the object data in scripts, parse the string value returned by the ExternalAssemblyCall statement to retrieve the data items.

405 ExternalCall

Example ExternalAssemblyCall("%SCRIPTS%\\QAWProPixels.dll", "QAWProPixels.QAWProPixels", "GetPixelColor", 100, 150, 0)

ExternalCall Invokes a public method on an instance of a class loaded by the LoadExternalAssembly, page 476 statement and returns the value of the method. You can pass any number of parameters to the method call. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax ExternalCall(Instance, "MethodName", Parameters...)

Arguments

Argument Description

Instance Class instance loaded by the LoadExternalAssembly, page 476 statement.

MethodName Public, non-static method to call.

Parameters Optional parameters to pass to the method call, separated with commas.

Return value

Value Description

Value Method value.

Null Method does not return a value.

Return value types The following value types can be returned to the called method and used in scripts.

Category Value type

Signed integers 16-bit (short, Int16)

32-bit (int, Int32)

64-bit (long, Int64)

Unsigned integers 16-bit (ushort, UInt16)

32-bit (uint, UInt32)

64-bit (ulong, UInt64)

406 ExtractHTML

Category Value type

Unicode characters Individual characters (char)

Series of characters (string)

.NET DateTime object Object set to the system time and date

Note: To return values from other .NET objects, create an override for ToString() that outputs the data from the objects in a formatted string. To access the object data in scripts, parse the string value returned by the ExternalCall statement to retrieve the data items.

Example asmPixels = LoadExternalAssembly("%SCRIPTS%\\QAWProPixels.dll", "QAWProPixels.QAWProPixels") pixelValue = ExternalCall(asmPixels, "GetRGBValueAt", 100, 150)

ExtractHTML Captures HTML in a web page and saves it to a text file. Creates the text file if it does not exist. For example, use this statement to help verify the HTML follows your organization's coding standards.

Syntax ExtractHTML("FullFilePath")

Arguments

Argument Description

FullFilePath Full path to the file to save the extracted HTML in.

Supported objects Browser, Window

Example Browser("Report a Bug").ExtractHTML("C:\\WebTesting\\ReportBug.txt")

ExtractHTMLToString Returns HTML from a browser window as a string.

Syntax ExtractHTMLToString()

Supported objects Browser, Window

407 Fail

Return value

Value Description

Value HTML string.

Example html = Browser("Report a Bug").ExtractHTMLToString()

Fail Stops script playback, displays a message in the Errors pane, and adds the message to the run report. For example, you can use this statement if a script checks text against an expected value before it continues and the text does not match. Fail statements are often used in conditional statement blocks. See Conditional statements, page 325. They can also be used in a Try block. See Try...Catch...Finally, page 565.

Note: The Warning, page 570 statement can perform the same actions as the Fail statement without stopping playback.

Syntax Fail("Message")

Arguments

Argument Description

Message Failure message to display in the Errors pane and run report.

Example regValue = ReadRegistryEntry("HKEY_CLASSES_ROOT\\.qawscript", "") If regValue = "QAWizardPro.Script" Then PrintLn("Scripts entered correctly in the registry") Else Fail("Scripts not entered correctly in the registry") End If

FileBaseName Returns a filename without the extension or directory.

Syntax FileBaseName("FilePath")

408 FileDateCreated

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File base name.

Example FileBaseName("C:\\Testing\\Output.txt")

FileDateCreated Returns the date and time a file or directory was created.

Syntax FileDateCreated("FilePath")

Arguments

Argument Description

FilePath Full path to the file or directory. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value Date and time the file or directory was created.

Example FileDateCreated("C:\\Testing\\Output.txt")

FileDateLastModified Returns the date and time a file or directory was last modified.

Syntax FileDateLastModified("FilePath")

409 FileDirectoryName

Arguments

Argument Description

FilePath Full path to the file or directory. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value Date and time the file or directory was last modified.

Example FileDateLastModified("C:\\Testing\\Output.txt")

FileDirectoryName Returns the directory path from a file path or the parent directory path from a subdirectory path.

Syntax FileDirectoryName("FilePath")

Arguments

Argument Description

FilePath Full path to the file or subdirectory. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value Directory path from the file or subdirectory path.

Example FileDirectoryName("C:\\Testing\\Output.txt")

FileExists Returns True or False to indicate if a file exists.

Syntax FileExists("FilePath")

410 FileExtension

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

True File exists.

False File does not exist.

Example If (FileExists("C:\\Testing\\Output.txt") = True) Then PrintLn("File exists.") Else PrintLn("File does not exist.") End If

FileExtension Returns the file extension, including the period, from a file path. For example, '.txt' is returned from the path to a text file.

Syntax FileExtension("FilePath")

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File extension from the path, including the period.

Example FileExtension("C:\\Testing\\Output.txt")

411 FileFullPath

FileFullPath Returns a full path to a file in a relative path. The QA Wizard Pro workspace directory is used as the default base directory for relative paths. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the script directory.

Syntax FileFullPath("FilePath")

Arguments

Argument Description

FilePath Relative path to the file.

Return value

Value Description

Value Full file path.

Example FileFullPath("TestScripts\\Script001.qawscript")

FileName Returns the filename and extension from a path.

Syntax FileName("FilePath")

Arguments

Argument Description

FilePath Full or relative path to the file.

Return value

Value Description

Value Filename and extension from the path.

Example FileName("C:\\Testing\\Output.txt")

412 FileReadOnly

FileReadOnly Returns True or False to indicate if a file is read-only.

Syntax FileReadOnly("FilePath")

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

True File is read-only.

False File is not read-only.

Example If (FileReadOnly("C:\\Testing\\Output.txt") = True) Then PrintLn("File is read-only.") Else PrintLn("File is not read-only.") End If

FileRootDirectoryName Returns the root directory from a path. For example, 'C:\' is returned from the C:\Testing path. Universal Naming Convention (UNC) paths to network directories can also be used, such as \\ComputerName\SharedFolder\.

Syntax FileRootDirectoryName("FilePath")

Arguments

Argument Description

FilePath Full path to the file or directory.

413 FileSize

Return value

Value Description

Value Root directory from the path.

\\ Root directory from the UNC network directory.

Path does not include a root directory.

Example FileRootDirectoryName("C:\\Testing\\Output.txt")

FileSize Returns the size of a file in bytes.

Syntax FileSize("FilePath")

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File size in bytes.

Example FileSize("C:\\Testing\\Output.txt")

FileType Returns the type of a file or directory. The return value is based on the file type defined in the system registry for the corresponding file extension. For example, the type for a file with a .docx extension is 'Microsoft Word Document' and the type for a directory is 'File Folder'. If a file extension is not defined in the registry, the extension is returned as the file type. For example, the file type for test.abc is returned as 'ABC File'.

414 FindColumnByRowIndex

Syntax FileType("FilePath")

Arguments

Argument Description

FilePath Full path to the file or directory. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File or directory type based on the system registry.

File File extension is not associated with a file type in the registry.

Example FileType("C:\\Testing\\Output.txt")

FindColumnByRowIndex Returns a column index for a table cell located using the row index and property/expected value pairs. Searches the specified row to find the cell, or control in the cell, that has property values that match the expected values.

Syntax FindColumnByRowIndex(SearchRowIndex, "PropertyName", "ExpectedValue", ...)

Note: You can enter multiple property/expected value pairs to better identify a control. Separate each property and value with a comma.

Arguments

Argument Description

SearchRowIndex Table row index number to search.

PropertyName Property name to search for.

ExpectedValue Value to search for.

Supported objects HTMLTable

415 FindRowByColumnIndex

Return value

Value Description

Value Column index of the table cell.

-1 Table cell not found.

Example ID = Cell("D") colIndex = Window("Documents").HTMLTable("List").FindColumnByRowIndex(1, "Inner Text", ID) Window("Documents").HTMLLink(Window("Documents").HTMLTable("List").GetControlFromTable ("HTMLLink", colIndex, 2)).Click()

FindRowByColumnIndex Returns a row index for a table cell located using the column index and property/expected value pairs. Searches the specified column to find the cell, or control in the cell, that has property values that match the expected values.

Syntax FindRowByColumnIndex(SearchColIndex, "PropertyName", "ExpectedValue", ...)

Note: You can enter multiple property/expected value pairs to better identify a control. Separate each property and value with a comma.

Arguments

Argument Description

SearchColIndex Table column index number to search.

PropertyName Property name to search for.

ExpectedValue Value to search for.

Supported objects HTMLTable

Return value

Value Description

Value Row index of the table cell.

-1 Table cell not found.

416 FindSubStr

Example ID = Cell("D") rowIndex = Window("Documents").HTMLTable("List").FindRowByColumnIndex(1, "Inner Text", ID) Window("Documents").HTMLLink(Window("Documents").HTMLTable("List").GetControlFromTable ("HTMLLink", rowIndex, 2)).Click()

FindSubStr

Note: This statement is named Find Substring in the Add Statement dialog box.

Returns the index of the first occurrence of a substring in a string. The search starts at a specified index.

Syntax FindSubStr("FullString", "Substring", StartIndex)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

StartIndex Character position in the full string to start searching for the substring.

Return value

Value Description

Value Index of the first occurrence of the substring in the string.

Example fullString = "Quality-Centric Application Lifecycle Management" subString = "Lifecycle Management" index = FindSubStr(fullString, subString, 1) PrintLn(Left(fullString, index - 1))

FirstRow

Note: This statement is named First Recordset Row in the Add Statement dialog box.

Makes the first row in a recordset the active row.

Syntax FirstRow(Recordset)

417 Float

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Example rs = OpenRecordset("WysiCorp Bugs (Excel)") FirstRow(rs) While Not RecordsetEOF(rs) PrintLn(GetRowValue(rs, "First Name")) NextRow(rs) WEnd

Float Returns the floating point representation of a value.

Syntax Float(Value)

Arguments

Argument Description

Value Value to convert.

Return value

Value Description

Value Floating point number.

Example numFloat = Float(1.234567 * 10^5) PrintLn numFloat

For Each...Next

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Repeats a block of statements once for each element in a group, such as an array. During playback, statements in the loop run once and then repeat using each element in the group. After statements in the loop run for each element, the script continues with the first statement outside of the block.

418 For...Next

To use a counter and loop through a block of statements a specific number of times, use the For...Next, page 419 statement.

Syntax For Each Element In Group [Statements] Next Element

Arguments

Argument Description

Element Item in a collection or array. Must be a variable name.

Group Collection or array name.

Statements One or more statements that repeat for each item in the group.

Example itemList = Window("BugReporter Dialog").ComboBox("comboboxType").Property("ListItems") For Each item In itemList PrintLn (item) Next Window("BugReporter Dialog").Close()

For...Next Repeats a block of statements a specified number of times or until an Exit For statement runs. Uses a variable as a counter to track the number of times the loop runs. The counter can increment by any interval. During playback, the counter variable is declared and the starting value is used as the variable value. After statements in the loop run, the counter increments and the current value is compared to the final counter value. If the current value is less than or equal to the final value, statements in the loop repeat. If the current value is greater than the final value, statements in the loop do not repeat and the script continues. To loop through a block of statements once for each element in a group, use the For Each...Next, page 418 statement.

Syntax For Counter = Start To End [Step Increment] [Statements] Next

419 Format

Arguments

Argument Description

Counter Numeric variable used as a loop counter.

Start Initial counter value.

End End counter value.

Increment Amount the counter increments each time the loop runs. Increments by 1 by default. For example, if the counter starts at 1 and increments by 2, the value is 3 the next time the loop repeats.

Statements One or more statements that repeat.

Keyword View notes The counter variable and start and end values are displayed in the Information column.

Example itemList = Window("BugReporter").ComboBox("comboboxType").Property("ListItems") count = ArraySize(itemList, 1) For x = 1 To count curItemText = itemList(x) Window("BugReporter").ComboBox("comboboxType").Item(curItemText).Select() Next

Format Returns a formatted string using values from an array.

Syntax Format("FormatString", ArrayOfValues)

Arguments

Argument Description

FormatString String to format.

ArrayOfValues Array name that holds the values to format.

Number formatting characters The following specifiers are supported for formatting common numeric values. Array indexes must be in curly braces ({}). Separate the index and specifier with a colon. Indexes are zero based.

420 Format

Specifier Type Format Output (Passed Double Output (Passed Int - 1.42) 12400)

c Currency {0:c} $1.42 -$12,400

d Decimal (Whole number) {0:d} -12400

e Scientific {0:e} 1.420000e+000 -1.240000e+004

f Fixed point {0:f} 1.42 -12400.00

g General {0:g} 1.42 -12400

n Number with commas for {0:n} 1.42 -12,400 thousands

r Round trippable {0:r} 1.42

x Hexadecimal {0:x4} cf90

Custom number formatting characters The following specifiers are also supported for custom formatting of numeric values.

Specifier Type Example Output (Passed Double Notes 1500.42)

0 Zero placeholder {0:00.0000} 1500.4200 Pads with zeroes

# Digit placeholder {0:(#).##} (1500).42

. Decimal point {0:0.0} 1500.4

, Thousand {0:0,0} 1,500 Must be between two separator zeroes

% Percent {0:0%} 150042% Multiplies by 100, adds% sign

e Exponent {0:00e+0} 15e+2 Many exponent formats placeholder available

Return value

Value Description

Value Formatted string of values from the array.

Example Dim arrayValues(2) arrayValues(1) = "WysiWrite"

421 Forward

arrayValues(2) = 24.99 var = Format("{0} subscription license: {1:c} per month", arrayValues) PrintLn(var)

Forward Navigates forward one page in a browser.

Syntax Forward()

Supported objects Browser

Example Browser("Report a Bug").Forward()

General Used to add any statement or function to a script from the Add Statement dialog box, including advanced statements only available in Text View, such as GetControlFromTable.

Arguments

Argument Description

Statement Text Statement or function.

GetAllValues

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns values from a JSONArray as a user array.

Syntax GetAllValues()

Supported objects JSONArray

Return value

Value Description

Value User array with values from a JSONArray.

422 GetBrowserVersion

Example jsonArray = JSONNewArray() ' Appends 1 and 2 to end of array jsonArray.Push(1) jsonArray.Push(2) ' Appends 3 to end of array jsonArray.SetValue(2, 3) ' Sets first index in array to -1 jsonArray.SetValue(0, -1) ' Returns 3 and removes last index from array intVal = jsonArray.Pop() PrintLn("Should be 3: " & intVal) ' Returns array with -1 and 2 in it arrayVal = jsonArray.GetAllValues() PrintLn("Should be 2: " & ArraySize(arrayVal, 1)) PrintLn("Should be -1: " & arrayVal(1)) PrintLn("Should be 2: " & arrayVal(2))

GetBrowserVersion Returns the browser version running the script.

Syntax GetBrowserVersion()

Return value

Value Description

Value Browser version running the script. If the script does not include browser actions, the installed version of the default browser selected in QA Wizard Pro is returned.

Example version = GetBrowserVersion() PrintLn("Browser version: " + version)

GetCallStack Returns the complete stack of function, subroutine, script, and Try calls up to the current script line. Use to trace the calls completed before an error occurred when debugging scripts.

Syntax GetCallStack()

423 GetControlFromTable

Return value

Value Description

Value Current call stack. Each call stack line is returned in three parts, separated with tabs: statement name and arguments, full path to the script file, and line number.

Example stack = GetCallStack() PrintLn("Stack info: " + stack)

GetControlFromTable

Note: This statement is not available in the Add Statement dialog box.

Returns a control from an HTML table. See Using the GetControlFromTable statement, page 243 for more information.

Syntax GetControlFromTable("ControlType", RowIndex, ColumnIndex, "Property", "ExpectedValue", ...)

Note: If a table includes more than one of the same type of control in a cell, you can enter multiple Property/ExpectedValue pairs to uniquely identify the control.

Arguments

Argument Description

ControlType Control type to search for.

RowIndex Table row index number to search in.

ColumnIndex Table column index number to search in.

Property Property name to search for.

ExpectedValue Property value to search for.

Supported objects HTMLTable

Return value

Value Description

Value Control name in table.

424 GetControlFromXPathQuery

Example Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 2, "Inner Text", "Details")

GetControlFromXPathQuery Returns the first HTML element that matches an XPath query. Use the return value anywhere a control is used.

Note: Only use this statement if you are familiar with XPath and understand how changing QA Wizard Pro search options can impact scripts. See About XPath queries, page 223.

Syntax GetControlFromXPathQuery("XPathQuery")

Arguments

Argument Description

XPathQuery XPath query.

Supported objects Browser, Window

Return value

Value Description

Value First HTML element that matches the XPath query.

Example myControl = Browser("WysiCorp").GetControlFromXPathQuery("html[1]/body[1]/table[2]/tbody [1]/tr[2]/td[4]/form[1]/table[1]") myProperty = Window("WysiCorp").Control(myControl).Property("Inner Text")

GetControlSearchTimeout Returns the maximum time set to find a window or control in the application. The maximum time is set in the QA Wizard Pro playback options or by a SetControlSearchTimeout, page 540 statement. If the time limit is reached, playback stops and an error is displayed in the Errors pane and run report.

Syntax GetControlSearchTimeout()

425 GetCurDir

Return value

Value Description

Value Number of milliseconds set to wait before the search times out.

Example timeout = GetControlSearchTimeout() PrintLn("Time out if control not found in " + timeout + " milliseconds")

GetCurDir

Note: This statement is named Get Current Directory in the Add Statement dialog box.

Returns the current working directory for QA Wizard Pro. The working directory is where the QA Wizard Pro component used to run the script starts from. For example, if QA Wizard Pro runs the script, the QA Wizard Pro application directory is the working directory. If QAWRunScript runs the script, the working directory is the current directory in the command prompt.

Syntax GetCurDir()

Return value

Value Description

Value QA Wizard Pro working directory.

Example directory = GetCurDir() DeleteFile(directory + "\\Results.txt")

GetCurrentBrowserType Returns an integer that indicates the browser running the script. You can compare the returned integers against the BrowserTypeIE, BrowserTypeFirefox, and BrowserTypeChrome constants. See Constants, page 600.

Syntax GetCurrentBrowserType()

426 GetDataSourceColumnNames

Return value

Value Description

0 Browser is Microsoft Internet Explorer.

1 Browser is Mozilla Firefox.

2 Browser is Google Chrome.

Example If GetCurrentBrowserType = BrowserTypeIE Then PrintLn("Browser is IE") Else PrintLn("Browser is Firefox") End If

GetDataSourceColumnNames Returns an array of column names from the data source associated with the script.

Syntax GetDataSourceColumnNames()

Return value

Value Description

Value Array of column names from the data source.

Example colNames = GetDataSourceColumnNames() For Each name in colNames PrintLn(name) Next

GetDiagnostics Returns True or False to indicate if playback diagnostic information logging is enabled.

Syntax GetDiagnostics()

427 GetDirectory

Return value

Value Description

True Diagnostic logging is enabled.

False Diagnostic logging is not enabled.

Example If GetDiagnostics = True Then PrintLn("Playback diagnostic info logged") Else PrintLn("Playback diagnostic info not logged") End If

GetDirectory Returns the path to a system or QA Wizard Pro directory.

Syntax GetDirectory(DirectoryId)

Arguments

Argument Description

DirectoryId Directory constant. See Constants, page 600.

Return value

Value Description

Value Path to the system or QA Wizard Pro directory.

Example favorites = GetDirectory(WinFavorites) PrintLn("Favorite applications are stored in " + favorites)

GetDirectoryNames Returns an array of all subdirectory names from a directory or only the subdirectory names that match a search pattern.

Syntax GetDirectoryNames("DirectoryPath", "SearchPattern")

428 GetDotNETProperty

Arguments

Argument Description

DirectoryPath Full path to the directory to search. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

SearchPattern Optional text pattern to search for. Can use a combination of literal and wildcard characters. Use an asterisk (*) to match zero or more characters. Use a question mark (?) to match zero or one character. Regular expressions are not supported.

Return value

Value Description

Value Array of subdirectory names from the directory.

Example GetDirectoryNames("C:\\Testing\\", "Data*")

GetDotNETProperty

Note: This statement is named Get .NET Property in the Add Statement dialog box.

Returns the value of a .NET property. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax GetDotNETProperty("PropertyName", Parameters...)

Arguments

Argument Description

PropertyName .NET property.

Parameters Optional parameters to pass to the property, separated with commas.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

429 GetDotNETPropertyWithArgs

Return value

Value Description

Value .NET property value.

Example gridName = Window("WysiCorp CRM").Grid("accountsDataGridView").GetDotNETProperty("Name") PrintLn gridName

GetDotNETPropertyWithArgs

Note: This statement is named Get .NET Property with Arguments in the Add Statement dialog box.

Returns the value of a .NET property with parameters in an array. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax GetDotNETPropertyWithArgs("PropertyName", ArrayOfParameters)

Arguments

Argument Description

PropertyName .NET property.

ArrayOfParameters Array that holds parameters to pass to the .NET property.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Return value

Value Description

Value .NET property value.

Example items = Window("Form5").ListBox("listBox1").GetDotNETProperty("Items") Dim params(1) params(1) = 1 PrintLn items.GetDotNETPropertyWithArgs("Items", params)

430 GetEnv

GetEnv

Note: This statement is named Get Environment in the Add Statement dialog box.

Returns the value of an environment variable from Windows or QA Wizard Pro. See the Windows help for information about system variables. See QA Wizard Pro environment variables, page 605 for information about QA Wizard Pro variables.

Syntax GetEnv("EnvironmentVariableName")

Arguments

Argument Description

EnvironmentVariableName Windows or QA Wizard Pro environment variable name.

Return value

Value Description

Value Environment variable value.

Example homeDir = GetEnv("HOMEPATH") PrintLn homeDir

GetFieldValue Returns the value of a Helix ALM issue field as a string. You can use this statement to use issue field values in other statements and verify field values before adding issues to Helix ALM. For example, get the Type value from an issue and use it to report on the types of issues created from QA Wizard Pro scripts. You can also get an existing field value and append a new value to it.

Note: This statement cannot be used in load test scripts.

Syntax GetFieldValue(Issue, FieldIdentifier)

Arguments

Argument Description

Issue Issue object that contains the field. Use the NewIssue, page 490 statement to create the issue object.

431 GetFileNames

Argument Description

FieldIdentifier Field name to get the value from.

You can also use the field ID, which is available in the Helix ALM FLDDFNTN database table. You may want to use the ID if issue fields are frequently renamed in the Helix ALM project. Ask your Helix ALM administrator for help.

Return value

Value Description

Value Value set in the issue field.

Null Value is not set in the issue field.

Example issue = NewIssue() ' Uses field name to set Summary field value SetFieldValue(issue, "Summary", "An issue occurred when exporting to XML") ' Uses field ID to get Summary field value summaryValue = GetFieldValue(issue, 2)

You can also call this statement directly on a Helix ALM issue object. issue = NewIssue() ' Uses field name to set Summary field value issue.SetFieldValue("Summary", "An issue occurred when exporting to XML") ' Uses field ID to get Summary field value summaryValue = issue.GetFieldValue(2)

GetFileNames Returns an array of all filenames from a directory or only the filenames that match a search pattern.

Syntax GetFileNames("DirectoryPath", "SearchPattern")

Arguments

Argument Description

DirectoryPath Full path to the directory to search. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

432 GetFilePath

Argument Description

SearchPattern Optional text pattern to search for. Can use a combination of literal and wildcard characters. Use an asterisk (*) to match zero or more characters. Use a question mark (?) to match zero or one character. Regular expressions are not supported.

Return value

Value Description

Value Array of filenames from the directory.

Example GetFileNames("C:\\Testing\\", "*.txt")

GetFilePath Returns the file path to a QA Wizard Pro script or running application.

Syntax GetFilePath(FileId)

Arguments

Argument Description

FileId File constant. See Constants, page 600.

Return value

Value Description

Value Directory path where the script or last started application is stored.

Example script = GetFilePath(QAWScript) PrintLn("Running script saved at " + script)

GetLength

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the number of values in a JSONArray.

Syntax GetLength()

433 GetLowLevelSpeed

Supported objects JSONArray

Return value

Value Description

Value Number of values in the JSONArray.

Example jsonArray = JSONNewArray() ' Appends 1 and 2 to end of array jsonArray.Push(1) jsonArray.Push(2) ' Appends 3 to end of array jsonArray.SetValue(2, 3) ' Sets first index in array to -1 jsonArray.SetValue(0, -1) ' Returns 3 intVal = jsonArray.GetLength() PrintLn("Should be 3: " & intVal)

GetLowLevelSpeed Returns the playback speed set for low-level actions. The speed is set in the QA Wizard Pro playback options or in a SetLowLevelSpeed, page 545 statement.

Syntax GetLowLevelSpeed()

Return value

Value Description

1 Default speed. Same speed used during recording.

0 Maximum speed.

Example llspeed = GetLowLevelSpeed() PrintLn("Low-level actions playback speed: " + llspeed)

434 GetMouseXCoordinate

GetMouseXCoordinate Returns the X coordinate (horizontal pixel location) of the mouse pointer relative to the screen or a window or control.

Note: Only used at the application level when a window or control is not specified.

Syntax GetMouseXCoordinate()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Return value

Value Description

Value Mouse pointer X coordinate. When testing on a computer with multiple screens, the value is the total width of all screens.

Example 'Returns X coordinate on screen where button is clicked Window("Report a Bug").Button("Login").Click() x = GetMouseXCoordinate()

GetMouseYCoordinate Returns the Y coordinate (vertical pixel location) of the mouse pointer relative to the screen or a window or control.

Note: Only used at the application level when a window or control is not specified.

Syntax GetMouseYCoordinate()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

435 GetNumItems

Return value

Value Description

Value Mouse pointer Y coordinate. When testing on a computer with multiple screens, the value is the total height of all screens.

Example 'Returns Y coordinate on screen where button is clicked Window("Report a Bug").Button("Login").Click() y = GetMouseYCoordinate()

GetNumItems

Note: This statement is named Get Number of Items in the Add Statement dialog box.

Returns the number of items in a control.

Syntax GetNumItems()

Supported objects ComboBox, Grid, Item, ListBox, ListView, Menu, PopupMenu, Row, TabBar, ToolBar, Tree

Return value

Value Description

Value Number of items in the control.

Example myItems = Window("Feedback").TabBar("Menu").GetNumItems() For itemIndex = 1 to myItems Window("Feedback").TabBar("Menu").Item("Send")Select() Next itemIndex

GetPlaybackDelay Returns the delay set between each statement. To set the delay, use the SetPlaybackDelay, page 546 statement.

Syntax GetPlaybackDelay()

436 GetPlaybackSessionName

Return value

Value Description

Value Delay between statements.

Example delay = GetPlaybackDelay() PrintLn("Delay between statements: " + delay)

GetPlaybackSessionName Returns the name set for the playback session sent to the QA Wizard Pro Server. To set the session name, use the SetPlaybackSessionName, page 546 statement. You can also enter session names before playback starts if prompting for session names is enabled in the QA Wizard Pro Server options. See Setting server connection options, page 43.

Syntax GetPlaybackSessionName()

Return value

Value Description

Value Playback session name.

Example sessionName = GetPlaybackSessionName() PrintLn("Playback session: " + sessionName)

GetPropertyMap Returns a map of all property names and values from a window or control. You can work with values in the PropertyMap object without calling the target application again. Use the following statements to return additional information about the values in the PropertyMap: Property - PropertyMap, page 510, HasProperty - PropertyMap, page 448, and Size, page 554.

Syntax GetPropertyMap()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

437 GetPropertyNames

Return value

Value Description

Value Map of all property names and values from the window or control.

Example propertyMap = Window("Window").Control("control1").GetPropertyMap() textVal = propertyMap.Property("Text") valToCheck = propertyMap.Property("PropertyNameMayNotExist", "Value to return if specified value not found.")

GetPropertyNames Returns an array of all property names from a window or control. Names are returned as strings that can be passed to the Property, page 509 statement to retrieve the value of each property. This statement can help you verify control properties when debugging scripts.

Note: To return property names for a JSONObject, use the GetPropertyNames - JSONObject, page 439 statement.

Syntax GetPropertyNames()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Return value

Value Description

Value Array of all property names from the window or control.

Example Try Window("Report a Bug").EditBox("editboxPassword").SetText("Secret") Fail("editboxPassword error check") Catch ' Debug code to check control properties PrintLn("List of editboxPassword properties and values:") props = Window("Report a Bug").EditBox("editboxPassword").GetPropertyNames() For each prop in props

438 GetPropertyNames - JSONObject

PrintLn("Property: " + prop + " Value: " + Window("Report a Bug").EditBox ("editboxPassword").Property(prop)) Next End Try

GetPropertyNames - JSONObject

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the property names for a JSONObject.

Syntax GetPropertyNames()

Supported objects JSONObject

Return value

Value Description

Value JSONObject property names.

Example jsonObject = JSONNewObject() ' Adds the values to the JSONObject jsonObject.SetValue("PropertyName1", 1) jsonObject.SetValue("PropertyName2", 2) ' Returns array that contains "PropertyName1" and "PropertyName2" arrayVal = jsonObject.GetPropertyNames() PrintLn("Should be 2: " & ArraySize(arrayVal, 1)) PrintLn("Should be \"PropertyName1\": " & arrayVal(1)) PrintLn("Should be \"PropertyName2\": " & arrayVal(2))

GetRecordsetColumnNames Returns an array of column names from a recordset or data row.

Syntax GetRecordsetColumnNames(Recordset/DataRow)

439 GetRowValue

Arguments

Argument Description

Recordset/DataRow Recordset or data row name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Return value

Value Description

Value Array of column names from the recordset or data row.

Example bugs = OpenRecordset("WysiCorp Bugs (Excel)") colNames = GetRecordsetColumnNames(bugs) For Each name in colNames PrintLn(name) Next

GetRowValue Returns the column value in the current row of a recordset.

Syntax GetRowValue(Recordset, "ColumnName")

Arguments

Argument Description

Recordset Recordset object that contains the row to retrieve the value from. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

ColumnName Column name to retrieve the value from.

Return value

Value Description

Value Value from the cell in the column.

Example bugs = OpenRecordset("WysiCorp Bugs") NextRow(bugs) If Not RecordsetEOF(bugs) Then

440 GetScreenHeight

firstName = GetRowValue(bugs, "first name") Window("Feedback").Editbox("editboxFirst").SetText(firstName) Window("Browser").Close() Else Fail("Error: second record does not exist") End If

GetScreenHeight Returns the test computer's screen height.

Syntax GetScreenHeight()

Return value

Value Description

Value Screen height. When testing on a computer with multiple screens, the value is the total height of all screens.

Example height = GetScreenHeight() x = GetMouseXCoordinate() 'Moves mouse to bottom of screen MouseMove(x, height, 5000)

GetScreenWidth Returns the test computer's screen width.

Syntax GetScreenWidth()

Return value

Value Description

Value Screen width. When testing on a computer with multiple screens, the value is the total width of all screens.

Example width = GetScreenWidth() y = GetMouseYCoordinate() 'Moves mouse to right on screen MouseMove(width, y, 5000)

441 GetScriptVariable

GetScriptVariable Returns the value of a variable defined in a called script.

Syntax GetScriptVariable("ScriptName", "VariableName")

Arguments

Argument Description

ScriptName Called script name.

VariableName Variable name to retrieve the value from in the called script.

Return value

Value Description

Value Variable value.

Example Script.CallScript("WysiCorp Login") loginName = GetScriptVariable("WysiCorp Login", "loginUser") Window("Feedback Page").Editbox("editboxUsername").SetText(loginName)

GetSQLScalar Returns a value from a data source linked to an external datasheet based on a SQL scalar query.

Syntax GetSQLScalar("DatasheetName", "SQLScalarQuery", FailureBehavior)

Arguments

Argument Description

DatasheetName External datasheet to open. Must be in the current workspace and linked to a data source.

SQLScalarQuery SQL scalar query to run.

FailureBehavior Failure behavior. True stops the script if the query fails. False displays a warning and continues playback.

442 GetStopwatchElapsedMilliseconds

Return value

Value Description

Value Value in the first column of the first row from the resulting data set.

Null Query failed.

Example numCustomers = GetSQLScalar("Clients", "SELECT COUNT(*) FROM Customers", True)

GetStopwatchElapsedMilliseconds

Note: This statement is named Get Stopwatch Milliseconds in the Add Statement dialog box.

Returns the elapsed stopwatch time in milliseconds. The return value is useful for comparisons and in Do...Loop While, page 389 statements. For example, you can report on how long a web page takes to load from a server. To control the stopwatch, use the StartStopwatch, page 555 and StopStopwatch, page 556 statements.

Syntax GetStopwatchElapsedMilliseconds()

Return value

Value Description

Value Elapsed stopwatch time in milliseconds.

Example StartStopwatch() Window("Report a Bug").EditBox("editboxUsername").SetText("Guest") Window("Report a Bug").EditBox("editboxPassword").SetText("SoloBug") Window("Report a Bug").Button("buttonLogin").Click() StopStopwatch() elapsedTime = GetStopwatchElapsedMilliseconds() PrintLn("Login time in milliseconds: " + elapsedTime)

GetStopwatchElapsedTime

Note: This statement is named Get Stopwatch Time in the Add Statement dialog box.

Returns the elapsed stopwatch time in HH:MM:SS.mm format. This statement is useful for providing elapsed time in text output. For example, you can print how long it took to complete a web page form and include the output text in the run report.

443 GetValue - JSONArray

To control the stopwatch, use the StartStopwatch, page 555 and StopStopwatch, page 556 statements.

Syntax GetStopwatchElapsedTime()

Return value

Value Description

Value Elapsed stopwatch time in HH:MM:SS.mm format.

Example StartStopwatch() Window("Report a Bug").EditBox("editboxUsername").SetText("Guest") Window("Report a Bug").EditBox("editboxPassword").SetText("SoloBug") Window("Report a Bug").Button("buttonLogin").Click() StopStopwatch() elapsedTime = GetStopwatchElapsedTime() PrintLn("Login time: " + elapsedTime)

GetValue - JSONArray

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the value of an index in a JSONArray or a default value if the index is out of range.

Syntax GetValue(Index, DefaultReturnValue)

Arguments

Argument Description

Index Index in the JSONArray. Indexes are zero based.

DefaultReturnValue Value to return if the index is out of range. If not specified, the default value is null.

Supported objects JSONArray

Return value

Value Description

Value Value of the index in JSONArray. The DefaultReturnValue is returned if the index is out of range.

444 GetValue - JSONObject

Example jsonArray = JSONNewArray() ' Appends 1 and 2 to end of array jsonArray.Push(1) jsonArray.Push(2) ' Sets first index in array to -1 jsonArray.SetValue(0, -1) ' Returns -1 intVal = jsonArray.GetValue(0) PrintLn("Should be -1: " & intVal)

GetValue - JSONObject

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the value of a property in a JSONObject or a default value if the property name is not found.

Syntax GetValue("PropertyName", DefaultReturnValue)

Arguments

Argument Description

PropertyName Property in the JSONObject.

DefaultReturnValue Value to return if the property name is not found. If not specified, the default value is null.

Supported objects JSONObject

Return value

Value Description

Value JSONObject property value. The DefaultReturnValue is returned if the property name is not found.

Example jsonObject = JSONNewObject() ' Adds values to JSONObject jsonObject.SetValue("PropertyName1", 1) jsonObject.SetValue("PropertyName2", 2) ' Returns 2

445 GetVariableValues

intVal = jsonObject.GetValue("PropertyName2") PrintLn("Should be 2: " & intVal)

GetVariableValues Returns all script and repository variables and the current values as a string. If a data source is associated with the script, the current row value is also returned.

Syntax GetVariableValues()

Return value

Value Description

Value String that includes all script and repository variables and current values. Includes the current row value if the script has an associated data source.

Example vars = GetVariableValues() PrintLn vars

GetVirtualUserID

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns the integer ID of the current virtual user.

Syntax GetVirtualUserID()

Return value

Value Description

Value Integer ID of the current virtual user.

Example ' Make unique username for each virtual user userName = "user" + GetVirtualUserID() WebPost("www.wysicorp.com/login.php", "name", userName)

GetWindowsVersion Returns the concatenated string representation of the Windows version and installed service pack.

446 HasProperty - JSONObject

Syntax GetWindowsVersion()

Return value

Value Description

Value Windows version information in a concatenated string.

Example osVersion = GetWindowsVersion() PrintLn("Operating system: " + osversion)

HasProperty - JSONObject

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns True or False to indicate if a property name exists in a JSONObject.

Syntax HasProperty("PropertyName")

Arguments

Argument Description

PropertyName Property in the JSONObject.

Supported objects JSONObject

Return value

Value Description

True Property exists in the JSONObject.

False Property does not exist in the JSONObject.

Example jsonObject = JSONNewObject() ' Adds values to JSONObject jsonObject.SetValue("PropertyName1", 1) jsonObject.SetValue("PropertyName2", 2) ' Returns True

447 HasProperty - PropertyMap

boolVal = jsonObject.HasProperty("PropertyName1") PrintLn("Should be True: " & boolVal)

HasProperty - PropertyMap

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns True or False to indicate if a property name exists in a PropertyMap. To create a PropertyMap for a window or control, use the GetPropertyMap, page 437 statement.

Syntax HasProperty("PropertyName")

Arguments

Argument Description

PropertyName Property name to search for.

Supported objects PropertyMap

Return value

Value Description

True Property exists in the PropertyMap.

False Property does not exist in the PropertyMap.

Example propertyMap = Window("Window").Control("control1").GetPropertyMap() textVal = "" If propertyMap.HasProperty("Text") Then textVal = propertyMap.Property("Text") End If

Help Displays help for a window. This statement performs the same action as clicking the Help button in the application title bar. Use it to open help in a window or to activate the mouse cursor to access 'What's This?', or pop-up, help on individual controls.

Syntax Help()

448 Home

Supported objects Browser, Window

Example Window("BugReporter Dialog").Help()

Home Navigates to the home page in a browser.

Syntax Home()

Supported objects Browser

Example Browser("Report a Bug").Home()

Hour Returns the hour from a date/time value.

Syntax Hour("DateTime")

Arguments

Argument Description

DateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Hour from the date/time value.

Example timeHour = Hour("3:45PM") PrintLn("Hour: " + timeHour)

Hover Moves the mouse pointer to a control and holds it.

449 HTMLFindByID

This statement is not used when recording scripts, but you can manually add it to scripts to test controls hidden until the mouse hovers over them, such as menus on a web page.

Syntax Hover()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").HTMLElement("HTMLSupportLink").Hover()

HTMLFindByID Returns a string that contains the inner text of the tag with an HTML element ID. To get a variable that contains the text, use the ExtractHTMLToString, page 407 statement.

Syntax HTMLFindByID("HTMLText", "HTMLElementID")

Arguments

Argument Description

HTMLText HTML inner text or value.

HTMLElementID HTML element ID.

Return value

Value Description

Value Inner text string from the HTML element.

Example htmlText = Window("Thank You").ExtractHTMLToString() ticketNum = HTMLFindByID(htmlText, "ticket") If ticketNum = "" Then Fail("Cannot find ticket number") Else PrintLn("Ticket number: " & ticketNum) End If

450 HTMLFindByTag

HTMLFindByTag Returns an array of strings that contain the inner text from an HTML element tag.

Syntax HTMLFindByTag("HTMLText", "Tag")

Arguments

Argument Description

HTMLText HTML inner text or value.

Tag HTML element tag.

Return value

Value Description

Value Array of inner text strings from the HTML element.

Example htmlText = Browser("Thank You").ExtractHTMLToString() metaInnerTextUserArray = HTMLFindByTag(htmlText, "meta") arraySize = ArraySize(metaInnerTextUserArray, 1) PrintLn("Count of META tags in document: " & arraySize)

If Conditionally runs a block of statements based on the value of an expression (True or False). If the condition is True, statements in the If block run. If the condition is False, statements in the If block are skipped and the script continues with the first statement outside of the block. You can use the Else, page 392 and ElseIf, page 392 statements to run an alternate blocks of statements when the If condition is False.

Syntax If Condition Then [Statements] [ElseIf Condition-n Then [ElseIfStatements]] [Else [ElseStatements]] End If

Tip: You can use a single line format for short, simple If statements.

451 IgnoreAutocompleteDropDowns

Arguments

Argument Description

Condition Numeric or string expression that evaluates to True or False. For example, a > b, a < b, a = b, or a <> b. Null conditions are treated as False.

Statements One or more statements to run if Condition is True.

Keyword View notes The condition to evaluate is displayed in the Information column.

Example currentHour = Hour(Now()) Print("Time of day: ") If (6 <= currentHour) and (currentHour < 12) Then PrintLn("morning") ElseIf (12 <= currentHour) and (currentHour < 18) Then PrintLn("afternoon") ElseIf (18 <= currentHour) and (currentHour < 24) Then PrintLn("evening") Else PrintLn("night") End If

IgnoreAutocompleteDropDowns Ignores autocomplete drop-down lists in web applications. By default, QA Wizard Pro attempts to dismiss autocomplete drop-down lists during playback by pressing Esc after entering text in fields, which may cause scripts to fail. Use this statement to ignore drop-down lists so QA Wizard Pro does not interact with them.

Syntax IgnoreAutocompleteDropDowns(True/False)

Arguments

Argument Description

True/False True ignores autocomplete drop-down lists during playback and False allows drop-downs to display.

Example IgnoreAutocompleteDropDowns(True)

452 IgnoreErrors

IgnoreErrors Stops displaying errors in the Errors pane during playback and in run reports. Use this statement with error handling blocks to prevent displaying known errors, which makes it easier to focus on errors that need to be addressed. If a script error occurs while errors are ignored, the script line is marked as Failed, but additional error information is not provided.

Syntax IgnoreErrors(True/False)

Arguments

Argument Description

True/False True stops displaying errors and False displays errors.

Example IgnoreErrors(True)

IgnoreWarnings Stops displaying warnings in the Errors pane during playback and in run reports.

Syntax IgnoreWarnings(True/False)

Arguments

Argument Description

True/False True stops displaying warnings and False displays warnings.

Example IgnoreWarnings(True)

InsertAt

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Inserts a value at an index in a JSONArray and pushes all values after it in the array back one position.

Syntax InsertAt(Index, "Value")

453 Integer

Arguments

Argument Description

Index Index in the JSONArray. Indexes are zero based.

Value Value to insert.

Supported objects JSONArray

Example jsonArray = JSONNewArray() ' Inserts "First" at beginning of array jsonArray.InsertAt(0, "First")

Integer Returns the integer representation of a value.

Syntax Integer(Value)

Arguments

Argument Description

Value Value to convert to an integer.

Return value

Value Description

Value Converted integer value.

Example int = Integer(123.5678)

InvokeDotNETMethod

Note: This statement is named Invoke .NET Method in the Add Statement dialog box.

Invokes a .NET method and returns the method value. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

454 InvokeDotNETMethodWithArgs

Syntax InvokeDotNETMethod("MethodName", ParametersList)

Arguments

Argument Description

MethodName .NET method name to invoke.

ParametersList Parameters to use when invoking the method.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Return value

Value Description

Value Method value.

Example Window("Form").EditBox("editboxRegister").InvokeDotNETMethod("Clear", 2)

InvokeDotNETMethodWithArgs

Note: This statement is named Invoke .NET Method with Arguments in the Add Statement dialog box.

Invokes a .NET method with parameters in an array and returns the method value. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax InvokeDotNETMethodWithArgs("MethodName", ArrayOfParameters)

Arguments

Argument Description

MethodName .NET method name to invoke.

ArrayOfParameters Array that holds parameters to pass to the .NET method.

455 InvokeJavaScript

Return value

Value Description

Value Method value.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Dim array(2) array(1) = "parameter" array(2) = 2 returnValue = Window("Form").EditBox("editboxRegister").InvokeDotNETMethodWithArgs ("Clear", array)

InvokeJavaScript Returns the result of JavaScript evaluated in a window.

Syntax InvokeJavaScript("Script")

Arguments

Argument Description

Script JavaScript to invoke. Case sensitive. Alerts, confirmations, and prompts are not supported.

Supported objects Browser, Window

Return value

Value Description

Value JavaScript result.

Example documentLocation = Window("MyWebPage").InvokeJavaScript("document.location.href;")

456 Is64BitWindows

Is64BitWindows Returns True or False to indicate if the Windows version is 64-bit.

Syntax Is64BitWindows()

Return value

Value Description

True Windows version is 64-bit.

False Windows version is 32-bit.

Example If Is64BitWindows() Then PrintLn("64-bit Windows") Else PrintLn("32-bit Windows") End if

IsArray Returns True or False to indicate if an expression is an array.

Syntax IsArray(Value)

Arguments

Argument Description

Value Expression to evaluate.

Return value

Value Description

True Expression is an array.

False Expression is not an array.

Example retVal = myFunction() myVal = ""

457 IsIgnoringAutocompleteDropDowns

If (IsArray(retVal)) Then myVal = retVal(1) Else myVal = retval End If

IsIgnoringAutocompleteDropDowns Returns True or False to indicate if autocomplete drop-down lists are ignored.

Syntax IsIgnoringAutocompleteDropDowns()

Return value

Value Description

True Autocomplete drop-down lists are ignored.

False Autocomplete drop-down lists are not ignored.

Example If IsIgnoringAutoCompleteDropDowns = True Then PrintLn("Ignoring autocomplete drop-down lists") Else PrintLn("Not ignoring autocomplete drop-down lists") End If

IsIgnoringErrors Returns True or False to indicate if errors are displayed in the Errors pane during playback and in run reports.

Syntax IsIgnoringErrors()

Return value

Value Description

True Errors are ignored.

False Errors are not ignored.

Example If IsIgnoringErrors = True Then PrintLn("Ignoring errors")

458 IsIgnoringWarnings

Else PrintLn("Not ignoring errors") End If

IsIgnoringWarnings Returns True or False to indicate if warnings are displayed in the Errors pane during playback and in run reports.

Syntax IsIgnoringWarnings()

Return value

Value Description

True Warnings are ignored.

False Warning are not ignored.

Example If IsIgnoringWarnings = True Then PrintLn("Ignoring warnings") Else PrintLn("Not ignoring warnings") End If

IsJSONArray Returns True or False to indicate if an expression is a JSONArray type.

Syntax IsJSONArray(Value)

Arguments

Argument Description

Value Expression to evaluate.

Return value

Value Description

True Expression is a JSONArray.

False Expression is not a JSONArray.

459 IsJSONObject

Example ' Returns True jsonArray = JSONNewArray() boolVal = IsJSONArray(jsonArray) PrintLn("Should be True: " & boolVal) ' Returns False boolVal = IsJSONArray("[1,2,3,4]") PrintLn("Should be False: " & boolVal)

IsJSONObject Returns True or False to indicate if an expression is a JSONObject type.

Syntax IsJSONObject(Value)

Arguments

Argument Description

Value Expression to evaluate.

Return value

Value Description

True Expression is a JSONObject.

False Expression is not a JSONObject.

Example ' Returns True jsonArray = JSONNewObject() boolVal = IsJSONObject(jsonObject) PrintLn("Should be True: " & boolVal) ' Returns False boolVal = IsJSONObject(JSONNewArray()) PrintLn("Should be False: " & boolVal)

IsJSONType Returns True or False to indicate if an expression is a JSONObject or JSONArray type.

Syntax IsJSONType(Value)

460 IsDate

Arguments

Argument Description

Value Expression to evaluate.

Return value

Value Description

True Expression is a JSONObject or JSONArray.

False Expression is not a JSONObject or JSONArray.

Example ' Returns True jsonType = JSONNewArray() boolVal = IsJSONType(jsonType) PrintLn("Should be True: " & boolVal) ' Returns False boolVal = IsJSONType("[1,2,3,4]") PrintLn("Should be False: " & boolVal)

IsDate Returns True or False to indicate if a date/time string is valid.

Syntax IsDate("DateTimeString")

Arguments

Argument Description

DateTimeString Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

True Expression is a valid date/time string.

False Expression is not a valid date/time string.

Example ValidDate = IsDate("12-December-2016")

461 IsNull

IsNull Returns True or False to indicate if a value is null.

Syntax IsNull("Value")

Arguments

Argument Description

Value Value to evaluate.

Return value

Value Description

True Value is null.

False Value is not null.

Example x = Window("WysiCorp CRM").Grid("accountsDataGridView").GetDotNETProperty("Selection") If IsNull(x) Then PrintLn("No selection") Else x.SetDotNETProperty("Value", 10) End If

IsNumeric Returns True or False to indicate if an expression is numeric.

Syntax IsNumeric(Expression)

Arguments

Argument Description

Expression Expression to evaluate.

462 IsObject

Return value

Value Description

True Expression is numeric.

False Expression is not numeric.

Example IsNumeric(42)

IsObject Returns True or False to indicate if an expression is a dynamic COM object.

Syntax IsObject(expression)

Arguments

Argument Description

Expression Expression to evaluate.

Return value

Value Description

True Expression is a dynamic COM object.

False Expression is not a dynamic COM object.

Example ' Returns True IsObject(CreateObject("Excel.Application")) ' Returns False IsObject("Excel")

JSONArrayGetValue Returns the value of an index from a JSONArray or a default value if the index is out of range.

Syntax JSONArrayGetValue("JSON", Index, DefaultReturnValue)

463 JSONArraySetValue

Arguments

Argument Description

JSON JSONArray.

Index Index in the JSONArray. Indexes are zero based.

DefaultReturnValue Value to return if the index is out of range. If not specified, the default value is null.

Return value

Value Description

Value Value of the index from the JSONArray. If the index is out of range, the default return value is returned.

Example ' Returns 2 intVal = JSONArrayGetValue("[1,2,\"three\"]", 1, null) PrintLn("Should be 2: " & intVal) ' Returns -1 defaultVal = JSONArrayGetValue("[1,2,\"three\"]", 3, -1) PrintLn("Should be -1: " & defaultVal)

JSONArraySetValue Sets or adds the value to an index in a JSONArray and returns the modified array.

Syntax JSONArraySetValue("JSON", Index, "Value")

Arguments

Argument Description

JSON JSONArray.

Index Index in the JSONArray. Indexes are zero based.

Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

464 JSONCanParseAsArray

Return value

Value Description

Value Modified JSONArray.

Example ' Returns "[1,2,3]" strVal = JSONArraySetValue("[1,2]", 2, 3) PrintLn("Should be \"[1,2,3]\": " & strVal)

JSONCanParseAsArray Returns True or False to indicate if an expression contains a JSONArray.

Syntax JSONCanParseAsArray("JSON")

Arguments

Argument Description

JSON Expression to evaluate.

Return value

Value Description

True Expression contains a JSONArray.

False Expression does not contain a JSONArray.

Example ' Returns True boolVal = JSONCanParseAsArray("[1, 2, 3,[]]") PrintLn("Should be True: " & boolVal) ' Returns False boolVal = JSONCanParseAsArray("1, 2, 3") PrintLn("Should be False: " & boolVal)

JSONCanParseAsObject Returns True or False to indicate if an expression contains a JSONObject.

Syntax JSONCanParseAsObject("JSON")

465 JSONIsValid

Arguments

Argument Description

JSON Expression to evaluate.

Return value

Value Description

True Expression contains a JSONObject

False Expression does not contain a JSONObject.

Example ' Returns True boolVal = JSONCanParseAsObject("{\"name\":\"value\"}") PrintLn("Should be True: " & boolVal) ' Returns False boolVal = JSONCanParseAsObject("[1, 2, 3,[]]") PrintLn("Should be False: " & boolVal)

JSONIsValid Returns True or False to indicate if an expression is valid JSON.

Syntax JSONIsValid("JSON")

Arguments

Argument Description

JSON Expression to evaluate. Must contain a number, string, Boolean, JSONObject, JSONArray, or null to return True.

Strings must be wrapped in backslashes and double quotation marks (\"). For example, x = "\"This is a string\"" is evaluated as a JSON string.

Return value

Value Description

True Expression is valid JSON.

False Expression is not valid JSON.

466 JSONNewArray

Example ' Returns True boolVal = JSONIsValid("{\"propName\":\"propValue\"}") PrintLn("Should be True: " & boolVal) ' Returns False boolVal = JSONIsValid("unquoted string") PrintLn("Should be False: " & boolVal)

JSONNewArray Creates and returns an empty JSONArray.

Syntax JSONNewArray()

Return value

Value Description

Value Empty JSONArray.

Example jsonArray = JSONNewArray()

JSONNewObject Creates and returns an empty JSONObject.

Syntax JSONNewObject()

Return value

Value Description

Value Empty JSONObject.

Example jsonObject = JSONNewObject()

JSONObjectGetValue Returns the value of a property from a JSONObject or a default value if the property name is not found.

467 JSONObjectSetValue

Syntax JSONObjectGetValue("JSON", "PropertyName", DefaultReturnValue)

Arguments

Argument Description

JSON JSONObject.

PropertyName Property in the JSONObject.

DefaultReturnValue Value to return if the property name is not found. If not specified, the default value is null.

Return value

Value Description

Value Property value from the JSONObject.

Null Property name was not found.

Example strVal = JSONObjectGetValue("{\"propName\":\"propValue\"}", "propName") PrintLn("Should be \"propValue\": " & strVal)

JSONObjectSetValue Sets or adds a value to a property name in a JSONObject and returns the modified object.

Syntax JSONObjectSetValue("JSON", "PropertyName", "Value")

Arguments

Argument Description

JSON JSONObject.

PropertyName Property in the JSONObject. If not found, a new property is created.

Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONObject.

468 JSONParse

Return value

Value Description

Value Modified JSONObject.

Example strVal = JSONObjectSetValue("{\"propertyName\": \"propertyValue\"}", "propertyName", "new PropertyValue") PrintLn("Should be \"{\"propertyName\":\"new PropertyValue\"}\": " & strVal)

JSONParse Returns a value after parsing an object using JSON syntax.

Note: User arrays are treated as objects. To convert between a user array and JSONArray, use the ArrayToJSONArray, page 357 statement.

Syntax JSONParse("JSON")

Arguments

Argument Description

JSON Object to parse. Can be a number, Boolean, null, string, JSONArray, JSONObject, or other data type.

If a string is used, a string, JSONObject, JSONArray, integer, float, Boolean, or null may be returned. Strings must be wrapped in backslashes and double quotation marks (\") to be parsed as JSON. For example, x = "\"This is a string\"".

If a JSONObject or JSONArray is used, a copy is created and returned. If another data type is used, the object is converted to a string before parsing.

Return value

Value Description

Value Value from the parsed object.

Example jsonObject = JSONParse("{\"propertyName\": \"propertyValue\"}") PrintLn("Should be \"{\"propertyName\":\"propertyValue\"}\": " & jsonObject)

469 KeyDown

KeyDown Presses and holds one or more keyboard keys on a window or control, or at the application level. This statement is followed by KeyUp, page 471.

Syntax KeyDown("KeyName", WaitTime)

Arguments

Argument Description

KeyName Key to release. Valid key codes are available on Microsoft's web site (http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx).

To release keys in combination with modifiers, such as Ctrl, Shift, and Alt, enter the primary key followed by the modifier key. For example, D1, Shift releases the Shift and 1 keys. D1 is the primary key and Shift is the modifier key.

WaitTime Number of milliseconds to wait after the previous statement before pressing the key.

Tip: To determine the correct key code and modifier order, enter the key combination for this statement in the Add Statement dialog box.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example KeyDown("Z, Control", 5000) KeyUp("Z, Control", 5000)

KeyPress Presses and releases one or more keyboard keys on a window or control, or at the application level.

Syntax KeyPress("KeyName")

470 KeyUp

Arguments

Argument Description

KeyName Key to release. Valid key codes are available on Microsoft's web site (http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx).

To release keys in combination with modifiers, such as Ctrl, Shift, and Alt, enter the primary key followed by the modifier key. For example, D1, Shift releases the Shift and 1 keys. D1 is the primary key and Shift is the modifier key.

Tip: To determine the correct key code and modifier order, enter the key combination for this statement in the Add Statement dialog box.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").EditBox("editboxUsername").KeyPress("C, Control") KeyPress("Menu, Alt")

KeyUp Releases a one or more keyboard keys on a window or control, or at the application level. This statement is preceded by KeyDown, page 470.

Syntax KeyUp("KeyName", WaitTime)

Arguments

Argument Description

KeyName Key to release. Valid key codes are available on Microsoft's web site (http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx).

To release keys in combination with modifiers, such as Ctrl, Shift, and Alt, enter the primary key followed by the modifier key. For example, D1, Shift releases the Shift and 1 keys. D1 is the primary key and Shift is the modifier key.

WaitTime Number of milliseconds to wait after the previous statement before releasing the key.

471 LastRow

Tip: To determine the correct key code and modifier order, enter the key combination for this statement in the Add Statement dialog box.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example KeyDown("Z, Control", 5000) KeyUp("Z, Control", 5000)

LastRow

Note: This statement is named Last Recordset Row in the Add Statement dialog box.

Makes the last row in a recordset the active row.

Syntax LastRow(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Example rs = OpenRecordset("WysiCorp Bugs (Excel)") LastRow(rs) While Not RecordsetBOF(rs) PrintLn(GetRowValue(rs, "First Name")) PrevRow(rs) WEnd

Left Returns a number of characters from the beginning of a string.

Syntax Left("String", NumberOfCharacters)

472 Length

Arguments

Argument Description

String String to return characters from.

NumberOfCharacters Number of characters to return.

Return value

Value Description

Value Characters from the beginning of the string.

Example LeftString = Left("QAWPString", 4)

Length Returns the number of characters in a string.

Syntax Length("String")

Arguments

Argument Description

String String to return the number of characters from.

Return value

Value Description

Value Number of characters in the string.

Example strLength = Length("Month")

LMouseClick

Note: This statement is named Left Mouse Click in the Add Statement dialog box.

Clicks the left mouse button in a location.

473 LMouseDoubleClick

Syntax LMouseClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").Button("Login").LMouseClick(15, 10, 5000)

LMouseDoubleClick

Note: This statement is named Left Mouse Double-Click in the Add Statement dialog box.

Double-clicks the left mouse button in a location.

Syntax LMouseDoubleClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

474 LMouseDown

Argument Description

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Browser("Report a Bug").LMouseDoubleClick(60, 11, 10000)

LMouseDown

Note: This statement is named Left Mouse Down in the Add Statement dialog box.

Presses the left mouse button in a location. This statement is typically followed by LMouseUp, page 476.

Syntax LMouseDown(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

475 LMouseUp

Example Browser("Report a Bug").Button("Back").LMouseDown(15, 15, 0)

LMouseUp

Note: This statement is named Left Mouse Up in the Add Statement dialog box.

Releases the left mouse button in a location. This statement is preceded by LMouseDown, page 475.

Syntax LMouseUp(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Browser("Report a Bug").Button("Back").LMouseUp(15, 15, 100)

LoadExternalAssembly Returns an instance of a class loaded from a .NET assembly. The instance can be used with ExternalCall, page 406 to call methods on the class.

Syntax LoadExternalAssembly("AssemblyPath", "ClassName")

476 Lower

Arguments

Argument Description

AssemblyPath Path to the assembly.

ClassName Fully qualified class name including namespace.

Return value

Value Description

Value Instance of the class loaded from the .NET assembly.

Example asmPixels = LoadExternalAssembly("%SCRIPTS%\\QAWProPixels.dll", "QAWProPixels.QAWProPixels") pixelValue = ExternalCall(asmPixels, "GetRGBValueAt", 100, 150)

Lower Converts characters in a string to lowercase and returns the string.

Syntax Lower("String")

Arguments

Argument Description

String String to convert.

Return value

Value Description

Value Converted lowercase string.

Example lowercaseString = Lower("QA Wizard Pro")

MakeRegExpression

Note: This statement is named Make Regular Expression in the Add Statement dialog box.

477 MakeURL

Returns a regular expression built from a string. This statement is useful for converting string values with special characters that are stored in variables. Special characters are escaped for literal interpretation in the returned regular expression.

Syntax MakeRegExpression("RegularExpressionString")

Arguments

Argument Description

RegularExpressionString String to build the regular expression from.

Return value

Value Description

Value Regular expression built from the string.

Example regExString = MakeRegExpression("$25.00")

MakeURL Returns the full URL constructed by combining a root URL and a component, such as a web server directory path, filename and extension, anchor tag, or other parameter.

Syntax MakeURL("RootURL", "Component")

Arguments

Argument Description

RootURL Root URL.

Component Component to combine with the root URL.

Return value

Value Description

Value Full URL.

Example url = MakeURL("http://www.wysicorp.com", "login.php")

478 Max

Max

Note: This statement is named Maximum in the Add Statement dialog box.

Returns the larger of two numbers.

Syntax Max(FirstNumber, SecondNumber)

Arguments

Argument Description

FirstNumber First number to evaluate.

SecondNumber Second number to evaluate.

Return value

Value Description

Value Larger number.

Example maximumValue = Max(50, 45)

Maximize Maximizes a window. Performs the same action as clicking the Maximize button in the application title bar.

Tip: If you are running scripts on multiple computers with different screen resolutions, you may want to add a Maximize statement to scripts to make sure QA Wizard Pro can locate all objects during playback.

Syntax Maximize()

Supported objects Browser, Window

Example Window("Feedback Acknowledgment").Maximize()

Mid Returns a number of characters starting with a position in the string.

479 Min

Syntax Mid("String", StartingPosition, NumberOfCharacters)

Arguments

Argument Description

String String to return characters from.

StartingPosition Starting position character index number from the string. If greater than the number of string characters, a zero-length string is returned.

NumberOfCharacters Number of characters to return.

Return value

Value Description

Value Characters from the middle of the string based on the starting position.

Example midChars = Mid("QA Wizard Pro", 2, 5)

Min

Note: This statement is named Minimum in the Add Statement dialog box.

Returns the smaller of two values.

Syntax Min(FirstNumber, SecondNumber)

Arguments

Argument Description

FirstNumber First number to evaluate.

SecondNumber Second number to evaluate.

Return value

Value Description

Value Smaller value.

480 Minimize

Example minimumValue = Min(85, 90)

Minimize Minimizes a window to a button on the Windows taskbar. Performs the same action as clicking the Minimize button in the application title bar.

Syntax Minimize()

Supported objects Browser, Window

Example Window("Feedback Acknowledgment").Minimize()

Minute Returns the minute from a date/time value.

Syntax Minute("DateTime")

Arguments

Argument Description

DateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Minute from the date/time value.

Example minuteValue = Minute("2016-05-01 14:57:32.8")

MMouseClick

Note: This statement is named Middle Mouse Click in the Add Statement dialog box.

Clicks the middle mouse button in a location.

481 MMouseDoubleClick

Syntax MMouseClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Feedback Acknowledgment").MMouseClick(400, 315, 5000)

MMouseDoubleClick

Note: This statement is named Middle Mouse Double-Click in the Add Statement dialog box.

Double-clicks the middle mouse button in a location.

Syntax MMouseDoubleClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

482 MMouseDown

Argument Description

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Feedback Acknowledgment").MMouseDoubleClick(435, 550, 10000)

MMouseDown

Note: This statement is named Middle Mouse Down in the Add Statement dialog box.

Presses the middle mouse button in a location. This statement is followed by MMouseUp, page 484.

Syntax MMouseDown(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

483 MMouseUp

Example Window("Feedback Acknowledgment").MMouseDown(223, 127, 1000)

MMouseUp

Note: This statement is named Middle Mouse Up in the Add Statement dialog box.

Releases the middle mouse button in a location. This statement is preceded by MMouseDown, page 483.

Syntax MMouseUp(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Feedback Acknowledgment").MMouseUp(223, 127, 0)

Month Returns the month from a date/time value as an integer.

Syntax Month("DateTime")

484 MonthName

Arguments

Argument Description

DateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Integer that corresponds with the month from the date/time value. 1 is January, 2 is February, etc.

Example monthValue = Month("1 May 2016 2:57:32.8 PM")

MonthName Returns a month name based on a month integer. 1 is January, 2 is February, etc.

Syntax MonthName(MonthInteger)

Arguments

Argument Description

MonthInteger Month integer.

Return value

Value Description

Value Month name that corresponds with the integer.

Example monthNameValue = MonthName(9)

MonthNum

Note: This statement is named Month Numeric in the Add Statement dialog box.

Returns a month integer based on the month name. January is 1, February is 2, etc.

Syntax MonthNum("MonthName")

485 MouseMove

Arguments

Argument Description

MonthName Month name.

Return value

Value Description

Value Integer that corresponds with the month name.

Example monthNumericValue = MonthNum("September")

MouseMove Moves the mouse pointer to a location. QA Wizard Pro may record mouse move statements to move from one unknown control to another so the controls can be located during playback. You can also use this statement to move the mouse anywhere on the screen.

Syntax MouseMove(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location to move the mouse to, relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location to move the mouse to, relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before moving the mouse pointer to the location.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").MouseMove(325, 225, 5000)

486 MouseMoveFromCurrentPosition

MouseMoveFromCurrentPosition Moves the mouse pointer a number of pixels from the current location.

Syntax MouseMoveFromCurrentPosition(xPixels, yPixels, WaitTime)

Arguments

Argument Description

xPixels Number of pixels to move the mouse horizontally. Must be within the available pixels on the test computer's screen.

yPixels Number of pixels to move the mouse vertically. Must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before moving the mouse.

Example 'Moves mouse right 25 pixels and down 15 pixels 5000 milliseconds after previous statement runs MouseMoveFromCurrentPosition(25, 15, 5000)

MoveDirectory Moves or renames a directory.

Syntax MoveDirectory("SourcePath", "DestinationPath")

Arguments

Argument Description

SourcePath Full path to the directory to move. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

DestinationPath Full path to move the directory to. To rename the directory, enter the new name in the destination path. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Example MoveDirectory("C:\\Testing\\TestDocuments", "C:\\Testing\\Data")

487 MoveFile

MoveFile Moves or renames a file.

Syntax MoveFile("SourcePath", "DestinationPath")

Arguments

Argument Description

SourcePath Full path to the file to move. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

DestinationPath Full path to the directory to move the file to. To rename a file, include the new name in the destination path. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Example MoveFile("C:\\Testing\\Output.txt", "C:\\TestDocuments\\DataSource")

MSAADoDefaultAction Uses Active Accessibility to perform a control's default action.

Syntax MSAADoDefaultAction()

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").HTMLLink("SoloSubmitLogo").MSAADoDefaultAction()

MSAASetName Uses Active Accessibility to set the name of a control.

Syntax MSAASetName("Name")

488 MSAASetValue

Arguments

Argument Description

Name Name to set on the control.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").HTMLLink("SoloSubmitLogo").MSAASetName("Link to SoloSubmit")

MSAASetValue Uses Active Accessibility to set the value of a control.

Syntax MSAASetValue("Value")

Arguments

Argument Description

Value Value to set on the control. Null values must be converted to empty strings before used.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").HTMLLink("Products").MSAASetValue("Products Footer Link")

Navigate Navigates to a URL in a browser.

Syntax Navigate("URL")

489 NewIssue

Arguments

Argument Description

URL URL to navigate to.

Supported objects Browser, HTMLLink, Window

Example Browser("Out of Bounds").Navigate("http://www.wysicorp.com")

NewIssue Create an empty Helix ALM issue. After the issue object is created, you can use the following statements to set, get, or remove issue field values, add file attachments to the issue, and add the issue to the configured Helix ALM project: AddFileAttachment, page 352, AddToHelixALM, page 354, GetFieldValue, page 431, RemoveField, page 517, and SetFieldValue, page 542.

Note: This statement cannot be used in load test scripts.

Syntax NewIssue()

Return value

Value Description

Value Empty Helix ALM issue.

Example issue = NewIssue()

NewTab Opens a new tab in a browser.

Syntax NewTab()

Supported objects Browser

490 NextRow

Example Browser().NewTab()

NextRow

Note: This statement is named Next Recordset Row in the Add Statement dialog box.

Moves to the next row in a recordset. If the recordset row index is at or past the end of the data, the index does not change.

Syntax NextRow(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Example bugs = OpenRecordset("WysiCorp Bugs") NextRow(bugs)

Now Returns the current date and time in the format used on the test computer. Formatting depends on the operating system's regional settings.

Syntax Now()

Return value

Value Description

Value Current date and time.

Example currentDateAndTime = Now()

OCRCheckpoint Verifies graphical text against an expected value through OCR comparison. Use to verify text in images, control types QA Wizard Pro cannot recognize, or a specified region in a window or control. See Creating OCR checkpoints, page 183.

491 OCRCheckpoint

If the expected text does not match the application during playback, the script fails or continues and displays a message in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails.

Syntax OCRCheckpoint(MinimumAccuracy, "ExpectedText", LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight, FailureBehavior, "Warning")

Arguments

Argument Description

MinimumAccuracy Minimum percentage of accuracy required to pass the checkpoint.

ExpectedText Text string to verify against the returned text.

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

RectangleWidth Optional integer pixel value of the width of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified.

RectangleHeight Optional integer pixel value of the height of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("WysiCorp Home").HTMLElement("elementLoginTester").OCRCheckpoint(92, "solobug", 74, -35, 60, 18)

492 OCRCheckpointPreviousStatement

OCRCheckpointPreviousStatement

Note: This statement was previously named CheckpointOCR and is deprecated. Use OCRCheckpoint instead. See OCRCheckpoint, page 491.

Verifies graphical text in the screenshot captured for the action performed in the previous statement against an expect value using OCR comparison. If the expected text value in the specified rectangle from the screenshot does not match the application during playback, the script fails or continues and displays a message in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails.

Syntax OCRCheckpointPreviousStatement(Region, MinimumAccuracy, "ExpectedText", LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight, FailureBehavior, "Warning")

Arguments

Argument Description

Region OCR region to check. OCRWindowRelative uses the pixel locations relative to the window that last had an action performed in it. OCRControlRelative uses the pixel locations relative to the control that last had an action performed on it.

MinimumAccuracy Minimum percentage of accuracy required to pass the checkpoint.

ExpectedText Text string to verify against the actual text.

LeftEdgePixel Integer pixel value of the left side of the rectangle that contains the text to verify.

TopEdgePixel Integer pixel value of the top side of the rectangle that contains the text to verify.

RectangleWidth Integer pixel value of the width of the rectangle that contains the text to verify.

RectangleHeight Integer pixel value of the height of the rectangle that contains the text to verify.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

Example OCRCheckpointPreviousStatement(OCRControlRelative, 92, "PRODUCTS", 45, 163, 50, 50, True, "Products text is incorrect")

OCRConvertToGrayscale Converts an image to grayscale before reading it using OCR. Use to override the default OCR grayscale conversion set in the playback options, which may help improve the accuracy of returned text. See Troubleshooting OCR issues, page 186.

493 OCRGetContrast

Syntax OCRConvertToGrayscale(True/False)

Arguments

Argument Description

True/False True converts images to grayscale and False stops converting to grayscale.

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try 'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRGetContrast Returns the amount of color contrast used for OCR. Use when debugging OCR statements to see the contrast used and determine if changes are needed to improve the accuracy of returned text. The contrast is set in the playback options or by the OCRSetContrast statement. See Troubleshooting OCR issues, page 186.

Syntax OCRGetContrast()

494 OCRGetLanguageFilePath

Return value

Value Description

Value Amount of color contrast applied to images before they are read using OCR. 0 indicates no between 0 contrast is applied and 100 indicates images are solid black. and 100

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try 'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRGetLanguageFilePath Returns the path to the language file used for OCR. Use when debugging OCR statements to see the language file used and determine if changes are needed to improve the accuracy of returned text. The language file is set in the playback options or by the OCRSetLanguageFilePath statement. See Troubleshooting OCR issues, page 186.

Syntax OCRGetLanguageFilePath()

495 OCRGetScale

Return value

Value Description

Value Full path to the language file used for OCR.

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try 'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRGetScale Returns the image scale used for OCR. Use when debugging OCR statements to see the scale used and determine if changes are needed to improve the accuracy of returned text. The scale is set in the playback options or by the OCRSetScale statement. See Troubleshooting OCR issues, page 186.

Syntax OCRGetScale()

Return value

Value Description

Value Number of times larger than the original size images are scaled before they are read using OCR. between For example, 1 indicates images are scaled to original size (100%) and 15 indicates images are 1 and 15 scaled 15 times the original size (1500%).

496 OCRGetText

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try 'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRGetText Returns text found using OCR in a specified region, window, or control. Use to convert graphical text in an application to text strings for use in other statements. See Using OCR to Work with Graphical Text, page 181.

Syntax OCRGetText(LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight)

Arguments

Argument Description

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the text to return. If not specified, all text in the window or control is returned. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the text to return. If not specified, all text in the window or control is returned. Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

497 OCRGetTextFromFile

Argument Description

RectangleWidth Optional integer pixel value of the width of the rectangle that contains the text to return. If not specified, all text in the window or control is returned. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified.

RectangleHeight Optional integer pixel value of the height of the rectangle that contains the text to verify. If not specified, all text in the window or control is returned. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified.

Return value

Value Description

Value Text found using OCR.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example 'Gets the password text HTML element and sets it in the Password field password = Window("WysiCorp Home").HTMLElement("elementLoginTester").OCRGetText(80, 31, 61, 17) Window("WysiCorp Home").EditBox("editboxPassword").SetText(password)

OCRGetTextFromFile Returns the text found using OCR in an image file. Use when debugging OCR statements. For example, if you use the SaveRegionToImageFile statement to make sure the correct region of an application is read using OCR, you can use this statement to check the text returned from the saved image and determine if changes are needed in the OCR playback options. See Troubleshooting OCR issues, page 186.

Syntax OCRGetTextFromFile("FilePath", LeftEdgePixel, RightEdgePixel, RectangleWidth, RectangleHeight)

Arguments

Argument Description

FilePath Full path to the image file to return text from. The following file types are supported: BMP, EXIF, GIF, JPG, PNG, and TIFF.

498 OCRGetTextPreviousStatement

Argument Description

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the text to return. If not specified, all text in the image is returned. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the text to return. If not specified, all text in the image is returned. Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

RectangleWidth Optional integer pixel value of the width of the rectangle that contains the text to return. If not specified, all text in the image is returned. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified.

RectangleHeight Optional integer pixel value of the height of the rectangle that contains the text to verify. If not specified, all text in the image is returned. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified.

Return value

Value Description

Value Text found in the file.

Example ocrText = OCRGetTextFromFile("C:\\OCRTests\\Images\\DebugPassword.png") PrintLn("Text in screenshot: " + ocrText)

OCRGetTextPreviousStatement

Note: This statement is deprecated. Use OCRGetText instead. See OCRGetText, page 497.

Returns the text found using OCR in the screenshot captured for the action performed in the previous statement.

Syntax OCRGetTextPreviousStatement(Region, LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight)

Arguments

Argument Description

Region OCR region to check. OCRWindowRelative uses the pixel locations relative to the window that last had an action performed in it. OCRControlRelative uses the pixel locations relative to the control that last had an action performed on it.

499 OCRIsConvertingToGrayscale

Argument Description

LeftEdgePixel Integer pixel value of the left side of the region that contains the text.

TopEdgePixel Integer pixel value of the top side of the region that contains the text.

RectangleWidth Integer pixel value of the width of the region that contains the text.

RectangleHeight Integer pixel value of the height of the region that contains the text.

Return value

Value Description

Value Text found using OCR.

Example ocrText = OCRGetTextPreviousStatement(OCRWindowRelative, 123, 175, 100, 100) PrintLn(ocrText)

OCRIsConvertingToGrayscale Returns True or False to indicate if images are converted to grayscale before they are read using OCR. Use when debugging OCR statements to see if grayscale conversion is used and determine if changes are needed to improve the accuracy of returned text. Grayscale conversion is set in the playback options or by the OCRConvertToGrayscale statement. See Troubleshooting OCR issues, page 186.

Syntax OCRIsConvertingToGrayscale()

Return value

Value Description

True Images are converted to grayscale.

False Images are not converted to grayscale.

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try

500 OCRSetContrast

'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRSetContrast Sets the amount of color contrast in an image before reading it using OCR. Use to override the default OCR contrast set in the playback options, which can help improve the accuracy of returned text. See Troubleshooting OCR issues, page 186.

Syntax OCRSetContrast(ContrastAmount)

Arguments

Argument Description

ContrastAmount Amount of color contrast to apply. Enter a value between 0 and 100. For example, 0 does not change the image contrast and 100 makes the image solid black.

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try

501 OCRSetLanguageFilePath

'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRSetLanguageFilePath Sets the path to the language file to use when reading an image using OCR. Use to override the default OCR language setting in the playback options, which may help improve the accuracy of returned text. See Troubleshooting OCR issues, page 186.

Note: QA Wizard Pro uses the Tesseract OCR engine. QA Wizard Pro includes the English language file (eng.traineddata). If you need to test other languages, download additional language files from Tesseract. Language files must be stored in a directory named tessdata.

Syntax OCRSetLanguageFilePath("FilePath")

Arguments

Argument Description

FilePath Full path to the language file.

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try

502 OCRSetScale

'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

OCRSetScale Sets the scale of an image before reading it using OCR. Use to override the default OCR scale set in the playback options, which may help improve the accuracy of returned text. See Troubleshooting OCR issues, page 186.

Syntax OCRSetScale(Scale)

Arguments

Argument Description

Scale Number of times larger than the original image size to increase the scale. Enter a value between 1 and 15. For example, 1 scales to original size (100%), 2 scales two times the original size (200%), and 15 scales 15 times the original size (1500%).

Example 'Saves default OCR settings lang = OCRGetLanguageFilePath() contrast = OCRGetContrast() imgScale = OCRGetScale() grayConversion = OCRIsConvertingToGrayscale() Try

503 On Error

'Changes OCR settings for the checkpoint OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata") OCRSetContrast(50) OCRSetScale(2) OCRConvertToGrayscale(True) 'Verifies text in the page footer Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect") Finally 'Resets default OCR settings OCRSetLanguageFilePath(lang) OCRSetContrast(contrast) OCRSetScale(imgScale) OCRConvertToGrayscale(grayConversion) End Try

On Error Sets the error handling behavior for a script, function, or subroutine. n On Error Resume Next continues playback even when an error occurs. The error is displayed in the Errors pane, run report, and status tool. n On Error Goto 0 stops playback when an error occurs, which is QA Wizard Pro's default error behavior. n On Error Resume Next can be added to scripts before an error occurs to set the error handling scope. Each On Error statement overrides the behavior specified by previous On Error statements in the same scope.

Syntax On Error Resume Next or On Error Goto 0

Example Function FunctionThatFails() On Error Resume Next Fail("ScriptFail") PrintLn("Playback continued") End Function FunctionThatFails() PrintLn("Script did not fail")

OpenRecordset Returns a recordset object opened from a datasheet. The value is generally assigned to a variable for use with database statements, such as GetRowValue, page 440.

504 OpenRecordsetQuery

Note: A primary key must be defined in the table if you want to add or update rows. If a primary key is not defined, QA Wizard Pro opens the table as read-only.

Syntax OpenRecordset("DatasheetName")

Arguments

Argument Description

DatasheetName Local or external datasheet to open. Must be in the current workspace.

Return value

Value Description

Value Recordset object opened from the datasheet.

Example bugs = OpenRecordset("WysiCorp Bugs") product = GetRowValue(bugs, "Product")

OpenRecordsetQuery Returns a recordset object from a data source linked to an external datasheet based on a SQL query. Commonly used to work with datasheets set to use a script-generated query. The returned value is generally assigned to a variable for use with database statements, such as GetRowValue, page 440.

Syntax OpenRecordsetQuery("DatasheetName", "SQLQuery")

Arguments

Argument Description

DatasheetName External datasheet name. Must be in the current workspace and linked to a data source.

SQLQuery SQL query to run.

Return value

Value Description

Value Recordset object opened from the linked external datasheet.

505 ParseString

Example customerSet = OpenRecordsetQuery("Customers", "SELECT * FROM Email") count = RecordsetRowCount(customerSet) PrintLn(count)

ParseString Returns an array of substrings from an original delimited string.

Syntax ParseString("OriginalString", "DelimiterCharacter")

Arguments

Argument Description

OriginalString Original text string to parse.

DelimiterCharacter Delimiter character that indicates where to parse the original string. A comma or semicolon is typically used, but any character is supported.

Return value

Value Description

Value Array of substrings from the parsed text string.

Example parsedString = ParseString("May 20, 2008", ",")

PerformXPathQuery Returns an array of results that matches an XPath query. You can use this statement to determine how many descendants a control has.

Note: Only use this advanced statement if you are familiar with XPath and understand how changing QA Wizard Pro search options can impact scripts. See About XPath queries, page 223.

Syntax PerformXPathQuery("XPathQuery")

Arguments

Argument Description

XPathQuery XPath query to perform.

506 Pop

Supported objects Browser, Window

Return value

Value Description

Value Array of results that match the XPath query.

Example Window("Report a Bug").PerformXPathQuery("html[1]/body[1]/table[2]/tbody[1]/tr[2]/td [7]/table[1]/tbody[1]/tr[1]/td[1]/table[1]/tbody[1]/tr[1]/td[1]/table [1]/descendant::table")

Pop

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the last value in a JSONArray and then removes it.

Syntax Pop()

Supported objects JSONArray

Return value

Value Description

Value Last value in the JSONArray.

Example jsonArray = JSONNewArray() ' Appends 1 and 2 to the end of the array jsonArray.Push(1) jsonArray.Push(2) ' Appends 3 to the end of the array jsonArray.SetValue(2, 3) ' Returns 3 and removes it from the array intVal = jsonArray.Pop() PrintLn("Last value removed from array: " & intVal)

507 PrevRow

PrevRow

Note: This statement is named Previous Recordset Row in the Add Statement dialog box.

Moves to the previous row in a recordset. If the recordset row index is at RecordsetBOF, the index does not change.

Syntax PrevRow(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Example rs = OpenRecordset("WysiCorp Bugs (Excel)") LastRow(rs) While Not RecordsetBOF(rs) PrintLn(GetRowValue(rs, "First Name")) PrevRow(rs) WEnd

Print Displays a message in the Output pane. This statement can help you monitor a script during playback. For example, use this statement to display values returned from functions. Messages displayed using this statement are also added to run reports. To print values on different lines, use the PrintLn, page 509 statement.

Note: Issues may occur when using this statement in load test scripts.

Syntax Print("Text")

Arguments

Argument Description

Text Text to print.

Example Print("QA Wizard Pro")

508 PrintLn

PrintLn

Note: This statement is named Print Line in the Add Statement dialog box.

Displays a message on a new line in the Output pane. For example, use this statement to display messages throughout script playback to view the actions that are performed on the application or return values captured from the application or a data source. Messages displayed using this statement are also added to run reports. To print values on the same line, use the Print, page 508 statement.

Note: Issues may occur when using this statement in load test scripts.

Syntax PrintLn("Text")

Arguments

Argument Description

Text Text to print.

Example PrintLn("New Line")

Property Returns a window or control property value. Use this statement instead of checkpoints when you want to continue running a script if the property value does not match an expected value or when you do not know the expected value until the script runs. You can also use this statement to verify values used in conditional statements.

Note: To return the value of a specified property in a PropertyMap, use the Property - PropertyMap, page 510 statement.

Syntax Property("PropertyName")

Arguments

Argument Description

PropertyName Name of the property to return the value from. You can view a list of all properties captured for the window or control when it was added to the application repository in the Properties dialog box. See Modifying window and control properties, page 122.

509 Property - PropertyMap

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Return value

Value Description

Value Window or control property value.

Example loginBtnProp = Window("Report a Bug").Button("Login").Property("Enabled")

Property - PropertyMap

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the value of a property in a PropertyMap or a default value if the property is not found. To create a PropertyMap for a window or control, use the GetPropertyMap, page 437 statement.

Syntax Property("PropertyName", DefaultReturnValue)

Arguments

Argument Description

PropertyName Property to return the value from.

DefaultReturnValue Value returned if the property is not found. If not specified, the default value is null.

Supported objects PropertyMap

Return value

Value Description

Value Property value from the PropertyMap.

Example propertyMap = Window("Window").Control("control1").GetPropertyMap() textVal = propertyMap.Property("Text")

510 Push

notSureValue = propertyMap.Property("PropertyMayNotExist", "Value is not found.")

Push

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Appends a value to the end of a JSONArray.

Syntax Push(Value)

Arguments

Argument Description

Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

Supported objects JSONArray

Example jsonArray = JSONNewArray() ' Appends 1 and 2 to end of array jsonArray.Push(1) jsonArray.Push(2)

Rand

Note: This statement is named Random in the Add Statement dialog box.

Returns a random number between two integers.

Syntax Rand(MinInteger, MaxInteger)

Arguments

Argument Description

MinInteger Inclusive lower bound of the random number returned. Must be between -2,147,483,648 and 2,147,483,647.

MaxInteger Exclusive upper bound of the random number returned. Must be between -2,147,483,648 and 2,147,483,647. Must be greater than or equal to the MinInteger value.

511 Range

Return value

Value Description

Value Random number between the two integers.

Example randomNumber = Rand(-100, 100)

Range

Note: This statement is named Select Range in the Add Statement dialog box.

Selects a range based on cursor position. For example, in the string 'The cow jumped over the moon', to select 'The cow', 1 is the starting number because it is the cursor position before the 'T' and 8 is the ending number because it is the cursor position after the 'w'.

Syntax Range(StartIndex, EndIndex)

Arguments

Argument Description

StartIndex Index of first character to select.

EndIndex Index of last character to select.

Supported objects ComboBox, EditBox, SpinBox

Example Window("CRMContact").EditBox("textBoxEmail").Range(1, 5)

ReadRegistryEntry Returns the value associated with a name in a registry key.

Syntax ReadRegistryEntry("FullKeyName", "ValueName")

512 ReadTextFile

Arguments

Argument Description

FullKeyName Full path to the registry key.

ValueName Name/value pair name in the key.

Return value

Value Description

Value Registry key value.

Example registryKeyValue = ReadRegistryEntry("HKEY_LOCAL_MACHINE", "Name")

ReadTextFile Reads a text file and returns the contents to a variable.

Syntax ReadTextFile("FilePath", Encoding)

Arguments

Argument Description

FilePath Full path to the file to read. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

Encoding File encoding constant. If not specified, EncodingAutoDetect is used. See Constants, page 600.

Return value

Value Description

Value File contents.

Example output = ReadTextFile("C:\\Testing\\Output.txt", EncodingAutoDetect) PrintLn("File content: " + output)

RecordsetBOF Returns True or False to indicate if the current recordset row index is before the beginning of the data.

513 RecordsetEOF

Syntax RecordsetBOF(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Return value

Value Description

True Current row index is before the beginning of the data.

False Current row index is after the beginning of the data.

Example rs = OpenRecordset("WysiCorp Bugs (Excel)") LastRow(rs) While Not RecordsetBOF(rs) PrintLn(GetRowValue(rs, "First Name")) PrevRow(rs) WEnd

RecordsetEOF Returns True or False to indicate if the current recordset row index is past the end of the data.

Syntax RecordsetEOF(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Return value

Value Description

True Current row is past the end of the data.

514 RecordsetRowCount

Value Description

False Current row is before the end of the data.

Example bugs = OpenRecordSet("Bug Reporter Bugs") If Not RecordsetEOF(bugs) Then summary = GetRowValue(bugs, "Summary") type = GetRowValue(bugs, "Type") Window("Bug Reporter Dialog").Editbox("editboxSummary").SetText(summary) Window("Bug Reporter Dialog").ComboBox("comboboxType").Item(type).Select() Else Fail("Error: The second record does not exist") End If

RecordsetRowCount Returns the total number of records in a recordset.

Syntax RecordsetRowCount(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

Return value

Value Description

Value Total number of records in the recordset.

Example customerSet = OpenRecordsetQuery("Customers", "SELECT * FROM Email") count = RecordsetRowCount(customerSet) PrintLn(count)

Refresh Refreshes the current page in a browser.

Syntax Refresh()

515 Rem

Supported objects Browser

Example Browser("Report a Bug").Refresh()

Rem

Note: This statement is named Comment in the Add Statement dialog box.

Adds a comment to a script. For example, add a comment at the beginning of a script to describe its purpose. You can also use an apostrophe (') to add comments.

Syntax Rem comment or 'comment

Example Rem This script logs in to the sample site Script.CallScript("WysiCorp Login") 'Logs in to sample site

RemoveAt

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Removes the value at an index in a JSONArray and returns True or False to indicate if it was successfully removed. The remaining values in the JSONArray move up one index.

Syntax RemoveAt(Index)

Arguments

Argument Description

Index Index to remove in the JSONArray. JSONArray indexes are zero based.

Supported objects JSONArray

516 RemoveField

Return value

Value Description

True Index was removed.

False Index was not removed.

Example jsonArray = JSONNewArray() ' Appends 1 and 2 to end of array jsonArray.Push(1) jsonArray.Push(2) ' Appends 3 to end of array jsonArray.SetValue(2, 3) ' Removes second entry in array and returns True boolVal = jsonArray.RemoveAt(1) PrintLn("Should be True: " & boolVal) ' Fails to remove 100th entry in array and returns False boolVal = jsonArray.RemoveAt(99) PrintLn("Should be False: " & boolVal)

RemoveField Removes a field value from a Helix ALM issue. You can use this statement to clear default field values set in an issue if the value does not apply to a specific condition that occurs when the script runs or if the field is no longer used. For example, if a custom field is set in the issue but the field is temporarily removed from Helix ALM, you can remove the field value when adding issues from scripts without changing the scripts in case the field is used again later.

Note: This statement cannot be used in load test scripts.

Syntax RemoveField(Issue, FieldIdentifier)

Arguments

Argument Description

Issue Issue object that contains the field. Use the NewIssue, page 490 statement to create the issue object.

517 RemoveProperty

Argument Description

FieldIdentifier Name of the field to remove the value from.

You can also use the field ID, which is available in the Helix ALM FLDDFNTN database table. You may want to use the ID if issue fields are frequently renamed in the Helix ALM project. Ask your Helix ALM administrator for help.

Example issue = NewIssue() ' Uses field name to set Summary field value SetFieldValue(issue, "Summary", "An issue occurred when exporting to XML") ' Uses field ID to remove Summary field value RemoveField(issue, 2)

You can also call this statement directly on a Helix ALM issue object. issue = NewIssue() ' Uses field name to set Summary field value issue.SetFieldValue("Summary", "An issue occurred when exporting to XML") ' Uses field ID to remove Summary field value issue.RemoveField(2)

RemoveProperty

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Removes a property from a JSONObject and returns True or False to indicate if it was successfully removed.

Syntax RemoveProperty("PropertyName")

Arguments

Argument Description

PropertyName Property to remove.

Supported objects JSONObject

518 Replace

Return value

Value Description

True Property was removed.

False Property was not removed.

Example jsonObject = JSONNewObject() ' Adds values to JSONObject jsonObject.SetValue("PropertyName1", 1) jsonObject.SetValue("PropertyName2", 2) ' Returns False boolVal = jsonObject.RemoveProperty("PropertyName3") PrintLn("Should be False: " & boolVal) ' Returns True boolVal = jsonObject.RemoveProperty("PropertyName1") PrintLn("Should be True: " & boolVal)

Replace Replaces text in a string and returns the resulting string.

Syntax Replace("String", "TextToReplace", "ReplacementText")

Arguments

Argument Description

String String that contains the text to replace.

TextToReplace Text to replace in the string.

ReplacementText Replacement text.

Return value

Value Description

Value Resulting string.

Example textReplace = Replace("WysiWrite updates are now available.", "Write", "Draw")

519 ResetStopwatch

ResetStopwatch Resets the elapsed stopwatch time to zero. To restart the stopwatch, use the StartStopwatch, page 555 statement. To stop the stopwatch, use the StopStopwatch, page 556.

Syntax ResetStopwatch()

Example StartStopwatch() Window("Report a Bug").EditBox("editboxUsername").SetText("Guest") Window("Report a Bug").EditBox("editboxPassword").SetText("SoloBug") Window("Report a Bug").Button("buttonLogin").Click() StopStopwatch() elapsedTime = GetStopwatchElapsedTime() PrintLn("Login time: " + elapsedTime) ResetStopwatch()

Resize Resizes a window.

Syntax Resize(NewWidth, NewHeight)

Arguments

Argument Description

NewWidth Width in pixels to resize the window to.

NewHeight Height in pixels to resize the window to.

Supported objects Browser, Window

Example Browser().Resize(800, 600)

Restore Restores a window to its default size and location. Performs the same action as clicking the Restore button in the application title bar.

520 Right

Syntax Restore()

Supported objects Browser, Window

Example Browser().Restore()

Right Returns a number of characters from the end of a string.

Syntax Right("String", NumberOfCharacters)

Arguments

Argument Description

String String to return characters from.

NumberOfCharacters Number of characters to return.

Return value

Value Description

Value Characters from the end of the string.

Example rightString = Right("QAWPString", 6)

RMouseClick

Note: This statement is named Right Mouse Click in the Add Statement dialog box.

Clicks the right mouse button in a location.

Syntax RMouseClick(xCoordinate, yCoordinate, WaitTime)

521 RMouseDoubleClick

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Report a Bug").HTMLLink("SoloSubmitLogo").RMouseClick(250, 200, 5000)

RMouseDoubleClick

Note: This statement is named Right Mouse Double-Click in the Add Statement dialog box.

Double-clicks the right mouse button in a location.

Syntax RMouseDoubleClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

522 RMouseDown

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Browser("Report a Bug").Button("Cancel").RMouseDoubleClick(250, 225, 15000)

RMouseDown

Note: This statement is named Right Mouse Down in the Add Statement dialog box.

Presses the right mouse button in a location. This statement is followed by RMouseUp, page 523.

Syntax RMouseDown(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Browser("Report a Bug").Button("Back").RMouseDown(15, 15, 0)

RMouseUp

Note: This statement is named Right Mouse Up in the Add Statement dialog box.

523 RunBackgroundCommand

Releases the right mouse button in a location. This statement is preceded by RMouseDown, page 523.

Syntax RMouseUp(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where the mouse button is pressed relative to the window or control. If a window or control is not specified, the coordinate is relative to the screen and must be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing the mouse button.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Browser("Report a Bug").Button("Back").RMouseUp(15, 15, 100)

RunBackgroundCommand Runs a command from the Windows command prompt on the test computer as playback continues. For example, use this statement to start a server component before actions are performed in a client application. To pause playback until the command finishes, use the RunCommand, page 525 statement.

Note: Issues may occur when using this statement in load test scripts.

Syntax RunBackgroundCommand("ExecutablePath", "WorkingDirectory", "CommandLineArguments")

Arguments

Argument Description

ExecutablePath Full path to the executable, batch file, or command file to run in the background.

524 RunCommand

Argument Description

WorkingDirectory Full path to the executable working directory.

CommandLineArguments Arguments to include in the command line call.

Example RunBackgroundCommand("C:\\Program Dir\\SQL Server\\SQLServer.exe", "C:\\Program Dir\\SQL Server\\", "-c -f")

RunCommand Runs a command from the Windows command prompt on the test computer and returns the exit code when it finishes. The command finishes before playback continues. For example, use this statement to run a batch file that sets environment variables on the test computer before the test application starts. To continue playback while the command runs, use the RunBackgroundCommand, page 524 statement.

Note: Issues may occur when using this statement in load test scripts.

Syntax RunCommand("ExecutablePath", "WorkingDirectory", "CommandLineArguments")

Arguments

Argument Description

ExecutablePath Full path to the executable, batch file, or command file to run in the background.

WorkingDirectory Full path to the executable working directory.

CommandLineArguments Arguments to include in the command line call.

Return value

Value Description

Value Exit code from the command.

Example exitCode = RunCommand("C:\\Windows\\regedit.exe", "C:\\Windows", "/s"", C:\\RegistryUtils\\ExportedKey.reg") PrintLn("Registry utility exit code: " + exitCode)

525 RunScriptRemote

RunScriptRemote Runs a script on a remote computer. QA Wizard Pro must be installed and QAWRemote.exe must be running on the remote computer. See Configuring remote computers, page 249 and Starting QAWRemote.exe, page 250. The remote computer must also have access to the application in the global or local application repository. If a data source is associated with the script or specified in this statement, the script runs once for each row in the datasheet.

Note: Issues may occur when using this statement in load test scripts.

Syntax RunScriptRemote("ComputerIP", PortNumber, "ScriptName", "DatasheetName")

Arguments

Argument Description

ComputerIP Remote computer hostname or IP address.

PortNumber QAWRemote.exe port number for the remote computer. Default is 6001.

ScriptName Script name to run.

DatasheetName Optional datasheet to use as the data source for the script.

Example RunScriptRemote("remote.wysicorp.com", 6001, "WysiCorp Login", "TestUsernames")

RunSQLCommand Runs a SQL command on a data source linked to an external datasheet and returns the number of rows the command is performed on. You can use the return value with other statements to validate the number of records affected by the command.

Syntax RunSQLCommand("DatasheetName", "SQLCommand", FailureBehavior)

Arguments

Argument Description

DatasheetName External datasheet name. Must be in the current workspace and linked to a data source.

SQLCommand SQL command to run.

526 SaveRegionToImageFile

Argument Description

FailureBehavior Failure behavior. True stops the script if the command fails. False displays a warning and continues playback.

Return value

Value Description

Value Number of rows updated, inserted, or deleted in the data source.

0 Command other than UPDATE, INSERT, or DELETE ran against an Excel, Access, or text file data source.

-1 Command other than UPDATE, INSERT, or DELETE ran against an Oracle or SQL Server data source.

Null Command failed.

Example rowsAffected = RunSQLCommand("CustomerRecordsDatasheet", "UPDATE CustomerRecords SET Purchased=True WHERE FirstName='John' AND LastName='Smith'", True) PrintLn("Rows updated: " + rowsAffected)

SaveRegionToImageFile Saves a region relative to a window, control, or the test computer screen as a PNG file. Use when debugging OCR statements. For example, if you use the OCRGetText statement to get text from a web page and then set the returned text in the Username editbox, you can use this statement to save an image of the specified area the text was returned from. If log in fails, you can use the saved image to help determine if the correct Username value was entered. See Using OCR to Work with Graphical Text, page 181.

Syntax SaveRegionToImageFile("FilePath", LeftEdgePixel, RightEdgePixel, RectangleWidth, RectangleHeight)

Arguments

Argument Description

FilePath Full path including filename to save the image in. If the path does not include a .png extension, it is added when saving the image. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

527 Script.CallScript

Argument Description

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the region to save. If not specified, an image of the entire window, control, or test computer screen is saved. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the region to save. If not specified, an image of the entire window, control, or test computer screen is saved. Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

RectangleWidth Optional integer pixel value of the width of the rectangle that contains the region to save. If not specified, an image of the entire window, control, or test computer screen is saved. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified.

RectangleHeight Optional integer pixel value of the height of the rectangle that contains the text to verify. If not specified, an image of the entire window, control, or test computer screen is saved. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example If (Not Window("WysiCorp Report a Bug").EditBox("editboxSummary").WaitForExists(1000)) Then Script.CloseApp() Script.RunApp() 'Saves an image of the region OCR was performed on for debugging purposes Window("WysiCorp Home").HTMLElement("elementLoginTester").SaveRegionToImageFile ("C:\\OCRTests\\Images\\DebugPassword.png", 80, 31, 61, 17) End If

Script.CallScript Runs another script in the workspace and optionally sets the data source for the called script. After the called script runs, playback continues in the calling script. See Calling scripts from other scripts, page 151.

Syntax CallScript("ScriptName", "DatasheetName")

528 Script.ClearContext

Arguments

Argument Description

ScriptName Script name to call. Must be in the same workspace.

DatasheetName Optional datasheet to use as the data source for the called script.

Data sources are ignored unless you specify a datasheet for the called script in this statement. If a datasheet is specified, the called script runs once for each row in it. If a datasheet is not specified, the called script only runs once, but has access to the variables and data source associated with the calling script and any statements declared before the Script.CallScript statement.

Supported objects Script

Example Script.CallScript("MenuChecks")

Script.ClearContext Terminates the existing connection to an application in the application repository so a new connection can be established by the Script.SetContext, page 534 statement. Use when a script needs to access more than one application or running process during playback. To terminate a connection in a load test script, use the Script.ClearLoadTestContext, page 529 statement.

Syntax ClearContext()

Supported objects Script

Example Script.ClearContext()

Script.ClearLoadTestContext

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Terminates the existing connection to an application in the application repository when running a load test.

Syntax ClearLoadTestContext()

529 Script.CloseApp

Supported objects Script

Example Script.ClearLoadTestContext()

Script.CloseApp

Note: This statement is named Script Close Application in the Add Statement dialog box.

Closes all applications QA Wizard Pro is currently connected to.

Syntax CloseApp()

Supported objects Script

Example Window("Feedback Acknowledgment").Button("buttonSend").Click() Script.CloseApp()

Script.ConnectToProcess Connects to an application running on the test computer. Use this statement to connect to an application without starting it from the script or for testing applications that run in the background, such as a Windows service.

Note: When the script runs, the process identified in the ConnectToProcess statement must be running on the test computer or the script will fail.

This statement must be preceded by the Script.SetContext, page 534 statement so QA Wizard Pro knows which version in the application repository the process is related to. If you record additional steps in an existing script, new controls are automatically added to the application specified in the SetContext statement. When you record a script against a running process, this statement is automatically added to the script after the SetContext statement. You can also manually add it.

Note: This statement is not supported in scripts that test Windows 8 applications. Use the Script.RunApp, page 532 statement to start a Windows 8 application or make it the active window.

Syntax ConnectToProcess("ProcessName")

530 Script.GetContext

Arguments

Argument Description

ProcessName Executable process to connect to. If you do not know the process name, add this statement from the Add Statement dialog box to select the running process. You can also view running process names and descriptions on the Processes tab in Windows Task Manager. See the Windows help for information.

Supported objects Script

Example Script.SetContext("Notepad/5.1") Script.ConnectToProcess("notepad.exe")

Script.GetContext Returns the application name and version number the script is running against. The information is retrieved from the application repository. To return the application and version a load test script is running against, use the Script.GetLoadTestContext, page 532 statement.

Syntax Script.GetContext()

Supported objects Script

Return value

Value Description

Value Application name and version number the script is running against.

Example context = Script.GetContext() PrintLn("Application/version: " + context)

Script.GetLineNumber Returns the current line number from the script.

Syntax GetLineNumber()

531 Script.GetLoadTestContext

Supported objects Script

Return value

Value Description

Value Current script line number.

Example scriptLine = Script.GetLineNumber() PrintLn("Script line #:" + scriptLine)

Script.GetLoadTestContext

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns the application name and version number the load test is running against. The information is retrieved from the application repository.

Syntax Script.GetContext()

Supported objects Script

Return value

Value Description

Value Application name and version number the load test is running against.

Example context = Script.GetLoadTestContext() PrintLn("Web site/version: " + context)

Script.RunApp

Note: This statement is named Script Run Application in the Add Statement dialog box.

Starts the application to use during playback. Automatically added to scripts during recording, but you can also manually add it. Must be preceded by the Script.SetContext, page 534 statement, which specifies the version to use in the application repository.

532 Script.SetBrowser

To close and restart the same application and version during playback, use the Script.CloseApp statement and then another Script.RunApp statement.

Note: If a script needs to run more than one application, you must use the Script.ClearContext, page 529 statement to clear the existing repository connection and then add Script.SetContext, page 534 and Script.RunApp statements to run the new application.

Syntax RunApp()

Supported objects Script

Example Script.SetContext("WysiCorp Login/1.0") Script.RunApp()

Script.SetBrowser Sets the browser used to run the script. Use this statement to specify a browser for a script without changing the default browser setting. This statement must be preceded by the Script.SetContext, page 534 statement and followed by the Script.RunApp, page 532 statement.

Note: After a browser type is set, the script always uses that browser. To change the browser in the same script, use another SetBrowser statement.

Syntax SetBrowser(BrowserType)

Arguments

Argument Description

BrowserType Browser type to use to run the script: BrowserTypeChrome, BrowserTypeFirefox, or BrowserTypeIE.

Supported objects Script

Example Script.SetContext("WysiCorp Login/1.0") Script.SetBrowser(BrowserTypeFirefox) Script.RunApp()

533 Script.SetContext

Script.SetContext Establishes a connection to the application repository to retrieve the following information: n Executable to run or URL to access during playback, including additional information such as command line arguments. n Version in the repository to use when comparing controls to the application and performing actions during playback. The statement is typically followed by a Script.RunApp, page 532 or Script.ConnectToProcess, page 530 statement unless the script is called by another script. If the SetContext statement is deleted, the application cannot run and the script fails.

Note: If a script needs to run more than one application or connect to additional running processes, you must use the Script.ClearContext, page 529 statement to terminate the existing connection. You also need to add another SetContext statement to the script to establish a new connection to the repository.

To establish a connection in a load test script, use the Script.SetLoadTestContext, page 534 statement.

Syntax SetContext("Application/Version")

Arguments

Argument Description

Application/Version Application name and version number to use in the application repository, separated with a forward slash.

Note: If the application has the same name in the local and global repository, QA Wizard Pro uses the application in the local repository by default. To change the repository used during playback, add 'Global:' before the application name.

Supported objects Script

Example Script.SetContext("WysiCorp Login/1.0") Script.RunApp()

Script.SetLoadTestContext

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Establishes a connection to the application repository to retrieve the following information for running load tests:

534 ScriptName

n URL to access, including additional information such as the %URLROOT% repository variable. n Version in the repository to use. All repository variables are set to their default values. Any repository variables that prompt users for a value are assigned the default value. Use the Assignment, page 358 statement to assign a different value to these variables.

Syntax SetLoadTestContext("Application/Version")

Arguments

Argument Description

Application/Version Application name and version number to use in the application repository, separated with a forward slash.

Note: If the application has the same name in the local and global repository, QA Wizard Pro uses the application in the local repository by default. To change the repository used during playback, add 'Global:' before the application name.

Supported objects Script

Example Script.SetLoadTestContext("WysiCorp/1.0")

ScriptName Returns the name of the running script.

Syntax ScriptName()

Return value

Value Description

Value Script name.

Example PrintLn("Script name: " + ScriptName())

Second Returns the seconds from a date/time value.

535 Select...Case

Syntax Second("DateTime")

Arguments

Argument Description

DateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Seconds from the date/time value.

Example secValue = Second("05/01/2016 14:57:32.8")

Select...Case Performs one of several blocks of statements for a condition with more than two outcomes. Compares the result of an expression against values in one or more Case statements. Statements in a Case block are only performed if the result of the expression matches the result of the expression in the Select...Case statement. If there is not a match, you can use a Case Else statement to run alternate statements. See Case, page 361.

Note: Case statements cannot have multiple delimited values. Define only one value per Case statement.

Syntax Select Case TestExpression [Case Expression [Statements-n]]... [Case Else Expression [ElseStatements-n]] End Select

Arguments

Argument Description

TestExpression Numeric or string expression. For example, a > b, a < b, a = b, or a <> b.

Expression Numeric or string expression.

Statements-n One or more statements to run if TestExpression matches any part of Expression.

536 Select

Argument Description

ElseStatements- One or more statements to run if TestExpression does not match any of the Case n statements.

Note: The Case statement is separate from Select...Case in the Add Statement dialog box.

Example SRand() random = Rand(1, 5) Select Case random Case 1 PrintLn("1 is the random number") Case 2 PrintLn("Random number is 2") Case 3 PrintLn("Number 3 was randomly generated") Case 4 PrintLn("Random value = 4") Case Else PrintLn("Number 5 was chosen") End Select

Select

Note: This statement is named Select Item in the Add Statement dialog box.

Selects an item in a control.

Syntax Select("Item")

Argument

Argument Description

Item Item to select.

Supported objects Cell, ComboBox, Grid, Item, ListBox, ListView, Menu, PopupMenu, Row, Tab, TabBar, ToolBar, Tree

Example Window("WysiCorp CRM").Menu("MenuBar").Item("File/Switch Project...").Select()

537 SelectRow

SelectRow

Note: This statement is named Select Grid Row in the Add Statement dialog box.

Selects a row in a grid control by index number.

Syntax SelectRow(RowIndex)

Arguments

Argument Description

RowIndex Table row index number. To select more than one row, enter multiple row indexes separated with commas.

Supported objects Grid

Example Window("WysiCorp CRM").Grid("accountsDataGridView").SelectRow(3, 4, 5)

SelectTab Selects a tab in a browser.

Syntax SelectTab("TabText")

Arguments

Argument Description

TabText Tab name.

Supported objects Browser

Example Browser().SelectTab("Contact")

Set

Note: This statement is named Set Check Box in the Add Statement dialog box.

538 SetAllFilesReadOnly

Selects a check box control.

Syntax Set()

Supported objects CheckBox

Example Window("WysiCorp CRM").CheckBox("checkBoxMac").Set()

SetAllFilesReadOnly Sets or clears the read-only attribute on all files in a directory. Use to allow or prevent scripts from modifying files in the specified directory.

Syntax SetAllFilesReadOnly("DirectoryPath", True/False, Recursive)

Arguments

Argument Description

DirectoryPath Full path to the directory. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

True/False True sets the read-only attribute on all files in the directory. False clears the read-only attribute to make files writable.

Recursive Recursive attribute change. True changes the read-only attribute on all files in all subdirectories. False changes only the read-only attribute on files in the specified directory. If not specified, False is used.

Example 'User-defined subroutine that deletes directories and all files in them Sub SafeDelete(dirPath) SetAllFilesReadOnly(dirPath, False, True) 'Makes all read-only files and subdirectories writable DeleteDirectory(dirPath, True) End Sub SafeDelete("C:\\Testing") SafeDelete("C:\\TempOutput")

SetCell Sets the column value in the current row of the script data source.

539 SetControlSearchTimeout

Syntax SetCell("ColumnName", NewValue)

Arguments

Argument Description

ColumnName Column name to set the value in.

NewValue Value to set in the cell.

Example SetCell("First Name", "John")

SetControlSearchTimeout Sets the maximum time to wait for QA Wizard Pro to find a window or control in the application. If the time is reached, playback stops and an error is displayed. The default value is 15,000 milliseconds.

Note: This statement overrides the default control search timeout set in the Options dialog box. See Setting playback options, page 76.

Syntax SetControlSearchTimeout(Timeout)

Arguments

Argument Description

Timeout Number of milliseconds before the window or control search times out.

Example SetControlSearchTimeout(90000)

SetDate Sets the date in a calendar or date/time picker control.

Tip: You can use a date/time statement, such as Today, to return a date value. See Date/time statements, page 327.

Syntax SetDate("Date")

540 SetDateRange

Arguments

Argument Description

Date Date to set. Use the date format defined in the system regional settings (e.g., MM/DD/YYYY).

Supported objects Calendar, DateTimePicker

Example Window("CRMAdd Note").DateTimePicker("dateOfEventPicker").SetDate("5/19/2016")

SetDateRange Sets a date range in a calendar control.

Tip: You can use a date/time statement, such as Today, to return a date value. See Date/time statements, page 327.

Syntax SetDateRange("StartDate", "EndDate")

Arguments

Argument Description

StartDate Start date. Use the date format defined in the system regional settings (e.g., MM/DD/YYYY).

EndDate End date. Use the date format defined in the system regional settings (e.g., MM/DD/YYYY).

Supported objects Calendar

Example Window("WysiCorp CRM").Calendar("monthCalendar").SetDateRange("5/20/2016", "5/27/2016")

SetDateTime Sets the date and time in a date/time picker control.

Tip: You can use a date/time statement, such as Today, to return a date value. See Date/time statements, page 327.

541 SetDiagnostics

Syntax SetDateTime("DateTime")

Arguments

Argument Description

DateTime Date and time. Use the date/time format defined in the system regional settings (e.g., MM/DD/YYYY hh:mm:ss AM/PM).

Supported objects DateTimePicker

Example Window("Add Note").DateTimePicker("dateEventPicker").SetDateTime("5/18/2016 4:42:35 PM")

SetDiagnostics Enables or disables playback diagnostic information logging to help with troubleshooting if QA Wizard Pro cannot identify a control. Diagnostics provide insight into how controls are identified by displaying window and control property values. Information is logged in a temporary file in the Temp\QA Wizard Pro Playback directory.

Note: Logging playback diagnostic information slows playback. Only use this statement when troubleshooting scripts.

Syntax SetDiagnostics(True/False)

Arguments

Argument Description

True/False True enables diagnostic logging and False disables it.

Example SetDiagnostics(True) Script.SetContext("WysiCorp Login/1.0") Script.RunApp()

SetFieldValue Sets the value of a Helix ALM issue field.

Note: This statement cannot be used in load test scripts.

542 SetFileReadOnly

Syntax SetFieldValue(Issue, FieldIdentifier, FieldValue)

Arguments

Argument Description

Issue Issue object that contains the field. Use the NewIssue, page 490 statement to create the issue object.

FieldIdentifier Field name to set the value for.

You can also use the field ID, which is available in the Helix ALM FLDDFNTN database table. You may want to use the ID if issue fields are frequently renamed in the Helix ALM project. Ask your Helix ALM administrator for help.

FieldValue Value to set in the field. If you specify a value for a list field that is not in the corresponding value list, the field is set to when the issue is added.

Example issue = NewIssue() ' Uses field name to set Summary field value SetFieldValue(issue, "Summary", "An issue occurred when exporting to XML") ' Uses field ID to set Description field value SetFieldValue(issue, 54, "When the XML export dialog opened, the application stopped responding.")

You can also call this statement directly on a Helix ALM issue object. issue = NewIssue() ' Uses field name to set Summary field value issue.SetFieldValue("Summary", "An issue occurred when exporting to XML") ' Uses field ID to set Description field value issue.SetFieldValue(54, "When the XML export dialog opened, the application stopped responding.")

SetFileReadOnly Sets or clears the read-only attribute on a file. Use to allow or prevent scripts from modifying a file.

Syntax SetFileReadOnly("FilePath", True/False)

543 SetDotNETProperty

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 for information about configuring full paths relative to the workspace or script directory.

True/False True sets the read-only attribute on the file. False clears the read-only attribute to make the file writable.

Example 'User-defined subroutine that deletes files Sub SafeDelete(filePath) SetFileReadOnly(filePath, False) 'Makes read-only files writable DeleteFile(filePath) End Sub SafeDelete("C:\\Testing\\TestResults.txt") SafeDelete("C:\\Testing\\TestScreenshot.png")

SetDotNETProperty

Note: This statement is named Set .NET Property in the Add Statement dialog box.

Sets the value of a .NET property. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax SetDotNETProperty("PropertyName", Value, Parameters...)

Arguments

Argument Description

PropertyName .NET property.

Value Value to set.

Parameters Optional parameters to pass to the property, separated with commas.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

544 SetDotNETPropertyWithArgs

Example Window("WysiCorp CRM").Grid("accountsDataGridView").SetDotNETProperty("Name", "accountsGrid")

SetDotNETPropertyWithArgs

Note: This statement is named Set .NET Property with Arguments in the Add Statement dialog box.

Sets the value of a .NET property with parameters in an array. Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

Syntax SetDotNETPropertyWithArgs("PropertyName", Value, ArrayOfParameters)

Arguments

Argument Description

PropertyName .NET property.

Value Value to set.

ArrayOfParameters Array that holds parameters to pass to the .NET property.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Dim array(2) array(1) = "ColumnName" array(2) = 10 'row index Window(".NET Window").Grid("CustomGrid").SetDotNETPropertyWithArgs("CellValue", array)

SetLowLevelSpeed Sets the playback speed of low-level mouse actions. During playback, ow-level actions, which are recorded when QA Wizard Pro does not recognize a control, can run at the recording speed or maximum speed (no delay between steps). For example, you can run low-level actions at the maximum speed if the script has several mouse move statements and the playback speed set for other actions is too slow to perform the low-level actions.

545 SetPlaybackDelay

Note: This statement overrides the default low-level action playback speed set in the Options dialog box. See Setting playback options, page 76.

Syntax SetLowLevelSpeed(Speed)

Arguments

Argument Description

Speed Playback speed in milliseconds. Use defaultspeed to run low-level actions at the recording speed or maximumspeed to run actions at the maximum speed.

Example SetLowLevelSpeed(maximumspeed)

SetPlaybackDelay Sets the number of milliseconds to wait between statements during playback. Use this statement to adjust the playback speed if the default speed is too fast or slow.

Syntax SetPlaybackDelay(Delay)

Arguments

Argument Description

Delay Number of milliseconds to wait between each statement.

Example SetPlaybackDelay(10000)

SetPlaybackSessionName Sets the name for the playback session sent to the QA Wizard Pro Server. Overwrites the previously set name if used multiple times during a session.

Note: You must enable sending playback data to store sessions on the server. See Setting server connection options, page 43.

Syntax SetPlaybackSessionName(Name)

546 SetRowValue

Arguments

Argument Description

Name Playback session name.

Example SetPlaybackSessionName("Weekly Regression Test") Script.CallScript("Setup")

SetRowValue

Note: This statement is named Set Recordset Row Value in the Add Statement dialog box.

Sets a field value in a recordset or data row. This statement is also used by the CommitRecordsetRow, page 370 statement.

Syntax SetRowValue(Recordset/DataRow, "ColumnName", "Value")

Arguments

Argument Description

Recordset/DataRow Recordset or data row name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery, page 505.

ColumnName Column name to add the value to.

Value Value to set.

Example bugs = OpenRecordset("WysiCorp Bugs") lastName = SetRowValue(bugs, "Last Name", "Jones")

SetScriptVariable Sets the value of a variable defined in a called script.

Syntax SetScriptVariable("ScriptName", "VariableName", NewValue)

547 SetText

Arguments

Argument Description

ScriptName Name of the called script that contains the variable.

VariableName Variable name in the called script.

NewValue Variable value to set.

Example SetScriptVariable("WysiCorp Login", "LoginPswd", "qapswd")

SetText Enters a value in a control and replaces existing text. To enter text at the current cursor position, use the TypeText, page 566 statement.

Syntax SetText("Text")

Arguments

Argument Description

Text Text to enter. Null values must be converted to empty strings to clear the text in the control.

Supported objects ComboBox, EditBox, SpinBox

Example Window("CRMLogin").EditBox("textBoxPassword").SetText("sales")

SetTime Sets the time in a date/time picker control.

Tip: You can use a date/time statement, such as Today, to return a date value. See Date/time statements, page 327.

Syntax SetTime("Time")

548 SetValue

Arguments

Argument Description

Time Time to set. Use the format defined in system regional settings (e.g., HH:MM:SS).

Supported objects DateTimePicker

Example Window("Add Note").DateTimePicker("dateEventPicker").SetTime("2:31:32 PM")

SetValue Sets a value on a slider or spin box control.

Note: To set values in JSONArrays and JSONObjects, see SetValue - JSONArray, page 549 and SetValue - JSONObject, page 550.

Syntax SetValue("Value")

Arguments

Argument Description

Value Value to set. Null values must be converted to empty strings before used.

Supported objects Slider, SpinBox

Example Window("WysiCorp CRM").SpinBox("numericUpDownPrice").SetValue(99)

SetValue - JSONArray

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Sets or adds a value to an index in a JSONArray.

Syntax SetValue(Index, "Value")

549 SetValue - JSONObject

Arguments

Argument Description

Index Index in the JSONArray. Indexes are zero based. If the index is greater than the size of the array, the value is added to the end of the array.

Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

Supported objects JSONArray

Example jsonArray = JSONNewArray() ' Sets first index in JSONArray to -1 jsonArray.SetValue(0, -1)

SetValue - JSONObject

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Sets or adds a value to a property name in a JSONObject.

Syntax SetValue("PropertyName", "Value")

Arguments

Argument Description

PropertyName Property in the JSONObject. If the property name is not found, a new property is created.

Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONObject.

Supported objects JSONObject

Example jsonObject = JSONNewObject() jsonObject.SetValue("PropertyName1", 1)

550 SimulateDriveReadOnly

SimulateDriveReadOnly Simulates a read-only drive.

Note: This statement cannot be used to make read-only drives writable, such as CD-ROM drives.

Syntax SimulateDriveReadOnly(DriveLetter, DriveModeReadOnlyOn)

Arguments

Argument Description

DriveLetter Drive letter for the read-only drive.

DriveModeReadOnlyOn True enables read-only drive simulation and False disables it.

Example SimulateDriveReadOnly("C", True) Window("WysiCorp CRM").Menu("MenuBar").Select("File/Save") Window("Error").CheckExists() SimulateDriveReadOnly("C", False)

SimulateDriveRemainingSpace Simulates a drive with remaining free space. The amount of remaining space cannot be more than the available drive space. For example, if you are testing an application that deletes temporary files to free up space, you can simulate a drive that does not have enough free space to save files. When the application deletes the files, more space is available on the simulated drive and new files can be saved to it.

Note: Any actions performed on files outside the target application, such as a user manually deleting files, are not included while drive simulation is active.

Syntax SimulateDriveRemainingSpace(DriveLetter, MegabytesRemaining)

Arguments

Argument Description

DriveLetter Drive letter for the simulated drive.

MegabytesRemaining Number of available megabytes on the drive. Use floating point values for fractions or SimulationOff to turn off the simulation.

551 SimulateMemoryPerAllocationLimit

Example SimulateDriveRemainingSpace("C", 0) Window("WysiCorp CRM").Menu("MenuBar").Select("File/Save") Window("Error").Button("OK").Click() SimulateDriveReadOnly("C", SimulationOff)

SimulateMemoryPerAllocationLimit Simulates the maximum amount of memory available to the application for each allocation attempt.

Note: This statement simulates physical memory at the operating system level and may cause runtime environments, such as .NET Framework, to behave unexpectedly.

Syntax SimulateMemoryPerAllocationLimit(MaxMegabytesPerAllocation)

Arguments

Argument Description

MaxMegabytesPerAllocation Maximum number of megabytes allowed per allocation. Use floating point values for fractions or SimulationOff to turn off the simulation.

Example SimulateMemoryPerAllocationLimit(0.1) Window("WysiCorp CRM").Menu("MenuBar").Select("File/Open") Window("Open File").Combobox("FileName").SetText("LargeFile.DAT") Window("Open File").Button("Open").Click() Window("Error: out of memory").CheckExists() SimulateMemoryPerAllocationLimit(SimulationOff)

SimulateMemoryRemainingSpace Simulates memory with an amount of remaining free space.

Note: This statement simulates physical memory at the operating system level and may cause runtime environments, such as .NET Framework, to behave unexpectedly.

Syntax SimulateMemoryRemainingSpace(MegabytesRemaining)

552 Sin

Arguments

Argument Description

MegabytesRemaining Number of megabytes allocated in physical memory by the application. Use floating point values for fractions or SimulationOff to turn off the simulation.

Example Window("WysiCorp CRM").Menu("MenuBar").Select("File/Open") Window("Open File").Combobox("FileName").SetText("LargeFile.DAT") SimulateMemoryRemainingSpace(1) Window("Open File").Button("Open").Click() Window("Error: out of memory").CheckExists() SimulateMemoryRemainingSpace(SimulationOff) Window("Error: out of memory").Button("OK").Click() Window("Open File").Button("Open").Click()

Sin

Note: This statement is named Sine in the Add Statement dialog box.

Returns the sine of a number.

Syntax Sin(Number)

Arguments

Argument Description

Number Number to return the sine for. To convert degrees to radians, multiply by pi/180. To convert radians to degrees, multiply by 180/pi.

Return value

Value Description

Value Sine of the number.

Example sine = Sin(45)

553 Size

Size

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the number of properties in a PropertyMap. To create a PropertyMap for a window or control, use the GetPropertyMap, page 437 statement.

Syntax Size()

Supported objects PropertyMap

Return value

Value Description

Value Number of properties in the PropertyMap.

Example propertyMap = Window("Window").Control("control1").GetPropertyMap() numProperties = propertyMap.Size()

SRand

Note: This statement is named Seed Random in the Add Statement dialog box.

Sets the random number generator seed, or starting point, for random integers. Use with Rand, page 511.

Syntax SRand()

Example SRand() random = Rand(1, 5) Select Case random Case 1 PrintLn("1 is random number") Case 2 PrintLn("Random number is 2") Case 3 PrintLn("Number 3 was randomly generated") Case 4 PrintLn("Random value = 4")

554 StartStopwatch

Case Else PrintLn("Number 5 was chosen") End Select

StartStopwatch Starts or restarts the stopwatch to measure elapsed time. To stop the stopwatch, use the StopStopwatch, page 556 statement. To reset the stopwatch to zero, use the ResetStopwatch, page 520 statement.

Syntax StartStopwatch()

Example StartStopwatch() Window("Report a Bug").EditBox("editboxUsername").SetText("Guest") Window("Report a Bug").EditBox("editboxPassword").SetText("SoloBug") Window("Report a Bug").Button("buttonLogin").Click() StopStopwatch() elapsedTime = GetStopwatchElapsedTime() PrintLn("Login time: " + elapsedTime) ResetStopwatch()

StartsWithSubStr

Note: This statement is named Starts with Substring in the Add Statement dialog box.

Returns True or False to indicate if a string starts with a substring.

Syntax StartsWithSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

IsCaseSensitive Case sensitive search. True matches the substring case. False ignores the case. If not specified, True is used.

555 Stop

Return value

Value Description

True String starts with the substring.

False String does not start with the substring.

Example productName = Window("Bug Reporter").HTMLElement("elementProductName").Property("Inner Text") CheckpointExpression(StartsWithSubStr(productName, "WysiCorp", True), True, "Product name does not start with WysiCorp")

Stop Stops loading the current page in a browser.

Syntax Stop()

Supported objects Browser

Example Browser("Feedback Acknowledgment").Stop()

StopStopwatch Stops the stopwatch without resetting it. To restart the stopwatch, use the StartStopwatch, page 555 statement. To reset the stopwatch to zero, use the ResetStopwatch, page 520 statement.

Syntax StopStopwatch()

Example StartStopwatch() Window("Report a Bug").EditBox("editboxUsername").SetText("Guest") Window("Report a Bug").EditBox("editboxPassword").SetText("SoloBug") Window("Report a Bug").Button("buttonLogin").Click() StopStopwatch() elapsedTime = GetStopwatchElapsedTime() PrintLn("Login time: " + elapsedTime) ResetStopwatch()

556 Str

Str

Note: This statement is named String in the Add Statement dialog box.

Converts a value and returns it as a string.

Syntax Str(Value)

Arguments

Argument Description

Value Value to convert.

Return value

Value Description

Value Converted string.

Example testString = Str(34 + 66) PrintLn("String of numbers: " + testString)

StrCompare

Note: This statement is named String Compare in the Add Statement dialog box.

Returns an integer to indicate if two strings match or the string sorted first based on alphabetical order comparison. The comparison uses the test computer's cultural settings for culture-specific sorting information, such as casing rules and the order of individual characters.

Syntax StrCompare("FirstString", "SecondString", IsCaseSensitive)

Arguments

Argument Description

FirstString First string.

SecondString Second string.

IsCaseSensitive Case sensitive comparison. True matches the string case. False ignores the case. If not specified, True is used.

557 StrEquals

Return value

Value Description

Negative number First string is before second string in sorted order.

0 Strings match.

Positive number First string is after second string in sorted order.

Example productA = "WysiDraw" productB = "WysiWrite" comp = StrCompare(productA, productB, False) 'Returns -1 comp = StrCompare(productB, productA, False) 'Returns 1

StrEquals

Note: This statement is named String Equals in the Add Statement dialog box.

Returns True or False to indicate if two strings match.

Syntax StrEquals("FirstString", "SecondString", IsCaseSensitive)

Arguments

Argument Description

FirstString First string.

SecondString Second string.

IsCaseSensitive Case sensitive comparison. True matches the string case. False ignores the case. If not specified, True is used.

Return value

Value Description

True Strings match.

False Strings do not match.

Example myStr1 = "WysiCorp" myStr2 = "wysicorp"

558 TestCaseStep

If (StrEquals(myStr1, myStr2, True)) Then PrintLn("Strings match") Else PrintLn("Strings do not match") End If

TestCaseStep Indicates the beginning of a Helix ALM test case step. This statement is automatically created from existing steps when creating scripts from test cases. The actions to perform the step or the expected results must follow this statement. See Creating scripts from Helix ALM test cases, page 272.

Note: This statement cannot be used in load test scripts.

Syntax TestCaseStep("Name", "Description")

Arguments

Argument Description

Name Step name.

Description Step description.

Example TestCaseStep("Step 1", "Enter username in User field.") Window("WysiCorp CRMLogin").EditBox("textBoxUser").TypeText("sales") TestCaseStep("Expected result 1", "Username appears in User field.")

Throw Regenerates the error handled by the containing Catch block. Can only be used in a Catch block. See Try...Catch...Finally, page 565.

Syntax Throw()

Example Sub SubWithTryCatch Try Err.Raise(6, "mySource", "New Error") PrintLn("Statement cannot run because error was thrown")

559 Time

Catch PrintLn("Err 2: " + Err.Description()) 'Throw() 'Clear the comment on this Throw statement and first PrintLn in Catch block below will not run End Try End Sub Sub Main ClearOutput() Try Try Err.Raise(5, "otherSource", "Original Error") PrintLn("Statement cannot run because error was thrown") Catch PrintLn("Err 1: " + Err.Description()) SubWithTryCatch() PrintLn("Statement runs if Throw() statement above is uncommented") PrintLn("Err 3: " + Err.Description()) Throw() End Try Catch PrintLn("Err 4: " + Err.Description()) End Try End Sub

Time Returns time in seconds since the epoch (January 1, 1970 12:00 AM).

Syntax Time()

Return value

Value Description

Value Time in seconds since the epoch.

Example secondsSinceEpoch = Time()

Today Returns the current date in MM/DD/YYYY format.

560 ToString - JSONArray

Syntax Today()

Return value

Value Description

Value Current date.

Example currentDate = Today()

ToString - JSONArray

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Converts a JSONArray type to a string and returns it.

Syntax ToString(PrettyPrint)

Arguments

Argument Description

PrettyPrint True adds white space to the string so results are easier to read. False does not add white space. If not specified, False is used.

Supported objects JSONArray

Return value

Value Description

Value Converted string.

Example PrintLn(jsonArray.ToString(True))

ToString - JSONObject

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Converts a JSONObject type to a string and returns it.

561 TouchDown

Syntax ToString(PrettyPrint)

Arguments

Argument Description

PrettyPrint True adds white space to the string so results are easier to read. False does not add white space. If not specified, False is used.

Supported objects JSONObject

Return value

Value Description

Value Converted string.

Example PrintLn(jsonObject.ToString(True))

TouchDown Performs a touch action in a location. Use this statement with TouchMove, page 563 and TouchUp, page 564 to perform tap, swipe, and pinch zoom actions in scripts that test Windows 8 applications and to test applications that can interpret touch actions.

Note: This statement is not recorded and must be manually added to scripts.

Syntax TouchDown(X, Y, ...)

Arguments You can specify a maximum of 16 locations.

Argument Description

X X coordinate to indicate the horizontal pixel location where the touch action is performed, relative to the screen or a window or control.

Y Y coordinate to indicate the vertical pixel location where the touch action is performed, relative to the screen or a window or control.

562 TouchMove

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("LeaveAComment").EditBox("editComment").TouchDown(100, 100)

TouchMove Moves a touch action to a location. Use this statement with the TouchDown, page 562 and TouchUp, page 564 statements to perform tap, swipe, and pinch zoom actions in scripts that test Windows 8 applications and to test applications that can interpret touch actions.

Note: This statement is not recorded and must be manually added to scripts.

Syntax TouchMove(X, Y, ...)

Arguments You can specify a maximum of 16 locations.

Argument Description

X X coordinate to indicate the horizontal pixel location to move the touch action, relative to the screen or a window or control.

Y Y coordinate to indicate the vertical pixel location to move the touch action, relative to the screen or a window or control.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example ' Simulates a swipe TouchDown(100, 100) TouchMove(200, 100) TouchUp(200, 100)

563 TouchUp

TouchUp Removes a touch action in a location. Use this statement with TouchDown, page 562 and TouchMove, page 563 to perform tap, swipe, and pinch zoom actions in scripts that test Windows 8 applications and to test applications that can interpret touch actions.

Note: This statement is not recorded and must be manually added to scripts.

Syntax TouchUp(X, Y, ...)

Arguments You can specify a maximum of 16 locations.

Argument Description

X X coordinate to indicate the horizontal pixel location where the touch action is removed, relative to the screen or a window or control.

Y Y coordinate to indicate the vertical pixel location where the touch action is removed, relative to the screen or a window or control.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example ' Simulates a pinch zoom on the screen TouchDown(75, 100, 125, 100) TouchMove(25, 100, 175,100) TouchUp(25, 100, 175, 100)

Trim Returns a string with the leading and trailing spaces removed.

Syntax Trim("String")

564 Try...Catch...Finally

Arguments

Argument Description

String String to remove spaces from.

Return value

Value Description

Value Text string with leading and trailing spaces removed.

Example trimmedText = Trim(" QA Wizard Pro")

Try...Catch...Finally Wraps a block of statements where errors may occur. Statements in the Try block run until an error occurs. If an error occurs, the Errors pane, status tool, run report, and Err object are updated with error information and playback continues with statements in the Catch block. The Catch block only runs if an error occurs. Statements in the Finally block always run even if errors do not occur. Catch or Finally must be specified after Try. One Catch or Finally block is allowed in a Try statement, but Finally must be used last to avoid a syntax error. Try...Catch...Finally statements can be nested in other Try...Catch...Finally statements. If a Catch block is not included before a Finally block, the next Catch block up the call stack runs after the Finally statements run.

Syntax Try [TryStatements] Catch [CatchStatements] Finally [FinallyStatements] End Try

Arguments

Argument Description

TryStatements Statements where an error may occur.

CatchStatements Statements to handle errors that occur in the Try block. Optional if Finally statements are used.

FinallyStatements Statements to run after all other error processing occurs. Optional if Catch statements are used.

565 TypeText

Example Try If x <> y Then Fail("x does not equal y") End If Catch x = y Finally PrintLn("x equals y") End Try

TypeText Enters text in a control or at the application level. To replace all text in an edit box, use the SetText, page 548 statement.

Syntax TypeText("Text")

Arguments

Argument Description

Text Text to type. Null values must be converted to empty strings before used.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example 'Enters text in an editbox Window("Feedback").EditBox("editboxPhoneNumber").TypeText("ext. 123") 'Enters text at the application level TypeText("WysiCorp")

Upper Converts characters to uppercase and returns the string.

Syntax Upper("String")

566 UserName

Arguments

Argument Description

String String to convert.

Return value

Value Description

Value Converted uppercase string.

Example uppercaseString = Upper("qa wizard pro")

UserName Returns the username of the current user logged in to Windows on the computer running the script. If scripts run remotely, the logged in username on the remote test computer is returned.

Syntax UserName()

Return value

Value Description

Value Username of the current user.

Example currentUser = UserName() PrintLn("Tester: " + currentUser)

WaitForExists Waits a period of time for a window or control to exist before continuing with the next statement and returns True or False to indicate if it is found. This statement is often used with conditional statements to handle known exceptions. For example, you can use it to determine if a window, control, or page is displayed before performing actions. See Handling known exceptions, page 155.

Syntax WaitForExists(WaitTime)

567 WaitForExistsTimed

Arguments

Argument Description

WaitTime Maximum number of milliseconds to search for the window or control.

Return value

Value Description

True Window or control was found.

False Window or control was not found.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example Window("Feedback").HTMLLink("linkSubmit").WaitForExists(5000)

WaitForExistsTimed Waits a period of time for a window or control to exist before continuing with the next statement and returns the number of milliseconds it took to find it. This statement is often used with conditional statements to handle known exceptions. For example, you can use it to determine if a window, control, or page is displayed within a period of time before performing actions. See Handling known exceptions, page 155.

Syntax WaitForExistsTimed(WaitTime)

Arguments

Argument Description

WaitTime Maximum number of milliseconds to search for the window or control.

Return value

Value Description

Value Number of milliseconds to find the window or control.

568 WaitForProperty

Value Description

-1 Window or control was not found.

Supported objects Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window

Example findTime = Window("WysiCorp CRM").Menu("MenuBar").WaitForExistsTimed(5000) If findTime < 0 Then PrintLn("Menu not found in five seconds") Window("WysiCorp CRM").Close() Else Window("WysiCorp CRM").Menu("MenuBar").Item("File/Exit").Select() End If

WaitForProperty Waits a period of time to find a value in a window or control property before continuing with the next statement and returns True or False to indicate if it is found.

Syntax WaitForProperty("PropertyName", "Value", WaitTime)

Arguments

Argument Description

PropertyName Property name to search for.

Value Property value to search for.

WaitTime Maximum number of milliseconds to search for the property value..

Return value

Value Description

True Property value was found.

False Property value was not found.

569 Warning

Supported objects Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree

Example If Window("Transaction Complete").Button("Close").WaitForProperty("Enabled", True, 10000) Then Window("Transaction Complete").Button("Close").Click() Else Warning("Close button not enabled within 10 seconds. Force closing dialog.") KeyPress("Alt, F4") End If

Warning Displays a warning message in the Errors pane and adds it to the run report. Use this statement to stay informed if an error occurs without stopping the script. This statement is often used with conditional statements. See Conditional statements, page 325.

Note: To display a warning message and stop the script, use the Fail, page 408 statement.

Syntax Warning("WarningMessage")

Arguments

Argument Description

WarningMessage Warning message to display in the Errors pane and run report.

Example regValue = ReadRegistryEntry("HKEY_CLASSES_ROOT\\.qawscript", "") If regValue = "QAWizardPro.Script" Then PrintLn("Scripts entered correctly in registry") Else Warning("Scripts not correctly entered in registry") End If

WebAddNetworkCredential

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Adds a set of credentials to the cache of network credentials sent with all web requests.

570 WebAddSessionVariable

To clear the network credentials cache, use the WebClearNetworkCredentials, page 572 statement.

Syntax WebAddNetworkCredential("Username", "Password", "Domain", "AuthenticationType")

Arguments

Argument Description

Username Username to use. Required.

Password Password to use.

Domain Domain for credentials. If not specified, the default value is an empty string.

AuthenticationType Authentication type. If not specified, the default value is BASIC.

Example WebAddNetworkCredential("Tester", "qapswd", "wysicorp", "BASIC")

WebAddSessionVariable

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Adds a form variable to look for in input fields on responses from the WebGet, page 574 and WebPost, page 581 statements and replaces the variable value captured during recording with the value returned from the web server. The web server response value is used to update input data in WebGet and WebPost statements that follow this statement. This statement must be manually added to load test scripts. See Adding statements, page 146. To stop updating form variables, use the WebRemoveSessionVariable, page 587 or WebRemoveAllSessionVariables, page 586 statement.

Syntax WebAddSessionVariable("FormVariable")

Arguments

Argument Description

FormVariable Variable to update in sessions.

Example WebAddSessionVariable("sessionid")

571 WebClearAllCustomHeaders

WebClearAllCustomHeaders

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Clears all custom headers created by WebSetCustomHeader, page 588 statements sent with all web requests.

Syntax WebClearAllCustomHeaders()

Example 'Clears existing headers before setting value to pass with request WebClearAllCustomHeaders() WebSetCustomHeader("AccessToken", "9a38a382-9c0a-4b42-9c54-3f7db7de66af") WebGet("http://www.wysicorp.com/login.php") WebRemoveCustomHeader("AccessToken")

WebClearNetworkCredentials

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Clears the cache of network credentials created by WebAddNetworkCredential, page 570 statements sent with all web requests.

Syntax WebClearNetworkCredentials()

Example WebAddNetworkCredential("Tester", "qawpswd", "wysicorp", "BASIC") WebGet("http://www.wysicorp.com/wysicorp/login.php") WebClearNetworkCredentials()

WebCloseAllConnections

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Closes all open connections to all web servers. To better simulate browser behavior, connections opened by WebGet, page 574 and WebPost, page 581 statements remain open while statements that follow them run. Web servers may close the connections at any time, but you can use this statement to ensure all connections are closed before the load test finishes. To close an individual connection, use the WebCloseConnection, page 573 statement.

Syntax WebCloseAllConnections()

572 WebCloseConnection

Example WebPost("http://www.wysicorp.com/wysicorp/reportbug.php", "unam", "Guest", "passwd", "SoloBug", "submit", "Login") WebCloseAllConnections()

WebCloseConnection

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Closes the connection to a web server. To better simulate browser behavior, connections opened by WebGet, page 574 and WebPost, page 581 statements remain open while statements that follow them run. Web servers may close the connections at any time, but you can use this statement to close a connection not needed for the remainder of the load test. To close all connections, use the WebCloseAllConnections, page 572 statement.

Syntax WebCloseConnection("Server")

Arguments

Argument Description

Server URL for the web server to close the connection to. Must include the http or https protocol.

Example WebCloseConnection("http://www.wysicorp.com")

WebDelete

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a DELETE command and returns data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request.

Syntax WebDelete("URL")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

573 WebGet

Return value

Value Description

Value Data received from the web page.

Example result = WebDelete("http://www.wysicorp.com/form.php")

WebGet

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a GET command and returns the data received from a web page If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request.

Syntax WebGet("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

VariableName Variable name to pass to the web page. You can pass multiple variables as part of the URL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded when sent to the web server.

Return value

Value Description

Value Data received from the web page.

Example result = WebGet("http://www.wysicorp.com/form.php", "p", "173")

WebGetAllCustomHeaders

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns an array of all custom header names set by WebSetCustomHeader, page 588 statements.

574 WebGetCookie

Syntax WebGetAllCustomHeaders()

Return value

Value Description

Value Array of custom header names.

Example 'Gets existing custom headers and checks if AccessToken header exists headers = WebGetAllCustomHeaders() exists = False For Each header in headers If (header = "AccessToken") Then exists = True End If Next 'Stores header value token = "" 'If header exists, returns original value If exists Then token = WebGetCustomHeader("AccessToken") End If Try 'Sets custom header value to send with requests WebSetCustomHeader("AccessToken", "9a38a382-9c0a-4b42-9c54-3f7db7de66af") WebGet("http://www.wysicorp.com/login.php") Finally 'Resets original header value if header existed or removes header created in Try block If exists Then WebSetCustomHeader("AccessToken", token) Else WebRemoveCustomHeader("AccessToken") End If End Try

WebGetCookie

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns the cookie value set by a WebSetCookie, page 588, WebGet, page 574, or WebPost, page 581 statement.

575 WebGetCustomHeader

Syntax WebGetCookie("Name", "URL")

Arguments

Argument Description

Name Cookie name.

URL URL the cookie is valid for. Only supports http and https protocols.

Return value

Value Description

Value Cookie value.

Cookie was not set.

Example cookie = WebGetCookie("loginname", "http://www.wysicorp.com/")

WebGetCustomHeader

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns the header value set by a WebSetCustomHeader, page 588 statement.

Syntax WebGetCustomHeader("Header")

Arguments

Argument Description

Header Header name.

Return value

Value Description

Value Header value.

Example 'Gets existing custom headers and checks if AccessToken header exists headers = WebGetAllCustomHeaders()

576 WebGetReferrer

exists = False For Each header in headers If (header = "AccessToken") Then exists = True End If Next 'Stores header value token = "" 'If header exists, returns original value If exists Then token = WebGetCustomHeader("AccessToken") End If Try 'Sets custom header value to send with requests WebSetCustomHeader("AccessToken", "9a38a382-9c0a-4b42-9c54-3f7db7de66af") WebGet("http://www.wysicorp.com/login.php") Finally 'Resets original header value if header existed or removes header created in Try block If exists Then WebSetCustomHeader("AccessToken", token) Else WebRemoveCustomHeader("AccessToken") End If End Try

WebGetReferrer

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns the referrer set by a WebSetReferrer, page 589 statement.

Syntax WebGetReferrer()

Return value

Value Description

Value Referrer URL.

Referrer does not exist.

Example referrer = WebGetReferrer()

577 WebGetUserAgent

WebGetUserAgent

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Returns the browser user agent. The agent is set by WebSetUserAgent, page 590 statements in the script or settings used when running the script. See Running load tests, page 104 and Running load tests from a command prompt, page 106.

Syntax WebGetUserAgent()

Return value

Value Description

Value Browser user agent.

Example useragent = WebGetUserAgent()

WebHead

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a HEAD command and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request.

Syntax WebHead("URL")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

Return value

Value Description

Value Data received from the web page.

Example result = WebHead("http://www.wysicorp.com/form.php")

578 WebOptions

WebOptions

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends an OPTIONS command and returns the requests accepted by the web server that hosts the URL.

Syntax WebOptions("URL")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

Return value

Value Description

Value Requests accepted by the web server.

Web server response did not include accepted requests.

Example result = WebOptions("http://www.wysicorp.com/form.php")

WebPatch

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a PATCH command and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request. This statement uses the default application/x-www-form-urlencoded content type. Use the WebPatchFromFile, page 580 statement to patch from other content types.

Syntax WebPatch("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

579 WebPatchFromFile

Argument Description

VariableName Variable name to pass to the web page. You can pass multiple variables as part of the URL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded when sent to the web server.

Return value

Value Description

Value Data received from the web page.

Example result = WebPatch("/wysicorp/reportbug.php", "submit", "Login")

WebPatchFromFile

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a PATCH command from a file and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request. This statement uses a specified content type. Use the WebPatch, page 579 statement to patch from the default application/x-www-form-urlencoded content type.

Syntax WebPatchFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

ContentType File content type. Valid content types depend on the web server configuration.

Filename File to send. Use a file path relative to the script or an absolute file path.

Return value

Value Description

Value Data received from the web page.

580 WebPatchJSON

Example result = WebPatchFromFile("http://www.wysicorp.com/uploadform.php", "text/plain; charset=UTF-8", "patch.txt")

WebPatchJSON

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a PATCH command from a JSON statement and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request.

Syntax WebPatchJSON("URL", JSON)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

JSON JSON object or string to attach to the request.

Return value

Value Description

Value Data received from the web page.

Example ' Update session ID before patching file contents contents = ReadTextFile("patch.txt", EncodingAutoDetect) jsonObject = JSONParse(contents) jsonObject = JSONObjectSetValue(jsonObject, "sessionID", sessionID) WebPatchJSON("http://www.wysicorp.com/login.php", jsonObject)

WebPost

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a POST command and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request. This statement uses the default application/x-www-form-urlencoded content type. Use the WebPostFromFile, page 582 statement to post from other content types.

581 WebPostFromFile

Syntax WebPost("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

VariableName Variable name to pass to the web page. You can pass multiple variables as part of the URL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded when sent to the web server.

Return value

Value Description

Value Data received from the web page.

Example result = WebPost("/wysicorp/reportbug.php", "uname", "Guest", "pswd", "SoloBug", "submit", "Login")

WebPostFromFile

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a POST command from a postdata file and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request. This statement uses a content type. Use the WebPost, page 581 statement to post a default application/x- www-form-urlencoded content type file.

Syntax WebPostFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

582 WebPostJSON

Argument Description

ContentType Content type of the postdata file. Valid content types depend on the web server configuration.

Filename Postdata file to post. Use a file path relative to the script or an absolute file path.

Return value

Value Description

Value Data received from the web page.

Example result = WebPostFromFile("http://www.wysicorp.com/uploadform.php", "text/plain; charset=UTF-8", "LoginTest_1.postdata")

WebPostJSON

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a POST command from a JSON statement and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request.

Syntax WebPostJSON("URL", JSON)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

JSON JSON to attach to the request.

Return value

Value Description

Value Data received from the web page.

Example ' Update session ID before posting file contents contents = ReadTextFile("LoginTest_1.postdata", EncodingAutoDetect) jsonObject = JSONParse(contents) jsonObject = JSONObjectSetValue(jsonObject, "sessionID", sessionID)

583 WebPut

WebPostJSON("http://www.wysicorp.com/login.php", jsonObject)

WebPut

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a PUT command and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request. This statement uses the default application/x-www-form-urlencoded content type. Use the WebPutFromFile, page 584 statement to put from other content types.

Syntax WebPut("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

VariableName Variable name to pass to the web page. You can pass multiple variables as part of the URL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded when sent to the web server.

Return value

Value Description

Value Data received from the web page.

Example result = WebPut("http://www.wysicorp.com/uploadform.php", "uname", "Guest", "pswd", "SoloBug")

WebPutFromFile

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a PUT command from a file and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request. This statement uses a content type. Use the WebPut, page 584 statement to put from the default application/x-www-form-urlencoded content type.

584 WebPutJSON

Syntax WebPutFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

ContentType File content type. Valid content types depend on the web server configuration.

Filename File to send. Use a file path relative to the script or an absolute file path.

Return value

Value Description

Value Data received from the web page.

Example result = WebPutFromFile("http://www.wysicorp.com/uploadform.php", "text/plain; charset=UTF-8", "login.txt")

WebPutJSON

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sends a PUT command from a JSON statement and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer, page 589 statement, it is also sent with the request.

Syntax WebPutJSON("URL", JSON)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.

JSON JSON to attach to the request.

585 WebRemoveAllSessionVariables

Return value

Value Description

Value Data received from the web page.

Example ' Update session ID before putting file contents contents = ReadTextFile("login.txt", EncodingAutoDetect) jsonObject = JSONParse(contents) jsonObject = JSONObjectSetValue(jsonObject, "sessionID", sessionID) WebPutJSON("http://www.wysicorp.com/login.php", jsonObject)

WebRemoveAllSessionVariables

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Stops updating all form variables set by WebAddSessionVariable, page 571 statements for all web requests.

Syntax WebRemoveAllSessionVariables()

Example WebAddSessionVariable("sessionid") WebRemoveAllSessionVariables()

WebRemoveCustomHeader

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Removes a custom header set by a WebSetCustomHeader, page 588 statement from the list of headers sent with all web requests.

Syntax WebRemoveCustomHeader("Header")

Arguments

Argument Description

Header Header name.

Example 'Gets existing custom headers and checks if AccessToken header exists headers = WebGetAllCustomHeaders()

586 WebRemoveSessionVariable

exists = False For Each header in headers If (header = "AccessToken") Then exists = True End If Next 'Stores header value token = "" 'If header exists, returns original value If exists Then token = WebGetCustomHeader("AccessToken") End If Try 'Sets custom header value to send with requests WebSetCustomHeader("AccessToken", "9a38a382-9c0a-4b42-9c54-3f7db7de66af") WebGet("http://www.wysicorp.com/login.php") Finally 'Resets original header value if header existed or removes header created in Try block If exists Then WebSetCustomHeader("AccessToken", token) Else WebRemoveCustomHeader("AccessToken") End If End Try

WebRemoveSessionVariable

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Stops updating a form variable set by a WebAddSessionVariable, page 571 statement for all web requests.

Syntax WebRemoveSessionVariable("FormVariable")

Arguments

Argument Description

FormVariable Variable to stop updating.

Example WebRemoveSessionVariable("sessionid")

587 WebSetCookie

WebSetCookie

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sets a cookie to send with other load testing statements.

Syntax WebSetCookie("Name", "Value", "URL", IsDomainWide)

Arguments

Argument Description

Name Cookie name.

Value Cookie value.

URL URL that the cookie is valid for.

IsDomainWide Specifies to send the cookie to subdomains of the URL. True sends the cookie to all subdomains. False does not send the cookie to any subdomains. If not specified, False is used.

Example WebSetCookie("loginname", "Guest", "http://wysicorp.com/", True)

WebSetCustomHeader

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sets a custom header to send with other load testing statements.

Syntax WebSetCustomHeader("Header", "Value")

Arguments

Argument Description

Header Header name.

Value Header value.

Example 'Gets existing custom headers and checks if AccessToken header exists headers = WebGetAllCustomHeaders() exists = False

588 WebSetReferrer

For Each header in headers If (header = "AccessToken") Then exists = True End If Next 'Stores header value token = "" 'If header exists, returns original value If exists Then token = WebGetCustomHeader("AccessToken") End If Try 'Sets custom header value to send with requests WebSetCustomHeader("AccessToken", "9a38a382-9c0a-4b42-9c54-3f7db7de66af") WebGet("http://www.wysicorp.com/login.php") Finally 'Resets original header value if header existed or removes header created in Try block If exists Then WebSetCustomHeader("AccessToken", token) Else WebRemoveCustomHeader("AccessToken") End If End Try

WebSetReferrer

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Sets the referrer URL used by other load testing statements.

Syntax WebSetReferrer("Referrer")

Arguments

Argument Description

Referrer Referrer URL. Relative paths are automatically prepended with the %URLROOT% repository variable. If the referrer is not specified, the URL is cleared.

Example WebSetReferrer("http://www.wysicorp.com/")

589 WebSetUserAgent

WebSetUserAgent

Note: This statement is only used in load test scripts. See Load Testing, page 103 for more information.

Overrides the browser user agent sent by the client with a custom user agent. Some web pages may change behavior depending on the browser. The user agent string is passed to the application to identify the browser. You can create custom agents to simulate different browser versions or automated web crawlers for searches.

Syntax WebSetUserAgent("UserAgent")

Arguments

Argument Description

UserAgent User agent to send.

Tip: To view a list of user agent constants, choose Script > Add Statement and select this statement in the Load Testing category. To find a user agent string, choose Script > Run Load Test and click Add in the Browsers area. Select a Browser in the Add Browser dialog box and copy the User Agent string to the statement argument.

Example WebSetUserAgent("USERAGENT_FIREFOX2")

Weekday Returns a weekday integer that represents the day of the week for a date.

Syntax Weekday("DateTimeString")

Arguments

Argument Description

DateTimeString Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Integer that corresponds with the day of the week in the date/time value. 1 is Sunday, 2 is Monday, etc.

590 WeekdayName

Example DayOfWeek = Weekday("8-June-2016")

WeekdayName Returns a weekday name based on a weekday integer. 1 is Sunday, 2 is Monday, etc.

Syntax WeekdayName(WeekdayInteger)

Arguments

Argument Description

WeekdayInteger Weekday integer.

Return value

Value Description

Value Weekday name that corresponds with the integer.

Example dayOfWeek = WeekdayName(3)

WeekdayNum Returns a weekday integer based on a weekday name. Sunday is 1, Monday is 2, etc.

Syntax WeekdayNum("WeekdayName")

Arguments

Argument Description

WeekdayName Weekday name.

Return value

Value Description

Value Integer that corresponds with the weekday name.

Example numberDayOfWeek = WeekdayNum("Thursday")

591 While

While Runs a block of statements as long as a condition is True or until an Exit While statement runs. During playback, the While statement condition is evaluated at the beginning of the loop. If the condition is True, statements in the loop run. If the condition is False, statements in the loop do not run and playback continues with the first statement outside the block.

Note: Do...Loop Until, page 388 and Do...Loop While, page 389 statements provide a more structured and flexible way to perform loops.

Syntax While Condition [Statements] WEnd

Arguments

Argument Description

Condition String or numeric expression to evaluate.

Statements One or more statements to run while Condition is True.

Keyword View notes The condition to evaluate is displayed in the Information column.

Example While counter <= type Window("Feedback").EditBox("editboxFirst").TypeText("Jane") Window("Feedback").EditBox("editboxLast").TypeText("Smith") Window("Feedback").ComboBox("comboboxType").Item(counter).Select() Window("Feedback").Button("buttonSend").Click() Window("Browser").Navigate("http://www.wysicorp.com/reportbug.php") counter = counter + 1 WEnd Window("Browser").Close()

WriteRegistryEntry Sets a registry key value on the test computer. For example, if an application writes to the registry after an action is performed, you can use this statement to reset the registry entries each time the script runs. Only use this statement if you have experience editing the registry.

Note: Issues may occur when using this statement in load test scripts.

592 Year

Syntax WriteRegistryEntry("FullKeyName", "ValueName", Value)

Arguments

Argument Description

FullKeyName Full path to the registry key starting with a valid root, such as HKEY_CURRENT_USER.

ValueName Name/value name pair to write to the registry.

Value Value to write to the registry key.

Example WriteRegistryEntry("HKEY_CURRENT_USER\\Software\\WysiCorp", "Name", "Developer Name")

Year Returns the year from a date/time value.

Syntax Year("DateTime")

Arguments

Argument Description

DateTime Any date/time expression. See Date/time format examples, page 605 for valid formats.

Return value

Value Description

Value Year from the date/time value.

Example currentDate = Now() rtnYear = Year(currentDate)

Operators QA Wizard Pro supports the following operators.

593 Addition operator

Operator Description More information

= Assignment Assignment operator, page 595

+ Adds two expressions Addition operator, page 594

- Subtracts two numbers Subtraction operator, page 599

* Multiplies two numbers Multiplication operator, page 597

/ Divides two numbers Division operator, page 596

& Concatenates two strings Concatenation operator, page 596

^ Raises a number to the power Exponentiation operator, page 596

= Tests if two values are equal

<> Tests if two values are not equal

> Tests if the first value is greater than the second

>= Tests if the first value is greater than or equal to the second

< Tests if the first value is less than the second

<= Tests if the first value is less than or equal to the second

And Logical AND operation And operator, page 595

Or Logical OR operation Or operator, page 598

Not Logical NOT operation Not operator, page 598

Mod Divides two numbers and returns the remainder Mod operator , page 597

Xor Performs a logical exclusion on two expressions Xor operator, page 599

Is Compares two object reference variables Is operator, page 597

Addition operator Adds two numbers or concatenates two string expressions. Uses the plus sign (+) operator. If one expression is empty, the other expression is returned unchanged. result = expression1 + expression2

594 And operator

Item Description

result Any numeric variable

expression1 Any expression

expression2 Any expression

When you use the + operator, you may not be able to determine whether addition or string concatenation will occur. The expression determines the behavior of the + operator:

If expression is: Result

Both are numeric Add

Both are strings Concatenate

One is numeric and one is a string Concatenate

And operator Performs a logical conjunction on two expressions. result = expression1 And expression2

Item Description

result Any numeric variable

expression Any Boolean expression

If both expressions evaluate to true, the result is true. If either expression evaluates to false, the result is false. The following table shows how the result is determined:

Expression 1 Expression 2 Result

True True True

True False False

False True False

False False False

Null Null Null

Assignment operator Assigns a value to a variable or property. Name can be a simple variable or an element of an array. Value can be a text string, expression, function, variable, or datasheet value. Uses the equal sign (=) operator. variable = value

595 Concatenation operator

Item Description

variable Any variable or writable property

value Any numeric or string literal, constant, or expression

Concatenation operator Forces string concatenation of two expressions. If an expression is not a string, it is converted to a string subtype. Uses the ampersand (&) operator. An empty expression is treated as a zero-length string. result = expression1 & expression2

Item Description

result Any string variable

expression1 Any expression

expression2 Any expression

Division operator Divides two numbers and returns a floating point or integer result. Uses the slash (/) operator. result = number1/number2

Item Description

result Any numeric variable

number1 Any numeric expression

number2 Any numeric expression

The following table shows how the result is determined.

Expression 1 Expression 2 Result

integer integer integer

integer float float

float integer float

Exponentiation operator Raises a number to the power of an exponent. Uses the caret (^) operator. result = number ^ exponent

596 Is operator

Item Description

result Any numeric variable

number Any numeric expression

exponent Any numeric expression

Is operator Compares two object reference variables to determine if they refer to the same object. result = object1 Is object2

Item Description

result Any variable

object Any object variable

If both objects refer to the same object, the result is true. If they do not refer to the same object, the result is false. You can compare an object to the Nothing keyword, which represents an uninitialized dynamic COM object. In the following example, the If statement evaluates the IE variable value. If the variable value is not set, the result is true, and the CreateObject statement creates the InternetExplorer object, which is assigned as the IE variable value. If the variable value is set, the result is false, the CreateObject statement does not run, and the script continues with the steps outside of the If statement block. If IE Is Nothing Then IE = CreateObject("InternetExplorer.Application") End If

Mod operator Divides two numbers and returns only the remainder. result = number1 Mod number2

Item Description

result Any numeric variable

number Any numeric expression

Multiplication operator Multiplies two numbers. Uses the asterisk (*) operator. result = number1 * number2

597 Negation operator

Item Description

result Any numeric variable

number1 Any numeric expression

number2 Any numeric expression

Negation operator Indicates the negative value of a numeric expression. Uses the hyphen (-) operator. result = -number

Item Description

result Any numeric variable

number Any numeric expression

Not operator Performs logical negation on an expression. result = Not expression

Item Description

result Any numeric variable

expression Any Boolean expression

The following table shows how the result is determined.

If expression is: Result

True False

False True

Or operator Performs a logical disjunction on two expressions. result = expression1 Or expression2

Item Description

result Any numeric variable

expression Any Boolean expression

598 Subtraction operator

If one or both expressions evaluate to true, the result is true. The following table shows how the result is determined.

Expression 1 Expression 2 Result

True True True

True False True

False True True

False False False

Subtraction operator Finds the difference between two numbers. Uses the hyphen (-) operator. result = number1-number2 -number

Item Description

result Any numeric variable

number Any numeric expression

number1 Any numeric expression

number2 Any numeric expression

Xor operator Performs a logical exclusion on two expressions. result = expression1 Xor expression2

Item Description

result Any numeric variable

expression Any expression

If only one of the expressions evaluates to true, the result is true. The following table shows how the result is determined.

Expression 1 Expression 2 Result

True True False

True False True

False True True

599 Constants

Expression 1 Expression 2 Result

False False False

Constants QA Wizard Pro supports the following constants.

Constant Description

Boolean

False Boolean False; equivalent to 0

True Boolean True; equivalent to 1

Browser

BrowserTypeChrome Browser is Google Chrome

BrowserTypeFirefox Browser is Mozilla Firefox

BrowserTypeIE Browser is Microsoft Internet Explorer

Character

Doublequote Double quotation mark

Newline New line character

Singlequote Single quotation mark

Comparison

Nothing Uninitialized object value

Null No valid data

Directory

QAWApplication Directory where the application last started by the RunApp statement in an individual script run is stored

QAWCurrent Current QA Wizard Pro working directory

QAWLoadTestReports Directory that stores load test reports

QAWReports Directory that stores playback reports

QAWScript Directory that stores the currently running script

QAWWorkspace Directory that stores the workspace

600 Constants

Constant Description

WinApplicationData Directory that stores application-specific data for the current roaming user (e.g., C:\Users\\AppData\Roaming)

WinCommonApplicationData Directory that stores application data for all users (e.g., C:\ProgramData)

WinCommonProgramFiles Directory that stores shared application components (e.g., C:\Program Files (x86)\Common Files)

WinCookies Directory that stores Internet cookies (e.g., C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies)

WinDesktop Desktop directory (e.g., C:\Users\username\Desktop)

WinFavorites Directory that stores user-specified favorites (e.g., C:\Users\username\Favorites)

WinHistory Directory that stores Internet history (e.g., C:\Users\username\AppData\Local\Microsoft\Windows\History)

WinInternetCache Directory that stores temporary Internet files (e.g., C:\Users\username\AppData\Local\Microsoft\Windows\Temporary)

WinLocalApplicationData Directory that stores local, non-roaming applications (e.g., C:\Users\username\AppData\Local)

WinMyDocuments Directory that stores documents (e.g., C:\Users\username\Documents). Same as WinPersonal.

WinMyMusic Directory that stores music files (e.g., C:\Users\username\Music)

WinMyPictures Directory that stores image files (e.g., C:\Users\username\Pictures)

WinPersonal Directory that stores documents (e.g., C:\Users\username\Documents). Same as WinMyDocuments.

WinProgramFiles Directory that stores applications (e.g., C:\Program Files (x86))

WinPrograms Directory that stores program groups (e.g., C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs)

WinRecent Directory that stores the most recently used documents (e.g. C:\Users\username\AppData\Roaming\Microsoft\Windows\Recent)

WinSendTo Directory that stores Send To shortcut menu items (e.g., C:\Users\username\AppData\Roaming\Microsoft\Windows\SendTo)

WinStartMenu Directory that stores Start menu items (e.g., C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu)

601 Constants

Constant Description

WinStartup Directory that stores the startup program group (e.g., C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)

WinSystem Windows System directory (e.g., C:\Windows\System32)

WinTemplates Directory that stores document templates (e.g., C:\Users\username\AppData\Roaming\Microsoft\Windows\Templates)

Encoding

EncodingASCII ASCII (7-bit) character set encoding

EncodingAutoDetect Detects encoding based on byte-order marks

EncodingDefault Default operating system encoding

EncodingUCS2 UCS-2 format encoding

EncodingUTF16 Unicode 16-bit format, little-endian byte order encoding

EncodingUTF16Big Unicode 16-bit format, big-endian byte order encoding

EncodingUTF32 Unicode 32-bit, little endian byte order encoding

EncodingUTF7 Unicode 7-bit format encoding

EncodingUTF8 Unicode 8-bit format encoding

HTML table

AnyColumn HTML table column

AnyRow HTML table row

OCR checkpoints

OCRControlRelative Coordinates relative to the control. Only used with OCR checkpoints.

OCRWindowRelative Coordinates relative to the window. Only used with OCR checkpoints.

Math

Pi The number Pi (3.14...)

Playback

ArgumentErrorNumber Playback error number 2. Assigned to errors caused by invalid, missing, or unexpected arguments.

Default Default run-time playback speed

602 Keywords

Constant Description

Defaultspeed Default low-level action playback speed

FunctionErrorNumber Playback error number 4. Assigned to errors generated by built-in functions and statements.

InDebugMode Determines if script is running in debug mode

Maximumspeed Maximum low-level action playback speed

ObjectActionErrorNumber Playback error number 1. Assigned to errors that indicate a control was not found or interacted with.

ParserErrorNumber Playback error number 3. Assigned to errors caused by invalid statements.

Stress testing

SimulationOff Disables stress testing simulations

VBScript string

vbCr Carriage return. Equivalent to Chr(13).

vbCrLf Carriage return followed by line feed. Equivalent to Chr(13) & Chr(10).

vbFormFeed Form feed. Equivalent to Chr(12).

vbLf Line feed. Equivalent to Chr(10).

vbNewLine Platform-specific new line character. Equivalent to Chr(13) & Chr(10).

vbNullChar Null-terminated string. Equivalent to Chr(0).

vbNullString Null string. Equivalent to Null.

vbTab Horizontal (row) tab. Equivalent to Chr(9).

vbVerticalTab Vertical (column tab). Equivalent to Chr(11).

Keywords Keywords are reserved words in the QA Wizard Pro scripting language that cannot be used as variables or identifiers. The following elements in the scripting language are keywords. n Statements, page 321 n Constants, page 600 n Operators, page 593 Following are additional keywords.

603 Keywords

Keyword Description

Arrays

Erase Clears the contents of an array

Preserve Preserves data in an existing array when the size of the last dimension is changed. Used with ReDim.

Constants/Literals

Empty Do not use; use Null

Control flow

End Ends a block of statements

Return Returns control to the code that called a function or subroutine

Declarations

Const Declares constants for use in place of literal values

Dim Declares a variable

Function Declares a function

ReDim Sizes or resizes an array defined by Dim

Set Assigns an object to a variable

Sub Declares a subroutine

Variants

IsEmpty Do not use; use IsNull, page 462

Reserved keywords The following keywords are reserved for future use.

604 Date/time format examples

n AscB n CSng n LBound n Randomize

n AscW n CStr n Lcase n RightB

n Atn n DateSerial n LeftB n Rtrim

n ByRef n DateValue n Len n Sgn

n ByVal n Eqv n LenB n Space

n Call n Exp n Let n Sqr

n CBool n Fix n Log n StrComp

n CByte n Hex n Ltrim n Tan

n CDate n Imp n MidB n TimeSerial

n CDb n InputBox n MsgBox n TimeValue

n ChrBl n Instr n Oct n UBound

n ChrW n InStrB n Private n Ucase

n Cint n Int n Public n VarType

n CLng n IsArray

Date/time format examples Following are examples of valid date/time strings that QA Wizard Pro can parse using date/time statements. n 05/01/2009 14:57:32.8 n 2009-05-01 14:57:32.8 n 2009-05-01T14:57:32.8375298-04:00 n 5/01/2008 14:57:32.80 -07:00 n 1 May 2008 2:57:32.8 PM n Fri, 15 May 2009 20:10:57 GMT n 1/3/2009 n 3:45PM

QA Wizard Pro environment variables The following QA Wizard Pro environment variables are available. They are set when a workspace is opened in QA Wizard Pro, scripts run, or batch files run.

Note: These variables are commonly used with the GetEnv statement. See GetEnv, page 431.

Variable Description

QAWDIR QA Wizard Pro application directory path (e.g., C:\Program Files (x86)\Perforce\QA Wizard Pro)

605 QA Wizard Pro environment variables

Variable Description

ROOTSAMPLEWSDIR QA Wizard Pro Workspaces directory path (e.g., C:\Users\\Documents\My Documents\QA Wizard Pro Workspaces)

WORKSPACEDIR Directory path the open workspace is stored in. If script is in a batch file, directory path the batch is stored in.

Note: The SCRIPTS variable was deprecated in QA Wizard Pro 2014.

606 Appendix A: Supported Technologies and Controls n Supported controls are recognized by QA Wizard Pro during recording and playback. Properties of these controls are captured and stored in the application repository. n Partially supported controls are only supported in certain conditions or only parts of the control are supported. The list includes known partially-supported controls, but other controls or controls derived from supported controls may also be recognized. n Unsupported controls may be captured as generic controls in the application repository. You can use low- level mouse actions to interact with these controls and perform checkpoints on a limited set of properties.

ComponentOne Studio Supported: n C1.Win.C1BarCode.C1BarCode n C1.Win.C1Command.C1MainMenu n C1.Win.C1Input.C1Button n C1.Win.C1Input.C1DateEdit n C1.Win.C1Input.C1Label n C1.Win.C1Input.C1TextBox n C1.Win.C1InputPanel.C1InputPanel n C1.Win.C1List.C1Combo n C1.Win.C1List.C1List n C1.Win.C1Schedule.C1Calendar n C1.Win.C1SuperTooltip.C1SuperLabel

Delphi Win32/VCL

Note: QA Wizard Pro does not capture the Name property for Delphi Win32 controls.

Supported: n Builtin T Frames n TButton n TCheckBox n TColorDialog n TComboBox n TComboBoxEx n TCustomizeDialog n TEdit

607 Appendix A: Supported Technologies and Controls

n TFindDialog n TFontDialog n TGroupButton n THintWindow n TListBox n TOpenDialog n TOpenPictureDialog n TOpenTextFileDialog n TPageSetupDialog n TPrintDialog n TPrinterSetupDialog n TRadioButton n TReplaceDialog n TRichEdit n TSaveDialog n TSavePictureDialog n TSaveTextFileDialog n TScrollBar n TTreeView

DevExpress Supported: n DevExpress.XtraBars.Bar n DevExpress.XtraBars.BarBaseButtonItem n DevExpress.XtraBars.BarButtonItem n DevExpress.XtraBars.BarButtonItemLink n DevExpress.XtraBars.BarCheckItem n DevExpress.XtraBars.BarCheckItemLink n DevExpress.XtraBars.BarDockControl n DevExpress.XtraBars.BarDockWindow n DevExpress.XtraBars.BarItem n DevExpress.XtraBars.BarItemLink n DevExpress.XtraBars.BarLargeButtonItem n DevExpress.XtraBars.BarLargeButtonItemLink n DevExpress.XtraBars.BarStaticItem

608 Appendix A: Supported Technologies and Controls

n DevExpress.XtraBars.BarStaticItemLink n DevExpress.XtraBars.BarSubItem n DevExpress.XtraBars.BarSubItemLink n DevExpress.XtraBars.PopupMenu n DevExpress.XtraBars.Ribbon.RibbonControl n DevExpress.XtraEditors.BaseButton n DevExpress.XtraEditors.ButtonEdit n DevExpress.XtraEditors.CalcEdit n DevExpress.XtraEditors.CheckButton n DevExpress.XtraEditors.CheckEdit n DevExpress.XtraEditors.CheckedListBoxControl n DevExpress.XtraEditors.ComboBoxEdit n DevExpress.XtraEditors.Controls.CheckedListBoxItem n DevExpress.XtraEditors.Controls.ComboBoxItem n DevExpress.XtraEditors.Controls.ListBoxItem n DevExpress.XtraEditors.DateEdit n DevExpress.XtraEditors.DropDownButton n DevExpress.XtraEditors.FontEdit n DevExpress.XtraEditors.ImageComboBoxEdit n DevExpress.XtraEditors.ImageListBoxControl n DevExpress.XtraEditors.LabelControl n DevExpress.XtraEditors.ListBoxControl n DevExpress.XtraEditors.MarqueeProgressBarControl n DevExpress.XtraEditors.MemoEdit n DevExpress.XtraEditors.MRUEdit n DevExpress.XtraEditors.ProgressBarControl n DevExpress.XtraEditors.RadioGroup n DevExpress.XtraEditors.SimpleButton n DevExpress.XtraEditors.SpinEdit n DevExpress.XtraEditors.TextEdit n DevExpress.XtraEditors.TimeEdit n DevExpress.XtraEditors.TrackBarControl n DevExpress.XtraEditors.XtraTab.XtraTabControl n DevExpress.XtraEditors.ZoomTrackBarControl n DevExpress.XtraGrid.GridControl n DevExpress.XtraTreeList.TreeList

609 Appendix A: Supported Technologies and Controls

Partially supported: n DevExpress.XtraEditors.CheckedComboBoxEdit n DevExpress.XtraEditors.LookupEdit n DevExpress.XtraEditors.PopupContainerEdit n DevExpress.XtraGrid.GridLookupEdit

Eclipse Java SWT Supported: n Button n Canvas n ColorDialog n Composite n Dialog n DirectoryDialog n FileDialog n FontDialog n Group n Label n Layout n List n Menu n MenuItem n MessageBox n ScrollBar n TabFolder n TabItem n Table n TableColumn n TableItem n Text n Tree n TreeItem Partially supported: n CCombo n Combo

610 Appendix A: Supported Technologies and Controls

HTML

Note: QA Wizard Pro supports all HTML4 and earlier elements in the supported versions of Google Chrome, Microsoft Internet Explorer, and Mozilla Firefox. See the QA Wizard Pro System Requirements for a list of supported browsers.

The following HTML5 elements are captured in browsers that support HTML5. Supported: n

n