QA Wizard Pro User Guide v2017 - Perforce

682
QA Wizard Pro User Guide Version 2017.1

Transcript of QA Wizard Pro User Guide v2017 - Perforce

Page 1: QA Wizard Pro User Guide v2017 - Perforce

QA Wizard ProUser GuideVersion 2017.1

Page 2: QA Wizard Pro User Guide v2017 - Perforce

Copyrights© 1996-2017 Perforce Software, Inc. and its subsidiaries. All rights reserved.Defect Scribe, HelixALM, HelixALMSuite, Helix IssueManagement, HelixRequirementsManagement, Helix Test CaseManagement,QAWizard Pro, Resource Thief, SoloBug, SoloSubmit, Surround SCM, and TestTrackare trademarksor registered trademarksofPerforce Software, Inc. and its subsidiaries in the United Statesand other countries.

Acrobat Reader is a registered trademarkof Adobe, Inc. in the United Statesand other countries.

UNIX is a registered trademark in the United Statesand other countries, licensed exclusively through X/Open CompanyLimited.

Apple, Mac, MacOS,macOS,Macintosh, Objective-C, and Safari are registered trademarksof Apple Computer, Inc.

Chrome is a registered trademarkof Google Inc.

Debian is a registered trademarkof Software in the Public Interest, Inc.

Firefox is a registered trademarkof theMozilla Foundation.

Linux is a trademarkof LinusTorvalds.

Microsoft, Windows,WindowsServer,WindowsVista, MSWindows, Active Directory, Internet Explorer, Outlook, SQL Server, VisualSourceSafe, and VisualStudio are either registered trademarksor trademarksof Microsoft Corporation in the United Statesand/orother countries.

openSUSEand SUSEare registered trademarksof Novell Inc. in the United Statesand other countries.

Oracle and Java are registered trademarksof Oracle and/or its affiliates.

Red Hat, Red Hat Enterprise Linux, and Fedora are registered trademarksof Red Hat, Inc. in the United Statesand other countries.

Ubuntu is a registered trademarkof Canonical Ltd.

All other product namesmentioned herein are the trademarksof their respective owners. All other trademarksare the property of theirrespective owners.

No part of this publicationmaybe reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language inany form byanymeanswithout the written permission of Perforce Software, Inc. and its subsidiaries.

Your license agreement with Perforce Software, Inc. or anyof its subsidiaries, which is included with the product, specifies the permittedand prohibited usesof the product. Anyunauthorized duplication or use of this software, in whole or in part, in print, or in anyotherstorage and retrieval system is forbidden.

Information in this document is subject to change without notice and doesnot represent a commitment on the part of Perforce Software,Inc. or anyof its subsidiaries. Unlessotherwise noted, all companies, products, street addresses, and persons contained herein arepurely fictitious. Mention of third-party companiesand products is for informational purposesonly and doesnot constitute anendorsement.

Perforce Software, Inc. and its subsidiaries400 N 1st AvenueSuite 200Minneapolis, Minnesota 55401USA+1 510.864.7400

[email protected]

Page 3: QA Wizard Pro User Guide v2017 - Perforce

Contents

What's New 1Installing QA Wizard Pro 3

Before you install 3

Running the installer 4

After installation 6

Getting Started with QA Wizard Pro 7Key QAWizard Pro concepts 8

Understanding the testing process 9

Starting QAWizard Pro 11

Managing licenses 11

QAWizard 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

Page 4: QA Wizard Pro User Guide v2017 - Perforce

Creating functions and subroutines in Text View 32

Setting Text View font and color options 34

Customizing QA Wizard Pro 35Customizing the interface 35

Customizing toolbars 36

Creating toolbars 37

Adding toolbar andmenu commands 37

Modifying toolbar andmenu commands 38

Setting toolbar andmenu options 38

Customizing keyboard shortcuts 39

Setting general options 40

Setting server connection options 43

Setting email notification options 44

Managing Applications 47Adding 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 57About 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 65Recording new scripts 65

Selecting the default web browser 68

Recording additional script steps 69

ii

Page 5: QA Wizard Pro User Guide v2017 - Perforce

Recording low-level actions 70

Adding new scripts 71

Understanding recorded scripts 71

Running Scripts to Perform Tests 73Running scripts 73

Setting and running amain 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

Runningmultiple 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 89Viewing 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 103Recording load test scripts 103

Running load tests 104

Running load tests from a command prompt 106

Viewing load test results reports 109

Stress Testing 111Creating and running stress tests 111

Applying stresses 112

Managing Windows and Controls 115Capturing window and control data 115

Reviewing and saving repository changes 116

Repository change reasons 118

iii

Page 6: QA Wizard Pro User Guide v2017 - Perforce

About smart matching 118

Overriding naming conventions for new controls 119

Default control naming convention 121

Modifying window and control properties 122

About searchmethods 124

Changing standard search criteria 124

Editing window and control properties 126

Using regular expressions 127

Changing the searchmethod for multiple controls 128

Using the Function searchmethod 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

Synchronizingmultiple scripts with the application repository 144

Testing context menus 144

Modifying Scripts 145Adding 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

Page 7: QA Wizard Pro User Guide v2017 - Perforce

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 165Checkpoint 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 181Creating OCR checkpoints 183

Troubleshooting OCR issues 186

Creating Data-Driven Scripts 187About datasheets 187

Creating local datasheets 187

Adding existing local datasheets 188

Importing external test data 189

Linking to external test data 189

v

Page 8: QA Wizard Pro User Guide v2017 - Perforce

Configuring external datasheets 190

CreatingMicrosoft Access datasheets 190

CreatingMicrosoft Excel datasheets 192

CreatingMicrosoft 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 database 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 211Running scripts in debugmode 211

Using breakpoints 212

Using the INDEBUGMODE variable 213

Troubleshooting variables 213

Using Repository Variables 215Creating 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

Page 9: QA Wizard Pro User Guide v2017 - Perforce

Testing Dynamic Web Applications 223About XPath queries 223

Using the XPath searchmethod 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 233Supported nested controls 233

Adding statements to test nested controls 233

Nested control object action examples 234

Testing HTML Tables 237Adding 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 249Configuring remote computers 249

Starting QAWRemote.exe 250

Running scripts remotely 250

Runningmultiple scripts remotely 251

Managing the QA Wizard Pro Server 253Installing the QAWizard Pro Server 253

Starting the QAWizard Pro Server 254

Starting the QAWizard Pro Server Admin Utility 254

Configuring general server options 254

vii

Page 10: QA Wizard Pro User Guide v2017 - Perforce

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 theQAWizard Pro Server 262

Integrating with Helix ALM 265Configuring 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

Page 11: QA Wizard Pro User Guide v2017 - Perforce

Integrating with Source Control Tools 285Configuring 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 303Understanding 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 Databases 317Setting upOracle databases 317

Setting up PostgreSQL databases 318

Setting up SQL Server databases 318

Troubleshooting RDBMS connections 319

ix

Page 12: QA Wizard Pro User Guide v2017 - Perforce

Statements 321Application 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

QAWizard 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

Page 13: QA Wizard Pro User Guide v2017 - Perforce

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

Page 14: QA Wizard Pro User Guide v2017 - Perforce

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...LoopWhile 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

Page 15: QA Wizard Pro User Guide v2017 - Perforce

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

Page 16: QA Wizard Pro User Guide v2017 - Perforce

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

Page 17: QA Wizard Pro User Guide v2017 - Perforce

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

Page 18: QA Wizard Pro User Guide v2017 - Perforce

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

Page 19: QA Wizard Pro User Guide v2017 - Perforce

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

Page 20: QA Wizard Pro User Guide v2017 - Perforce

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

Page 21: QA Wizard Pro User Guide v2017 - Perforce

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

Page 22: QA Wizard Pro User Guide v2017 - Perforce

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

Page 23: QA Wizard Pro User Guide v2017 - Perforce

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

Page 24: QA Wizard Pro User Guide v2017 - Perforce

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

QAWizard Pro environment variables 605

Appendix A: Supported Technologies and Controls 607Appendix B: Run Results Email Field Codes 631Appendix C: Third-Party Software Licenses 633Glossary 635Index 639

xxii

Page 25: QA Wizard Pro User Guide v2017 - Perforce

What's NewQAWizard Pro 2017.1 includes the following key features. For a complete list of features, enhancements, andbug 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, youmay need to change thesearchmethod used. You can now switch to amore accurate searchmethod for multiple controls at the sametime without manually updating properties of each control. See Changing the searchmethod for multiplecontrols, 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 SQLitedatabases for use in data-driven scripts. See Creating PostgreSQL datasheets, page 197 and CreatingSQLite 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 defaultplayback options to control the contrast, image scale, grayscale conversion, and language file used to readgraphical text in applications. See Using OCR toWork with Graphical Text, page 181 and Setting playbackoptions, page 76.

You can also use new OCR statements in scripts to adjust these options. SeeOCR 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 theapplication or cannot be displayed during recording, you can now manually add them to the applicationrepository to use them in scripts. This lets you create scripts that test new controls before they areimplemented in the application if you use a test-driven development process. It can also help save time whenyou 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, andWebSetCustomHeader, page 588.

Other enhancements

n To quickly locate source files on the computer, you can now right-click a file in theWorkspace pane andchooseOpen Containing Folder.

n Use the SetAllFilesReadOnly, page 539 and SetFileReadOnly, page 543 statements to allow or preventscripts frommodifying files.

1

Page 26: QA Wizard Pro User Guide v2017 - Perforce

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 395statement 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 renamedHelix ALM. The integration works the same as in previous QAWizard Proversions. Existing scripts work with both Helix ALM and earlier TestTrack versions.

Seapine License Server was renamedHelix ALM License Server. Seapine ALM DataWarehouse wasrenamedHelix ALM DataWarehouse.

2

Page 27: QA Wizard Pro User Guide v2017 - Perforce

Installing QA Wizard ProPerform the following tasks to install QA Wizard Pro.

1. Review important information to consider before installing QAWizard 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 QAWizard Pro and automated testing to help you get started. See Afterinstallation, page 6.

4. If you are an administrative user installing the QAWizard Pro Server and dashboard, configure serveroptions and the web server to host the dashboard. See After installation, page 6.

Before you installReview the following information before installing QAWizard Pro.

System requirements

Perform the following tasks tomake sure the computer you are installing onmeets the system requirements.

n Review the recommended system requirements. If you are installing the QAWizard Pro Server, reviewthe server recommendations attached to the system requirements.

n Check for and install all availableWindows updates. The computer needs the latest updates to installadditional resources required by QAWizard Pro, such as theMicrosoft Visual C++ redistributablepackage.

n Make sure you are amember of the local Administrator group on the computer you are installing QAWizard Pro on. If you do not have local administrative rights, youmay be prompted to enter a serial numberevery timeQAWizard Pro starts and youmay not be able to record scripts. Contact your systemadministrator for help.

Windows 8 support

To test Windows 8 applications, youmust 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 WizardPro on 64-bit Windows).

Server database

TheQAWizard 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 orconfiguration. You can also use aMicrosoft SQL Server, Oracle, or PostgreSQL database, but youmustcreate an empty database before configuring the QAWizard Pro Server. See Setting UpRDBMS Databases,page 317.

Web server for dashboard

Before installing the QAWizard Pro dashboard, make sureMicrosoft Internet Information Services (IIS) isinstalled and enabled on the same computer that hosts the QAWizard Pro Server. See theWindows help forinformation.

3

Page 28: QA Wizard Pro User Guide v2017 - Perforce

Running the installer

Upgrades

Before upgrading the QAWizard Pro Server, back up the server database and global application repository.See Backing up theQAWizard Pro Server, page 262.

Note: TheQAWizard Pro Server is only compatible with the same version of QAWizard Pro applications.If you are upgrading the server, make sure users also upgradeQAWizard Pro applications so they cancontinue to send playback data to the server and access the global application repository.

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

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

Usage statistics

During installation, you can choose to allow QAWizard Pro to send usage statistics to Perforce. See Settinggeneral 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 QAWizard Pro application. Includes a run-timemode, which is used withrun-time licenses that only provide access to run scripts.

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

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

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

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

4

Page 29: QA Wizard Pro User Guide v2017 - Perforce

Running the installer

Component Description

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

BugReport.exe andWysiCRM.exe

Sample applications used by the sample scripts.

QA Wizard Pro Server

TheQAWizard Pro Server (QAWServer.exe) stores global application data and hosts the server database. Itis required to use the global repository, dashboard, status tool, and Helix ALM DataWarehouse integration.

Only an administrative user needs to install the server on a networkedWindows computer. The server adminutility (QAWServerAdmin.exe), which is used tomanage the server, is also installed. SeeManaging the QAWizard Pro Server, page 253.

Dashboard

The dashboard lets youmonitor 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 QAWizard 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 notrequire a license and can be installed on any computer to help youmonitor local and remote scripts during andafter playback. A connection to the QAWizard Pro Server is required. See Viewing playback information inthe status tool, page 99.

Installation directories

QAWizard Pro components are installed in the following directories by default.

Component Default directory Notes

QAWizard Proapplications andstatus tool

32-bit Windows—C:\ProgramFiles\Perforce\QA Wizard Pro64-bit Windows—C:\Program Files(x86)\Perforce\QA Wizard Pro

You can select a different application directorywhen running the installer. To test Windows 8applications, the default directory must beused.

Server databaseand globalapplicationrepository

QAWServer in the computer's rootdirectory (e.g, C:\QAWServer)

Directory is automatically created when theserver is installed.

Dashboard files C:\InetPub\wwwroot\qawdashboard Only change this directory if you are familiarwith creating virtual directories on the webserver.

5

Page 30: QA Wizard Pro User Guide v2017 - Perforce

After installation

After installationReview the following information to set up and useQAWizard Pro after installation.

Users

Review information to learn about using QAWizard Pro. SeeGetting Started with QAWizard Pro, page 7.

Server administrators

Make sure the QAWizard Pro Server service is running and then use the admin utility to configure serveroptions. SeeManaging the QAWizard Pro Server, page 253.

If you also installed the dashboard, configure the web server so users can access it. See Installing andconfiguring the dashboard, page 97.

6

Page 31: QA Wizard Pro User Guide v2017 - Perforce

Getting Started with QA Wizard ProQAWizard Pro records actions you perform as you interact with a web, Windows, or Java application andadds them as steps in scripts used to automate testing. After recording scripts, you canmodify them tomakesure they perform all actions required to complete a test. When you are ready to perform tests, run scripts andthen review the results in a detailed report. This gives you all the information needed to verify tests and reportissues to the development team.

Before you start

Review the following information to learnmore about QAWizard Pro and automated testing.

n Key QAWizard Pro concepts provides an overview of common terminology and concepts you should befamiliar with before using QAWizard Pro.

n Understanding the testing process provides information about QAWizard Pro concepts in context of theautomated testing process.

n QAWizard Pro Best Practices provides recommended guidelines that can help you avoid commonmistakes 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 helpinstalling QAWizard Pro, see Installing QAWizard Pro, page 3.

1. Start QA Wizard Pro and add your license.

2. Get familiar with the QAWizard Pro interface.

Tip: You can use the SampleScripts workspace installed with QAWizard Pro to view sample webandWindows scripts and experiment with QA Wizard Pro functionality before setting up your owntests. 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 windowsand controls to the repository.

6. Run scripts to perform tests. During playback, QAWizard Pro compares the tested application againstthe 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 theoverall status of the playback session.

Taking it to the next level

After you becomemore familiar with QAWizard Pro, you can perform the following tasks to createmorecomplex tests.

n Modify scripts to add or edit statements that perform actions during playback.

n Use checkpoints to verify application attributes.

7

Page 32: QA Wizard Pro User Guide v2017 - Perforce

Key QA Wizard Pro concepts

n Create data-driven scripts to runmultiple iterations of the same test using different sets of data fromdatasheets.

n Modify window and control properties to optimize tests andmanage changes to the application.

n Debug scripts to troubleshoot errors.

n Install and configure the QAWizard Pro Server to use the dashboard and status tool to monitor playback oruse the global application repository to provide application data to other users.

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

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 savedin the repository. When you run a script, the information is used to find windows and controls and performactions 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, youmay use oneworkspace for each application or for each functional area you are testing. You can create folders to organizefiles in workspaces.

See Creating workspaces, page 23.

Scripts

Scripts contain statements, which are instructions that control how a script runs and performs actions in thetested application. For example, you can call other scripts, declare variables, specify steps to run based onconditions, 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. Youcan alsomanually create scripts. To perform a test, you run a script andQAWizard Pro performs the actionsspecified in statements in the application. Playback fails if a bug is found in the tested application or if there isa 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 scripting language. SeeUsing 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 isstored in a separate file, which is a datasheet. Datasheets are stored in workspaces with scripts and otherrelated test files.

8

Page 33: QA Wizard Pro User Guide v2017 - Perforce

Understanding the testing process

QAWizard Pro supports local and external datasheets. You can create test data in a local datasheet, which isa simple spreadsheet created in QAWizard Pro and stored locally. You can also link to external test datastored inMicrosoft Access, Microsoft Excel, Microsoft SQL Server, Oracle, PostgreSQL, SQLite, or textfiles.

See About datasheets, page 187.

Checkpoints

Checkpoints help you verify the tested application is working as expected. Checkpoints are statements inscripts used to verify that attributes of an application exist or are correct when compared to an expected valueduring playback.

See Using Checkpoints, page 165.

Reports

QAWizard Pro generates and saves a results report after a script runs. The report includes information aboutthe script, such as the test computer configuration and how long it took the script to run. Reports are stored inworkspaces with scripts and other related test files. See Viewing results reports, page 75.

You can alsomonitor scripts in real-time using the dashboard and status tool, which display local and remotescript information during playback. You canmonitor scripts from any location, such as at home or anotheroffice. See Viewing playback information in the dashboard, page 90 and Viewing playback information in thestatus tool, page 99.

Understanding the testing processAutomated testing with QAWizard Pro involves setting up and planning tests, recording, modifying, andrunning 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 performedmultiple times, evaluates high-risk conditions, requires testingmultiple data valuesfor the same actions, is expensive or impossible to perform manually, or needs to be performed ondifferent hardware or software configurations.

n Set up the testing environment—Make sure you have access to the hardware, software, and networkresources that you need to record or run tests.

n Create a workspace—Workspaces organize scripts and related reports and datasheets. Depending onyour organization's process, youmay 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 aboutthe tested application and version. Each version contains window and control data that identifies andlocates objects. SeeManaging Application Repositories, page 57.

n Set general and playback options—Take a few minutes to set general options that control how QAWizard Pro works and set playback options that control how scripts run. See Setting general options, page40 and Setting playback options, page 76.

9

Page 34: QA Wizard Pro User Guide v2017 - Perforce

Understanding the testing process

n Configure Helix ALM and source control integration (optional)—Integrate QAWizard Pro with HelixALM to submit issues when tests fail andmanage issues and other testing tasks. See Integrating withHelix ALM, page 265. Integrate with Surround SCM or another source control application tomanagechanges to workspaces, scripts, and local datasheets. See Integrating with Source Control Tools, page285.

Recording

You can record two types of scripts: standard QAWizard Pro scripts used for functional and regressiontesting and load test scripts used for testing performance under load.

When you record a standard QAWizard Pro script, you interact with the application or web site exactly as auser would andQAWizard Pro adds the actions to the script. When you record a load test script, you alsointeract with the web application exactly as a user would but QAWizard Pro adds the information exchangedbetween the application and server to the script. See Recording Scripts, page 65 and Recording load testscripts, page 103.

Modification

Recorded scripts provide a baseline for application testing. You canmodify recorded scripts to createmoreflexible scripts and complex testing scenarios. In addition to recording additional steps, andmodifying ordeleting steps, you can enhance scripts by:

n Adding statements—Statements are instructions in each step that control how the script runs. Forexample, you can call other scripts, declare variables, specify steps to run based on conditions, or repeata block of steps. See Statements, page 321.

n Creating checkpoints—Checkpoints verify that the value of a property in a window or control matches anexpected value during playback. See Using Checkpoints, page 165.

n Creating data-driven scripts—Data-driven scripts are the easiest way to createmultiple 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. SeeCreating Data-Driven Scripts, page 187.

Tip: You canmodify scripts in Keyword View or Text View. Keyword View displays scripts in a gridformat, while Text View displays scripts in a text-based editor and also provides access to the scriptinglanguage. 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 QAWizard Pro scripts, the testedapplication is compared to the information stored in the application repository. During playback of load testscripts, the web application is run under a simulated load of users.

QAWizard Pro provides several ways to run scripts. You can run an individual script or multiple scripts, runscripts from a command prompt, run scripts on a remote computer, or run scripts in a batch file to performunattended 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 troubleshoota script by debugging it, which allows you to step through a script to locate the problem. You can also step intoa called script to debug it. See Running scripts in debugmode, page 211.

10

Page 35: QA Wizard Pro User Guide v2017 - Perforce

Starting QA Wizard Pro

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

Analysis

After scripts run, QAWizard Pro generates and saves a report that summarizes the test results. The reportcontains information about failed script steps, how long the script took to run, and the test computerconfiguration. Use this information to determine if problems exist in the application or if you need tomodify thescript. 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 anddevelopment time and ensures all teammembers have the information they need to perform their assignedtasks. See Adding Helix ALM issues from run reports, page 278.

Starting QA Wizard ProChooseStart > All Programs > Perforce > QA Wizard Pro > QA Wizard Pro.

Managing licensesYoumust enter at least one serial number before you can useQAWizard Pro. SeeQAWizard Pro Pricing andLicensing for information about licensing.

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

1. Choose Tools > Licensing.

TheManage 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 isalso displayed.

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

Tip: You canmove and hide panes to display only information you need in your preferred layout. SeeCustomizing the interface, page 35.

11

Page 36: QA Wizard Pro User Guide v2017 - Perforce

QA Wizard Pro interface

# Area Use to:

Toolbars Access themost commonly usedQAWizard Pro actions. To display or hide a toolbar,chooseView > Toolbars and the toolbar name. You can also add buttons to toolbarsand create custom toolbars. See Customizing toolbars, page 36.

Workspacepane

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

Reportspane

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

Statementspane

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

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

Add/EditStatementdialog box

Add and edit statements in scripts. Available in both Keyword View and Text View.See Adding statements, page 146.

12

Page 37: QA Wizard Pro User Guide v2017 - Perforce

Application Repository pane

# Area Use to:

Previewpane

Preview application screenshots captured during playback. See Preview pane, page16.

ApplicationRepositorypane

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

Referencespane

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

FindResultspane

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

Call Stackpane

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

HelixALM itempanes

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

Variablespane

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

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

Outputpane

View information based on instructions you add to scripts. For example, as a scriptruns, youmay want to capture a value from the tested application and print it in theOutput pane. SeeOutput pane, page 15.

PendingChangespane

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

Application Repository paneTested applications, versions, and windows and controls are stored in the application repository. Duringrecording, QAWizard Pro captures information about the application's windows and controls and adds it to thecorresponding application and version repository. During script playback, QAWizard Pro compares thewindow and control properties in the repository to the tested application to locate objects.

13

Page 38: QA Wizard Pro User Guide v2017 - Perforce

Call Stack pane

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

Call Stack paneDisplays 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 erroroccurred and view the script you are working in when using the stack to debug scripts. See Running scripts indebugmode, page 211.

Note: You can also use the GetCallStack statement in scripts to retrieve stack information. SeeGetCallStack, 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 chooseCopy. This is helpful if youwant to add the information to a Helix ALM issue or email it to another teammember.

14

Page 39: QA Wizard Pro User Guide v2017 - Perforce

Errors pane

Errors paneDisplays script syntax errors and errors and warnings that occur during script playback. Each error identifiesthe 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 inthe application repository or dialog boxes where youmay be able to resolve the issue.

Tip: Right-click the error and chooseCopy to copy the error information. This is helpful if you want to addthe information to a Helix ALM issue or email it to another teammember.

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 thatoccurred but were handled in the script without stopping playback.

n Show warnings displays the warnings that youmay want to investigate but did not cause the script tofail.

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

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

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

15

Page 40: QA Wizard Pro User Guide v2017 - Perforce

Pending Changes pane

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

Pending Changes paneWhen source control integration is enabled, all modified, checked out, and new files in the workspace aredisplayed in the Pending Changes pane. You can select a file and check it in, undo the check out, or viewdifferences between the local file and the file on the source control application server. See Integrating withSource Control Tools, page 285.

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

16

Page 41: QA Wizard Pro User Guide v2017 - Perforce

References pane

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

References paneDisplays 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 inscripts, page 153.

Reports paneDisplays the reports generated after running a script if the playback option to automatically generate a report isset. 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

Page 42: QA Wizard Pro User Guide v2017 - Perforce

Script pane

Script paneThe Script pane is themain area where you work with scripts, reports, and datasheets. This pane includes aKeyword 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,whichmakes it easy to create and edit statements, modify scripts, and add advanced logic to scripts. SeeUsing Text View, page 28.

18

Page 43: QA Wizard Pro User Guide v2017 - Perforce

Statements pane

Working with multiple itemsYou can openmultiple scripts, datasheets, and reports to work with them at the same time. Use the followingoptions to navigate between open items.

n To view all open items whenmore tabs than can be displayed are open, click in the upper-right corner ofthe 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 orNewVertical Tab Group. Tomove an item to a different tab group, right-click it and choose the group tomoveit to.

n To go to the previous or next location you were working in, click theGo Back orGo Forward toolbarbutton. You can also chooseScript > Go Back orGo Forward. QA Wizard Pro keeps track of the cursorlocation when you switch between scripts and script lines, go to definitions, find and replace text inscripts, debug scripts, and double-click errors in the Errors pane. You can go back or forward up to the 10most recent locations.

n To close items, right-click the tab and select Close, Close All, orClose Other Tabs. You can also clickin the upper-right corner of the pane to close the open item.

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

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

19

Page 44: QA Wizard Pro User Guide v2017 - Perforce

Helix ALM panes

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

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

20

Page 45: QA Wizard Pro User Guide v2017 - Perforce

Workspace pane

Workspace paneOrganizes 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 amain 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 theresults. To find a file in the workspace on the computer, right-click it and chooseOpen ContainingFolder.

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 datamaintained in QA Wizard Pro

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

21

Page 46: QA Wizard Pro User Guide v2017 - Perforce

Sample scripts and applications

Sample scripts and applicationsYou can use the sample scripts, datasheets, and applications installed with QAWizard Pro to understandhow 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

BugReporter

Windows application with a form forsubmitting software bug reports.

C:\Program Files (x86)\Perforce\QAWizard Pro\BugReport.exe

SampleMSPaint

Windows application for drawing shapes andimages.

C:\Windows\System32\mspaint.exe

WysiCorpCRM

Windows .NET application with forms formanaging customer records.

C:\Program Files (x86)\Perforce\QAWizard Pro\Wysi_CRM.exe

WysiCorpWeb Site

Web site with a form for submitting softwarebugs.

Version 1.0—www.wysicorp.com/wysicorp/login.phpVersion 2.0—www.wysicorp.com/home.html

Workspace

The SampleScripts workspace includes scripts and datasheets used to perform various tests against thesample applications.

The Test Suite script is set as themain script in the workspace. It runs a series of other sample scripts thatperform individual tests as part of a complete test suite. You can run themain script without opening it,making it easy to quickly run all scripts in the suite. See Setting and running amain script, page 74.

The workspace includes additional sample scripts organized in the following folders.

Folder Includes scripts that runagainst:

Used to:

BasicScripts

Bug Reporter, SampleMSPaint, WysiCorp CRM, andWysiCorpWeb Site

Perform simple actions to test common user tasks.

Data-DrivenScripts

WysiCorp CRM andWysiCorp Web Site

Runmultiple iterations of the same test with different setsof data from theWysiCorp Bugs Excel file orWysiCRM Contacts datasheet.

AdvancedScripts

Bug Reporter, WysiCorp CRM,andWysiCorpWeb Site

Demonstrate advanced procedures and functions.

To open the workspace, choose File > Open Workspace and select theSampleScripts.qawwspace file inthe C:\Users\<username>\Documents\QA Wizard ProWorkspaces\SampleWorkspace directory.

22

Page 47: QA Wizard Pro User Guide v2017 - Perforce

Creating workspaces

Creating workspacesWorkspaces are used to organize scripts, related run reports, and any test data. All the files associated with aworkspace 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 ofthem as test scenarios. For example, you are creating a regression suite forWysiWrite. One of the areas youwill test is the Tools menu, which contains eight options. To stay organized, create a folder forWysiWrite anda subfolder for the Tools menu and then create workspaces and subdirectories in the QAWizard ProWorkspaces directory for each option on the Tools menu. Your use of workspaces depends on yourorganization's testing process.

Note: Youmust 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\<username>\Documents\My Documents\QA Wizard ProWorkspaces 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 localdatasheets, to workspaces. See Adding existing files to workspaces, page 23 and Adding existinglocal datasheets, page 188.

Adding existing files to workspacesYou can add existing files to a workspace to group related files. This helps ensure all required test files areavailable when scripts run. For example, you can add scripts from other workspaces, text files used to logscript information, images used in checkpoints or comparisons, load test .postdata files, and externaldatasheets that are stored locally to a workspace.

When you add an existing file, it is shared and not copied. Any changes youmake to the file are available in allworkspaces 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

Page 48: QA Wizard Pro User Guide v2017 - Perforce

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 chooseOpen Containing Folder.

Using foldersYou can create folders to organize the scripts, batches, and datasheets in a QAWizard 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

Page 49: QA Wizard Pro User Guide v2017 - Perforce

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 runwithout failing, choose File > Add Existing File. See Adding existing files to workspaces, page 23.

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

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

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

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

Modifying workspace propertiesYou can change the workspace name and directory to store results reports in, and set Helix ALM and sourcecontrol integration options.

1. Select the workspace in theWorkspace pane.

2. Choose File > Properties.

The Properties dialog box opens with the General tab selected.

25

Page 50: QA Wizard Pro User Guide v2017 - Perforce

Opening workspaces

3. Optionally enter a new Name.

4. Enter aReports 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 alocation.

6. Click theHelix ALM tab tomodify the integration options. See Integrating with Helix ALM, page 265.

7. Click the Source Control tab tomodify the integration options. See Configuring source controlintegration, page 285.

8. Click OK to save the changes.

Opening workspacesOpen a workspace to access scripts, related run reports, and test data.

Keep the following inmind:

n Only one workspace can be open at a time.

n If the workspace is formatted for an earlier QAWizard Pro version, you are prompted to upgrade it or openit as read-only. Click Upgrade Workspace to upgrade it to the current version. The workspace file cannotbe reverted back after upgrading. Click Open as Read-Only to open it as read-only. You cannot modifyread-only workspaces.

n If the workspace is in an unknown format, you cannot open it. It was most likely created in a newer versionof QAWizard Pro than the one you are using. You need to upgrade to the current QAWizard Pro version toopen it.

1. Choose File > Open Workspace.

TheOpenWorkspace 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

Page 51: QA Wizard Pro User Guide v2017 - Perforce

Using Keyword View

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

Tip: If you are a new QAWizard Pro user, youmay want to work in Keyword View to become familiar withthe program.

Actions are grouped by the window they are performed on. The following information is displayed in the rowsand 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 theGUI statement editor to work with statements in Keyword View. To add a statement, chooseScript> Add Statement. To edit a statement, chooseScript > Edit Statement.

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

27

Page 52: QA Wizard Pro User Guide v2017 - Perforce

Using Text View

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

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

Use one of the followingmethods to work with statements in Text View.

n Use theGUI statement editor. To add a statement, chooseScript > Add Statement. To edit a statement,chooseScript > Edit Statement. If you are a new QAWizard Pro user, youmay want to use the GUIstatement 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 andWindows scripts is installed with QAWizard Pro.To learnmore about Text View, youmay want to open a sample script, read the comments, andexperiment 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 thescript. Keep the following inmind:

n Each statement must be on one line.

n Enclose text string values in double quotationmarks (e.g., "TextString").

n Do not use any quotationmarks with variable or numeric values.

n To specify amenu 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

Page 53: QA Wizard Pro User Guide v2017 - Perforce

Declaring variables in Text View

n Slashes inmenu, 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("CharacterList/Backslash - \\\\").Select().

n The scripting language is not case sensitive, with the following exceptions: when comparing strings inconditional 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 aredisplayed 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 thefunction to use. Double-click the function or press Enter to add it to the script. Many functions are alsoavailable 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 andclick 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 listchange based on the selected window or control. Scroll through the list to select the action or object youwant 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. Forexample, Browser("WysiCorp Login").

n Enter Window, a window name in quotes, and a period to display a list of window control types, such asButton 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 todisplay a list of control type actions, such as Click or TypeText. For example, Window("Feedback").Editbox("editboxCompany").

Declaring variables in Text ViewQAWizard 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 runagainst 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 valuefrom an associated datasheet.

29

Page 54: QA Wizard Pro User Guide v2017 - Perforce

Declaring variables in Text View

Variables can be explicitly declared using the Dim statement. Variables can also be implicitly declared byassigning 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 laterassigned a text string.

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

If you create a variable called by other scripts, the variable namemust 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 inmind:

n If a script is called several times in one run, the values stored in the variables are persistent. The secondtime the script is called, the variables are populated with the values from when the script exited the firsttime.

n Called scripts use the repository variable values from the script that called them unless they are declaredexplicitly or the ClearContext statement is used to clear the connection to the repository in the calledscript.

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

Page 55: QA Wizard Pro User Guide v2017 - Perforce

Declaring arrays in Text View

Tip: As you work with a script, you can view a list of variables, functions, and subroutines defined in thescript in the Definition field at the top of the Script pane. To go directly to the script line where a variable isdefined, select it in the Definition field or right-click a script line that references it and chooseGo 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 sameworkspace, youmust first call that script using the Script.CallScript, page 528 statement. You do not have toimmediately use the variable.

For example, you create a variable namedUser in the Login script. You want to use the User variable in a newscript 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 toaccess another script and work with variables.

Declaring arrays in Text ViewAn array is a variable that contains a series of values. The variable value can be a text string, expression, orvalue from an associated datasheet.

Variables can be declared explicitly or implicitly. Youmust use the Dim statement to declare array variablesexplicitly. 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 thelast is the number specified when declaring the array.

QAWizard Pro supports arrays with up to three dimensions. To declaremultiple dimensions, separate thenumbers with commas. In the following example, the TestTable variable is a two-dimensional array thatincludes 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 isthe 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) wasdeclared 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 youmust reference each dimension. For example:

31

Page 56: QA Wizard Pro User Guide v2017 - Perforce

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 wantto 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 ReDimstatement 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 ViewYou can define functions and subroutines to organize and structure scripts for easier maintenance. Youmaywant 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 aremost often created in scripts calledby other scripts. You can also createmultiple functions or subroutines in the called script.

If you store functions or subroutines in a script called by other scripts, the script namemust conform to thefollowing 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 thescript in the Definition field at the top of the Script pane. To go directly to the script line where a function orsubroutine is defined, select it in the Definition field or right-click a script line that references it and chooseGo To Definition. See Finding variable, function, and subroutine definitions in scripts, page 153. You canthen click theGo Back and Go Forward toolbar buttons to navigate back and forward through the areasyou worked in.

32

Page 57: QA Wizard Pro User Guide v2017 - Perforce

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 numberof arguments andmust always return a value. You can define the return value to be whatever you need. Theexpression is evaluated and results are returned to the calling statement or script. Functions are generallyassigned 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 functionname. 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 functionnamed 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, youmust 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 orsubroutine, enter the called script name, a period, then the function or subroutine name:ScriptName.FunctionName/SubroutineName

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

33

Page 58: QA Wizard Pro User Guide v2017 - Perforce

Setting Text View font and color options

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

Utilities.WebLogin()

Setting Text View font and color optionsThese options control the font and colors used in Text View.

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click the Text View tab.

3. Select the Font andSize to use for all items displayed in Text View.

4. Select aDisplay item andmake any changes. A preview of the color and style is displayed in the Samplearea.

n Select an Item foreground and Item background color from the list or click to select a customcolor. Select Same as Plain Text to set the foreground color to match the color for plain text (LineNumbers, CollapsedOutline Block, Comment, Current Statement (Debug), Keyword, String, andSyntax Error only). Select Default to use the QAWizard Pro default color.

n Select Bold, Italic, orUnderline 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 QAWizard Pro default values.

6. Click OK to save the changes.

34

Page 59: QA Wizard Pro User Guide v2017 - Perforce

Customizing QA Wizard ProYou can customize the QAWizard Pro interface, toolbars, and keyboard shortcuts to suit your personalpreference and help you work more efficiently.

Customizing the interfaceQAWizard Pro's advanced docking systemmakes it easy to customize the layout of panes and windows.You can close, dock and undock, auto hide, float, andmove panes. The Script pane cannot bemodified.

Note: ChooseView > Reset Layout to reset the QAWizard Pro interface.

Auto hiding panes

Auto hide allows unused panes to be hidden and conserve screen space for other panes and windows. Autohide 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 barand chooseAuto 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 alsoright-click the pane title bar and chooseAuto 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 andchoose Floating.

2. Double-click the pane title bar to redock the pane.

Moving panes

You canmove 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

Page 60: QA Wizard Pro User Guide v2017 - Perforce

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 themost workspace for other windows, youmay want to hide panes you do not use.

1. To hide a pane, right-click the pane title bar and chooseHide.

2. To view a hidden or closed pane, chooseView and click the pane name.

Customizing toolbarsThe default toolbar, which is namedMain, includes buttons for themost commonly used commands. You canadd or remove buttons to the toolbar or create your own custom toolbars. You can also display or hide otherbuilt-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 chooseView > 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

Page 61: QA Wizard Pro User Guide v2017 - Perforce

Creating toolbars

7. Click Close to save the changes.

Creating toolbarsYou can create toolbars to access the commands you usemost 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 theCommands tab in the Customize Toolbar dialog box to add commands to thetoolbar. See Adding toolbar andmenu commands, page 37.

Adding toolbar and menu commandsYou can customize the commands available on toolbars andmenus.

1. Choose Tools > Customize Toolbars.

2. Click theCommands 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

Page 62: QA Wizard Pro User Guide v2017 - Perforce

Modifying toolbar and menu commands

5. Click Rearrange Commands to change the command order andmodify button andmenu itemappearance. SeeModifying toolbar andmenu commands, page 38.

6. Click Closewhen you finish.

Modifying toolbar and menu commandsYou can rearrange andmodify toolbar buttons andmenu commands.

1. Choose Tools > Customize Toolbars.

The Customize dialog box opens.

2. Click theCommands tab.

3. Click Rearrange Commands.

The Rearrange Commands dialog box opens.

4. Select theMenu 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 andmenu commands, page 37.

6. Select a command and click Move Up orMove Down to move it.

7. Select a command and click Modify Selection to modify the name, image, text and image displayoptions, or position in a group of related commands.

8. Select a command and click Delete to delete it.

9. Click Reset to reset themenu or toolbar to the default state.

10. Click Close to save the changes.

Setting toolbar and menu optionsYou can customizemenu and toolbar appearance.

1. Choose Tools > Customize Toolbars.

2. Click theOptions tab.

38

Page 63: QA Wizard Pro User Guide v2017 - Perforce

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 namewhen hovering the cursor overbuttons.

Select Show shortcut keys in ScreenTips to include the command keyboard shortcut in the screen tip.

5. Select aMenu Animation to use whenmenus 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 toQAWizard Pro.

Customizing keyboard shortcutsYou can specify shortcut keys for most QAWizard Pro commands.

1. Choose Tools > Customize Toolbars.

2. Click Keyboard.

The Customize Keyboard dialog box opens.

39

Page 64: QA Wizard Pro User Guide v2017 - Perforce

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 thecommand.

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 optionsSet general options to specify preferences for startup, recording or running scripts, and working with files inQAWizard Pro.

1. Choose Tools > Options.

TheOptions dialog box opens.

40

Page 65: QA Wizard Pro User Guide v2017 - Perforce

Setting general options

2. Select any options on theGeneral tab.

Option Use to:

ShowWelcome toQAWizardPro at startup

Automatically display the welcome dialog box when you start QA Wizard Pro.

Open lastworkspace bydefault atstartup

Automatically open the last used workspace when you start QA Wizard Pro. Do notclear this option if you generally use the sameworkspace.

Allow editing ofread-only files

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

Updatepreviewimages whenrecording

Always update screenshots captured during recording.

Send usagestatisticsto Perforce

Send information about the QAWizard Pro installation to Perforce. This informationhelps us improveQAWizard Pro and solve application issues. See Usage statistics,page 42.

Default scripteditor view

Set Keyword View or Text View as the default to open scripts in. Select the view youmost frequently use.

41

Page 66: QA Wizard Pro User Guide v2017 - Perforce

Setting general options

Option Use to:

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

Use SSLencryption forChromeextensioncommunication

Always use SSL encryption when testing web applications in Google Chrome. Whenenabled, a self-signed certificate is automatically added to the browser Trusted RootCertification Authorities store the first time you record or run a script in Chrome. SSLencryption is required for ChromeHTTPS support.

Only clear this option if your company enforces trusted certificate authorityrestrictions and you do not want QAWizard Pro to add root certificates to thecertificate store. The root certificate is automatically removed from the store whenSSL encryption is disabled. Youmust close all instances of Chrome and restart QAWizard Pro for changes to SSL encryption to take effect.

Not available onWindows Vista.

3. Click OK to save the changes.

Usage statisticsIf you choose to send usage statistics to Perforce, QAWizard Pro encodes the following information andsends it to a Perforce server periodically.

n Unique user ID—An ID used to identify each installation. Does not include any information that identifiesyour company or users.

n QAWizard Pro version—Software version installed on the computer.

n Operating system and version—Windows version and service pack installed on the computer.

n Hardware information—Computer processor and speed, amount of installed RAM, and whether thehardware is 32-bit or 64-bit.

n License information—QAWizard 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 ifthe global application repository is used.

n Number of applications and versions—Number of Windows, web, and Java applications and number ofversions for each type in the global and local repositories.

n Number of specific applications by technology—Number of applications in the global and local repositoriesthat 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

Page 67: QA Wizard Pro User Guide v2017 - Perforce

Setting server connection options

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

Setting server connection optionsTheQAWizard Pro Server stores global application data and hosts the server database on a networkedcomputer. Youmust 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 usedtomonitor playback. See Viewing playback information in the dashboard, page 90 and Viewing playbackinformation in the status tool, page 99. It is also used for reporting purposes if QA Wizard Pro is integratedwith Helix ALM DataWarehouse. See Configuring general server options, page 254.

Youmay 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. Forexample, if sending playback data to the server is enabled, information about scripts run from QAWizardPro and the command prompt is sent to the server and displayed in the dashboard and status tool.

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click theServer tab.

3. Enter theQA Wizard Pro Server IP address or DNS name.

4. Enter theQA 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 thescripts 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.

Youmust select this option if you want information about scripts run on the computer displayed in thedashboard or status tool, or imported to ALM DataWarehouse for reporting purposes.

6. Select Prompt to name sessions before running scripts to be prompted to enter a playback sessionname before scripts run.

43

Page 68: QA Wizard Pro User Guide v2017 - Perforce

Setting email notification options

Naming sessions makes them easier to find when viewing playback information in the dashboard orstatus tool, or removing data from the server database. If this option is selected, you are always promptedto enter a session namewhen you run scripts, but you can also choose to run them without entering aname. You cannot name or rename playback sessions after they are sent to the server.

7. Click OK to save the changes.

Youmust restart QA Wizard Pro before you can connect to the server.

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

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

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click theEmail tab.

3. Select aSend email notification option to specify when to send results.

44

Page 69: QA Wizard Pro User Guide v2017 - Perforce

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 theSMTP configuration information.

n Enter theHost used to send outgoingmail. Enter an IP address (e.g., 192.168.1.100) or the fullyqualified domain name of themail server (e.g., mailserver.companyname.com).

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

n Enter theUsername andPassword 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 notrequired.

n Select Use SSL encryption to use secure sockets layer encryption for the connection. The portnumber changes to 465 when this option is selected.

5. Enter the sender's email address in the From field.

6. Specify theRecipients.

n Click Add to enter recipient email addresses. Separatemultiple addresses with a semicolon orcomma.

n Select recipient and click Edit to make any changes.

n Select a recipient and click Remove to remove them. Click Yeswhen prompted to confirm theremoval.

7. Enter the email Subject.

The default subject includes the field code %RUN_TYPE%: %RUN_RESULT% field code, which displays thetest type (batch, script, or load test) and result in the sent email. See Run Results Email Field Codes,page 631.

8. Enter theMessage body.

The default message body includes the %RUN_FILETYPE%: %RUN_FILELIST% field code, which specifiesthe test type (batch, script, or load test) and a list of filenames. You can also add additional field codes.See RunResults Email Field Codes, page 631.

9. Click OK to save the changes.

45

Page 70: QA Wizard Pro User Guide v2017 - Perforce
Page 71: QA Wizard Pro User Guide v2017 - Perforce

Managing ApplicationsBefore you can test an application with QAWizard Pro, you need to add it to the application repository andconfigure 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. Thisallows you to continue testing previous versions while creating scripts to perform tests on new versions. SeeAdding versions, page 51.

Adding applicationsBefore you record scripts, youmust add the application to the repository so QAWizard Pro can connect to it.You usually perform this task when you are preparing to test a new application. After an application is added, itcan be accessed from any workspace.

1. Choose File > New > New Application.

The Add New Application dialog box opens.

2. On theGeneral 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 insteadof Windows. TestingWindows 8 applications is not supported in QAWizard Pro onWindows 10.

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

47

Page 72: QA Wizard Pro User Guide v2017 - Perforce

Adding applications

Applicationtype

Field/option Description

Browser URL Enter the URL to access the application.

Createrepositoryvariable

Select this option to create a repository variable that contains theaddress for the server hosting the web site. Youmay want to selectthis option if you are testing against multiple web servers.

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

Windows Executablepath

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

Workingdirectory

Enter the application directory path. This field is automaticallypopulated if you browsed to locate the executable.

Command linearguments

Enter any arguments you want to use to control how the applicationoperates when a script starts it. For example, some applicationsallow you to pass a filename as an argument when the applicationstarts.

Java Javaapplication

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

Workingdirectory

Enter the application directory path. This field is automaticallypopulated if you browsed to locate the file.

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

Command linearguments

Enter any arguments you want to use to control how the applicationoperates when a script starts it.

Windows 8 Windows 8application

Select the application from the list.

4. Enter the applicationName. The application namemust be unique within the repository.

5. Enter the applicationVersion.

We recommend entering the version of the application you are testing (e.g., 7.2). Each application in therepository contains one or more versions, and each version contains information for starting theapplication and the data captured during recording.

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

48

Page 73: QA Wizard Pro User Guide v2017 - Perforce

Copying applications

6. Select theRepository to create the application in. See About application repositories, page 57.

7. Enter and confirm aPassword to password protect the application.

Use a password if you want to control access to application data. Youmay not want all users to haveaccess to add andmodify application data because changes may cause scripts to fail.

8. Click theName Overrides tab to specify conventions for naming new controls captured when recordingscripts or populating the application repository. SeeOverriding naming conventions for new controls, page119.

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 applicationsIf 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. ChooseRepository > Copy Application.

The Copy Application dialog box opens.

3. Enter theApplication Name to use for the copied application. The application namemust be uniquewithin the repository.

4. Select Include images to copy the screenshots captured during recording.

5. Click OK.

The application is copied.

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

Note: Exporting and importing is the recommendedmethod for backing up application repositories andmoving them to different locations or computers. This helps eliminate the risk of losing or corrupting files,whichmay occur when copying files directly inWindows Explorer.

1. Select the application to export in the Application Repository pane.

2. ChooseRepository > Export Application.

The Export Application dialog box opens.

3. Select the file location, enter a file name, and click Save.

49

Page 74: QA Wizard Pro User Guide v2017 - Perforce

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 applicationsYou can import an exported application into a local or global repository. If you want to use a script from anotheruser without sharing a repository, youmust also import the application included with the shared script.

1. ChooseRepository > 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 applicationName. The application namemust be unique within the repository.

5. Select theRepository to import the application to.

6. Click OK.

The application is imported.

Promoting applicationsPromoting an application copies all the application data and versions from the local repository to the globalrepository. Promote an application after modifying the window and control properties so other users can recordagainst the application.

1. Select the application to promote in the Application Repository pane.

2. ChooseRepository > Promote Application.

You are prompted to confirm the promotion.

3. Click Yes.

The Promote Application dialog box opens.

4. Enter theApplication 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

Page 75: QA Wizard Pro User Guide v2017 - Perforce

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. Makeany changes to the application in the global repository.

Modifying application propertiesYou can rename an application or change the password required tomodify the application. You can alsospecify 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,youmust 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 theGeneral tab, make any changes to the application name and password.

3. Click theName Overrides tab to specify conventions to use for naming new controls captured from theapplication when recording scripts or populating the application repository. SeeOverriding namingconventions for new controls, page 119.

4. Click OK to save the changes.

Adding versionsEach application in the repository contains one or more versions. Each version contains information forstarting the application and the window and control data that is captured during recording. Maintainingversions allows you to easily test previous versions of an application while creating scripts to test newversions.

Create a new version when changes to windows and controls in the tested application cause scripts to stopworking. For example, youmay create an application version for major andminor releases, but not formaintenance releases that only includeminor changes.

51

Page 76: QA Wizard Pro User Guide v2017 - Perforce

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 versionName.

4. Select aVersion to copy.

5. Select Duplicate windows and controls to include the window and control data from the selectedversion to copy. If this option is not selected, no windows or controls are included in the new version.

For example, youmay want to clear this option if a new interface toolkit was used to develop the newapplication version because the existing window and control data will not be valid for the new version.

6. Enter theStartup Information on theGeneral tab. The available fields depend on the application type.The fields are automatically populated with the information stored in the selected application version tocopy and can bemodified for the new version.

Applicationtype

Field/option Description

Windows Executablepath

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

Workingdirectory

Enter the application directory path. This field is automaticallypopulated if you browsed to locate the executable.

Commandlinearguments

Enter any arguments you want to use to control how the applicationoperates when a script starts it.

Browser URL Enter the URL to access the application.

52

Page 77: QA Wizard Pro User Guide v2017 - Perforce

Modifying version properties

Applicationtype

Field/option Description

Java Javaapplication

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

Workingdirectory

Enter the application directory path. This field is automaticallypopulated if you browsed to locate the file.

Javalauncher

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

Commandlinearguments

Enter any arguments you want to use to control how the applicationoperates when a script starts it.

7. Click theRepository Variables tab to create repository variables for the new version. See Creatingrepository variables, page 215.

8. If you are adding a web application version, click theURL Formats tab to create URL format rules for thenew version. See Creating URL format rules, page 227.

9. Click OK.

The version is added.

Modifying version propertiesYou can change the version number and application startup information. The properties you can change arebased on the application type.

Note: Modifying the version number can cause scripts to stop working. When you change the number inthe version properties, youmust also change the version number in the SetContext statement. SeeScript.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

Page 78: QA Wizard Pro User Guide v2017 - Perforce

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 newversion in the repository. See Adding versions, page 51.

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

4. Optionally click theRepository Variables tab tomanage repository variables for the version. SeeCreating repository variables, page 215.

5. If you aremodifying a web application version, optionally click theURL Formats tab tomanage URLformat rules for the new version. See Creating URL format rules, page 227.

6. Click OK to save the changes.

Deleting versionsYoumay 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 theSetContext 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 Exportingapplications, page 49.

1. Select the version you want to delete in the Application Repository pane.

2. ChooseEdit > Delete.

You are prompted to confirm the deletion. This action cannot be undone.

3. Click OK.

The version is deleted.

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

54

Page 79: QA Wizard Pro User Guide v2017 - Perforce

Deleting applications

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

1. Select the application you want to delete in the Application Repository pane.

2. ChooseEdit > Delete.

You are prompted to confirm the deletion. This action cannot be undone.

3. Click OK.

The application is deleted.

55

Page 80: QA Wizard Pro User Guide v2017 - Perforce
Page 81: QA Wizard Pro User Guide v2017 - Perforce

Managing Application RepositoriesApplication repositories contain information about the applications and versions you are testing. Eachapplication version in the repository contains data about the windows and controls that are captured duringrecording. 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 testingbegins andmaintain the repository as testing continues or new application versions are released.

About application repositoriesWhen you record a script, QA Wizard Pro captures the windows you access in the application, the controls ineach window, and the properties of each window and control. This information is saved in the local or globalapplication repository.

After application data is saved in the repository, any script you record or run has access to the window andcontrol data and properties. When you record new scripts, QA Wizard Pro compares the windows andcontrols found during recording with the information in the repository. Any new controls found in the applicationare added to the repository.

When you run a script, the information in the repository is used to run the application and perform actions onwindows and controls, which are located using the window and control properties. If QA Wizard Pro cannotlocate a window or control the script fails.

Note: If teammembers record or run scripts against the same application or you are testingmultipleapplications, we recommend using the global repository to manage application data. See Configuringgeneral 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 andrunning scripts against an application version or when setting up an application before it is promoted to aglobal repository.

Global repositories can be shared among users and computers. A global repository is hosted on theQAWizard Pro Server and is generally used whenmultiple testers are running scripts against the sameapplication version. You can promote an application to a global repository from a local repository to shareapplications with other users.

For example, Bill is creating scripts forWysiWrite and Jane is creating scripts forWysiChart. Bill has tocreate scripts that test the integration betweenWysiWrite andWysiChart. Because Jane already createdscripts forWysiChart, 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 accessto 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 scriptsagainst the same application without recreating andmaintaining the application in their local repositories.

n Users do not have to change their local repositories when application changes that affect scripts aremade. Scripts can be easily updated if windows or controls are added or changed.

57

Page 82: QA Wizard Pro User Guide v2017 - Perforce

About application repositories

n Changes to the window and control data can be performed by one user or a limited group of users to ensurecontinued 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 aserver.

Repository components

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

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

58

Page 83: QA Wizard Pro User Guide v2017 - Perforce

Setting up repositories

Setting up repositoriesBefore you start recording, we recommend taking the time to set up the application in the repository. Whilethese steps are optional, they can help you understand how QAWizard Pro captures the windows, controls,and other properties in the application you are testing. Taking the time to set up the repository also guardsagainst 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 eachmajor area of the application you are testing. Navigate to each window and dialogbox that will be tested. If a window or dialog box is displayed during recording, QAWizard Pro capturesthe window, controls, and properties of the window and controls. See Recording new scripts, page 65 andCapturing window and control data, page 115.

3. Evaluate the window and control properties that are used to locate objects during playback. QAWizardPro automatically selects search criteria, but youmay want to select different criteria based on yourknowledge of the application. If duplicate windows and controls are added to the repository after recordingor an object is not located during playback, it is a good indication you need tomodify the search criteria.SeeModifying window and control properties, page 122.

4. Review the window and control names in the repository. QA Wizard Pro tries to createmeaningful names,but it may capture a generic name. The window and control names are referenced in scripts and used tolocate objects. Youmay want to renamewindows and controls to better match the application. SeeRenaming windows and controls, page 133. If youmodify any names, youmust also update scripts soQAWizard Pro can successfully locate the objects using the new names. See Synchronizing with theapplication repository, page 143.

5. Run the scripts to make sure QAWizard Pro can locate all windows and controls and the scripts work asexpected. See Running scripts, page 73. If scripts fail, youmay need tomodify additional search criteria.SeeModifying 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 needshare 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 inthe local repository. This ensures the correct repository is used when recording or running scripts. SeeModifying 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 areusing 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 informationwhenever possible. If QA Wizard Pro cannot capture window or controls because they do not exist in theapplication or cannot be displayed when recording, you canmanually add them to the repository to usewhen creating or modifying scripts. Only manually add windows or controls if you are familiar with how QAWizard Pro uses properties and expected property values to locate controls during playback. SeeConfiguring user-added windows and controls, page 136.

59

Page 84: QA Wizard Pro User Guide v2017 - Perforce

Maintaining repositories

Maintaining repositoriesAs applications change, you need tomaintain the repository to keep it updated and organized. Keep thefollowing inmind as testing continues:

n When applications change, new windows and controls are automatically added to the repository duringrecording. You can also populate the repository to add windows and controls without recording a script.See Populating repositories, page 60. Youmay need tomodify the name and search criteria for the newwindows and controls. SeeModifying window and control properties, page 122.

n If you change window and control names, update scripts that refer to the objects. See Synchronizing withthe application repository, page 143.

n When a new version of the application is released for testing, you can also create an application version inthe 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 canaccess the changed application. To refresh the repository , users can right-click the application repositoryand chooseRefresh Repository. If an application is in your local repository and you exported theapplication to share it, youmay 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 upgradeQAWizard Pro, the application repository may also be upgraded. A backupcopy of the repository is created in the repository directory. The local repository is in the ApplicationData\Perforce\QA Wizard Pro\repository directory. Global repository data is stored in the QAWServerdirectory on the root of the computer the QAWizard Pro Server application is installed on. The currentrepository is stored in the directory namedwith the highest version number (for example, repositoryV3).

Populating repositoriesWhen applications change, windows and controls are added to the repository the next time you record a scriptagainst the application. You can also populate the repository to add windows and controls without recordingscripts.

1. ChooseRepository > Populate Repository.

The Populate Repository dialog box opens.

60

Page 85: QA Wizard Pro User Guide v2017 - Perforce

Populating repositories

2. Select the application you want to populate the repository for.

Select Connect to running application to populate the repository of aWindows application that isalready 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 aweb application, select aBrowser.

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 theStressPopulate Repository toolbar button to add stresses, such as low drive andmemoryspace, read-only drives, and disabled networking. See Applying stresses, page 112.

7. Click theStop Populate Repository toolbar button when you are finished.

The Repository Changes dialog box opens. New or changed windows and controls are displayed. SeeReviewing and saving repository changes, page 116.

61

Page 86: QA Wizard Pro User Guide v2017 - Perforce

Overriding global application startup information

Tip: Youmay want to rename generic window and control names tomake them consistent with theapplication and change control types for generic controls and HTML elements. You can also do thisafter you save the repository changes. See Renaming windows and controls, page 133 and Changingcontrol 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 informationWhen you test against an application in the global repository, QA Wizard Pro uses the default startupinformation to start the application. If you installed the application in a different directory or on a different driveon the local computer, you can override the startup information soQAWizard 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

Page 87: QA Wizard Pro User Guide v2017 - Perforce

Connecting to the global repository

2. On theGeneral tab, select Override Startup Information andmake 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 changesto this information for applications in the global repository could affect other users who test theapplication.

3. Click OK to save the changes.

Connecting to the global repositoryWhenQAWizard Pro starts, it automatically connects to the configured server. If QA Wizard Pro cannotconnect to the global repository on the server, a message is displayed at the bottom of the ApplicationRepository 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 numberare correct.

63

Page 88: QA Wizard Pro User Guide v2017 - Perforce
Page 89: QA Wizard Pro User Guide v2017 - Perforce

Recording ScriptsDuring recording, QAWizard Pro captures the actions you perform as you interact with the application. After ascript is recorded, you run it to test the application.

Recording new scriptsRecording creates a new script and captures actions as you interact with an application. The scripts yourecord provide a baseline for testing. After recording, you canmodify scripts to developmore complex testingscenarios.

Careful planning is the key to successful automated testing. Short, task-based scripts are easier to manageandmaintain. Tests should also be repeatable and have an expected result. For example, if the testapplication requires logging in, record a single login script that is called at the beginning of all other scripts thatrun against the application. This helps ensure QAWizard Pro captures windows and controls used whenlogging in so they are located when the script runs and eliminates the need for updating statements in multiplescripts if the log in process changes later. See Calling scripts from other scripts, page 151.

Keep the following inmind before recording scripts:

n Make sure the application is set up in QAWizard Pro. SeeManaging Application Repositories, page 57.

n QAWizard Promust be installed in the default C:\Program Files or C:\Program Files (x86) directory torecord scripts against Windows 8 applications. If it is installed in a different directory, an error is returnedduring 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 controlscannot 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 isreturned, you need to update a configuration file to change the port QA Wizard Pro uses to communicatewith Chrome. See Cannot Record in Chrome Because Port Already in Use for information.

n To record scripts against HTTPS web applications in Chrome, SSL encryptionmust be enabled. SeeSetting general options, page 40.

1. ChooseScript > Record New Script.

The Record New Script dialog box opens.

65

Page 90: QA Wizard Pro User Guide v2017 - Perforce

Recording new scripts

2. Enter aScript name.

3. Select theApplication 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 aWindows application runningon the test computer.

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

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

n If you record against a running application, the applicationmust be running on the test computer duringplayback or the script will fail.

5. If you are recording a web script, select aBrowser.

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

6. Click Record.

The application starts. The Recording toolbar also opens.

Youmay be prompted for additional information.

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

66

Page 91: QA Wizard Pro User Guide v2017 - Perforce

Recording new scripts

n If you are recording a script in Firefox for the first time, you are prompted to install and enable therequired QAWizard Pro extension. Select Allow this installation and click Continue.

7. Navigate through the application, performing the actions you want to record.

n Click theCheckpointRecording toolbar button to add checkpoints to the script during recording. SeeCreating record-time checkpoints, page 166. Click the button again to exit checkpoints mode.

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

n Click the Low-Level Recording toolbar button to switch to low-level recordingmode. Low-level actionstatements perform mouse actions that QAWizard 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 theCommentRecording toolbar button to add a comment to the script. Comment statementsare not run during playback.

Note: Click theCancel Recording toolbar button to cancel recording and discard all recordedactions.

8. Click theStopRecording toolbar button.

The Repository Changes dialog box opens. New or changed windows and controls are displayed. SeeReviewing and saving repository changes, page 116.

9. Click Save to save the repository changes.

67

Page 92: QA Wizard Pro User Guide v2017 - Perforce

Selecting the default web browser

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

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

Selecting the default web browserQAWizard Pro supports Microsoft Internet Explorer, Mozilla Firefox, andGoogle Chrome. You can run scriptsusing any of these browsers, regardless of the browser used for recording. If an application supports allbrowsers, you can record scripts in one browser and run them in all the browsers tomake sure the applicationperforms consistently. See theQAWizard Pro System Requirements for supported browsers.

Note: SSL encryption is required to record and run scripts against secure web applications in Chrome. Ifyou test web applications that use HTTPS and select Chrome as the default browser, make sure SSLencryption 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, orChrome.

Scripts are recorded and run in the selected browser by default. Use the SetBrowser statement to runscripts in a different browser without changing the default setting.

68

Page 93: QA Wizard Pro User Guide v2017 - Perforce

Recording additional script steps

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

Recording additional script stepsYou can add additional steps to an existing script by recording them. New steps are added to the end of thescript or to the line below a selected script step. You can alsomanually add steps, but recording the newsteps ensures actions are performed on the correct windows and controls.

1. Open the script to add steps to.

2. ChooseScript > Record Into.

The Record Into dialog box opens.

3. Select theApplication 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 aWindows application runningon the test computer.

Note: This option is not available if aWindows 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 thescript.

6. Click Record.

You are prompted to run the current steps before recording.

69

Page 94: QA Wizard Pro User Guide v2017 - Perforce

Recording low-level actions

Note: If repository variables are defined for the application version, youmay be prompted to entervariable values before you begin recording. See Entering repository variable values during recordingand 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 theStopRecording toolbar button.

The Repository Changes dialog box opens. New or changed windows and controls are displayed. SeeReviewing 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 actionsIf an application uses non-standard controls, QA Wizard Promay not recognize those objects and uses low-level action statements to perform keyboard andmouse actions on them. For example, if you are recording ascript to test a web page with hover-over menus, use low-level mode to force the recording system to trackmousemovements and capture themenu 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

Page 95: QA Wizard Pro User Guide v2017 - Perforce

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 scriptsYou can add a new script to the workspace without recording. Youmay want to add a script to test a functionbefore 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, oradd existing scripts from other workspaces. See Adding existing files to workspaces, page 23 or Addingexisting 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 scriptsAfter you record a script, the actions you performed are processed and added to the script. Some additionalsteps are also automatically added to help QAWizard Pro use the correct application during playback. Thefollowing statements are automatically added to scripts:

n The SetContext statement specifies the application version to connect to in the application repositoryduring playback. This connection is required because it gives QAWizard Pro information about theexecutable to run or URL to access during playback, including any additional information such ascommand line arguments. This statement is automatically added to the beginning of a script afterrecording. 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. Theapplication version in the repository contains the executable path, working directory, and command linearguments required to start Windows applications, or the URL required to access web applications. Thisstatement is automatically added to the beginning of the script after the SetContext statement, but youcan alsomanually add this statement. See Script.RunApp, page 532.

n If you connected to aWindows application running on the test computer, a ConnectToProcess statementis added to the script. See Script.ConnectToProcess, page 530.

71

Page 96: QA Wizard Pro User Guide v2017 - Perforce

Understanding recorded scripts

After recording a script, you canmodify it to create amore complex script or to correct any mistakes. SeeModifying Scripts, page 145.

Tip: You can usemore than one application or running process to perform steps in a script. Forexample, if a script tests an application that generates output, youmay want to add the output toanother application before the script finishes. You can add a ClearContext statement after the laststep the initial application performs to disconnect the script from the application repository. SeeScript.ClearContext, page 529. To connect to another application, add another SetContext statementthat specifies the application and version to connect to. Record or manually add the steps to performin the new application. See Recording additional script steps, page 69 or Adding statements, page146.

72

Page 97: QA Wizard Pro User Guide v2017 - Perforce

Running Scripts to Perform TestsWhen you run a script, QA Wizard Pro compares the tested application against the window and controlinformation stored in the application repository. If differences are found in the window or control properties, thescript fails. You can run individual scripts or multiple scripts using QAWizard Pro or using a commandprompt. You can also run scripts remotely.

Keep the following inmind:

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 youmove scripts to another computer to run them, the tested applications must be available in the globalor 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 setthe script as themain script for the workspace to quickly run it without opening it. See Setting and runningamain script, page 74.

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

Running scriptsRun scripts to perform tests. During playback, QAWizard Pro compares the tested application against thewindow and control information stored in the application repository. If differences are found in the window orcontrol properties, the script fails.

1. Open the script to run and then chooseScript > Run. You can also right-click a script in theWorkspacepane and chooseOpen and Run.

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

The script runs.

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

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

n If QA Wizard Pro is integrated with Helix ALM DataWarehouse, youmay be prompted to log in to theserver. See Entering login information when running scripts, page 74.

n You are prompted to install and enable the required QAWizard Pro extension the first time you run ascript 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 isgenerated. See Viewing results reports, page 75.

73

Page 98: QA Wizard Pro User Guide v2017 - Perforce

Setting and running a main script

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

Setting and running a main scriptYou can set themain script for the workspace to quickly run a frequently used script or a script used to run acomplete test suite.

For example, if a workspace contains multiple scripts for individual tests and you create a script that runs allrelated scripts as a test suite, you can set the test suite script as themain script to run the entire suite whenthe individual scripts are saved in the workspace and ready to run.

After themain script is set, you can run or debug it without opening it. This eliminates the need to switch to themain script if you are working with a called script or another file in the Script pane.

n To set a script as themain script for a workspace, open it and chooseScript > Set as Main Script. Youcan also right-click the script in theWorkspace pane and chooseSet as Main Script. Themain scriptname is displayed in bold in theWorkspace pane.

n To run themain script, chooseScript > Run Main Script. See Running scripts, page 73 for informationabout running scripts.

n To debug themain script, chooseDebug > Debug Main Script. See Running scripts in debugmode,page 211 for information about debugging scripts.

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

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

1. Enter yourUsername andPassword or select Use single sign-on to log in with your networkcredentials.

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 whenQAWizardPro starts.

74

Page 99: QA Wizard Pro User Guide v2017 - Perforce

Viewing results reports

3. Click Connect.

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

Viewing results reportsQAWizard Pro generates and saves a results report after a script runs. The report includes information aboutthe 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 emailnotification options, page 44.

Note: By default, reports are generated every time a script runs. To change this option, see Settingreporting options, page 78. Double-click a report in the Reports pane. The report opens. It includesinformation 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 Exportingresults reports, page 76.

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

75

Page 100: QA Wizard Pro User Guide v2017 - Perforce

Exporting results reports

Exporting results reportsYou 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 QAWizard Pro Playback Summary.

5. Select aSave 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 optionsYou can set playback options to lock the keyboard andmouse during script playback, change the speed oflow-level actions, specify the timeQAWizard Pro searches for controls before playback times out, andspecify the default optical character recognition (OCR) settings.

Keep the following inmind:

n Tomonitor playback in the QAWizard Pro dashboard or status tool, youmust send playback data to theserver. See Setting server connection options, page 43.

n Scripts run remotely use the playback options set on the remote computer. Before setting playbackoptions on a remote computer, make sure QAWRemote is not currently running scripts. Right-click theQAWRemote.exe icon in theWindows taskbar and chooseConsole. Verify the status is Idle and thenchoose File > Exit to close QAWRemote. After setting the playback options, close QAWizard Pro andthen restart QAWRemote on the remote computer before running scripts. See Starting QAWRemote.exe,page 250.

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click thePlayback tab.

76

Page 101: QA Wizard Pro User Guide v2017 - Perforce

Setting playback options

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

Note: To unlock the keyboard andmouse while a script is running, press Ctrl+Alt+Delete to opentheWindows Security dialog box. Press Esc to close the dialog box and return to QAWizard Pro.You can let the script continue running or press thePause/Break key to stop the script.

4. Select a low-level actionSpeed 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 upplayback if scripts are running as expected.

5. Enter theControl 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,000milliseconds.

6. Specify the default Optical Character Recognition (OCR) options to use when converting graphical textin applications to text strings.

These options are applied to temporary images created from specified regions of applications before theyare processed using OCR to improve the accuracy of the returned text. See Using OCR toWorkwith 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 valuebetween 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

Page 102: QA Wizard Pro User Guide v2017 - Perforce

Setting reporting options

n Contrast specifies the amount of color contrast to apply to images. You can enter a value between 0and 100. For example, 0 does not change the image contrast and 100makes 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 Englishlanguage file (e.g., %QAWDIR%\OCR\tessdata\eng.traineddata) is selected by default. ClickBrowse to select a different file.

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

7. Click OK to save the changes.

Setting reporting optionsThese options control how reports are generated, displayed, and exported.

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click theReporting tab.

3. Select Generate report after every playback session to always generate a results report after scriptsrun.

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, aPDF or HTML version of the results report is saved in the Reports directory with the QAWizard Proreport.

5. Select Include warnings to include warnings in results reports and the status tool. Clearing this optiondisplays warnings only in the Errors pane.

6. Click OK to save the changes.

78

Page 103: QA Wizard Pro User Guide v2017 - Perforce

Running multiple scripts

Running multiple scriptsYoumay want to runmore than one script at a time. For example, youmay have a script that logs in, one thatchecks the controls, and one that completes a form.

1. ChooseScript > 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: Youmay 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 runreport, 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 emailnotification options, page 44.

Running scripts against a global repositoryWhen you promote an application to a global repository, you will have two copies of an application, one in thelocal 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 localrepository. 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 scriptscannot find the application, they use the version in the global repository instead.

79

Page 104: QA Wizard Pro User Guide v2017 - Perforce

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 theglobal repository, add 'Global:' to the SetContext statement.

Running scripts from a command promptYou can use theQAWRunScript command to run scripts and batch files from a command prompt. EnterQAWRunScript /? to view help. To run load test scripts from a command prompt, use the QAWLoadTestcommand. See Running load tests from a command prompt, page 106

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

Script exampleThe following command runs theWysiCorp Login script from theWysiCorpWebSite 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 examplechanges the URLROOT repository variable value.QAWRunScript.exe "WysiCorpWebSite.qawwspace" "WysiCorp Login.qawscript"/DURLROOT=http://www.wysicorp.com

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

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

80

Page 105: QA Wizard Pro User Guide v2017 - Perforce

Running scripts from a command prompt

Command options

General

Item Description

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

scripts Script filenames. Separatemultiple filenames with spaces.

batch Batch filename.

/remotecomputername

Run scripts on the specified remote computer. See Running scripts remotely, page250.

/promptbeforeexit Prompt for confirmation before exiting QAWRunScript.

/sessionname"name"

Playback session name. Only used if playback information is sent to the QAWizardPro Server.

Results reports

Item Description

/reportdir"path"

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

/reportfile"path"

Full directory path to save the run report in, including filename (e.g., C:\ProgramFiles\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

Page 106: QA Wizard Pro User Guide v2017 - Perforce

Running scripts from a command prompt

Email results

Item Description

/emailresults OnSuccess|OnFailure|Always|Never

Indicates when to email results.

n OnSuccess: Only email when scripts pass.

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) orIP 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.

/emailpasswordpasswordincleartext

Password used to communicate with email server.

/emailusesslencryptionTRUE | FALSE

Use SSL encryption to communicate with the email server.

/emailfrom emailaddress Sender's email address.

/emailtolistofemailaddresses

Recipient's email address. Separatemultiple addresses with a semicolon.

/email subject "subjectline"

Email subject line. Must start and end with quotes.

/emailmessagebody"message body"

Email message body. Must start and end with quotes. Only one line isallowed.

Helix ALM and Helix ALM Data Warehouse integrations

Item Description

/helixalm Automatically submit issue to Helix ALM.

/lsuserusername

Helix ALM License Server username for ALM DataWarehouse integration. Overrides thesaved value on the computer running the script. If not specified, may be prompted toenter username.

/lspasswordpassword

Helix ALM License Server password for ALM DataWarehouse integration. Overrides thesaved value on the computer running the script. If not specified, may be prompted toenter password.

82

Page 107: QA Wizard Pro User Guide v2017 - Perforce

Creating batch files

Item Description

/lssinglesignonon|off

Enable or disable single sign-on for use with ALM DataWarehouse integration. Overridesthe 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 orfailed.

Value Description

0 All scripts succeeded.

Non-zeronumber

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

Creating batch filesA QAWizard Pro batch file is an executable that includes scripts and any associated datasheets or othercalled files. Batch files can be used to schedule groups of scripts to run unattended for a shorter, morethorough testing cycle. You can also use batch files to execute regression test suites as part of a nightly buildprocess.

Batch files can include any files from the sameworkspace 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 tothe batch file that logs in to the application before other scripts in the batch run.

1. ChooseBatch > New Batch.

The Batch dialog box opens.

83

Page 108: QA Wizard Pro User Guide v2017 - Perforce

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 reorderscripts 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

Page 109: QA Wizard Pro User Guide v2017 - Perforce

Creating batch files

Note: If a script in the batch calls a script or datasheet using a text string parameter, or has a datasource associated with it, the script or datasheet is automatically included in the batch. If variables orother expressions are used to access other scripts or datasheets, youmust add the additional files tothe batch tomake 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 thebatch 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, orBottom to reorder the list. Scripts run in theorder displayed.

9. If a Helix ALM connection is configured for the workspace, select Automatically submit issues toHelix 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 aSave in location or browse to select a different location, and click Save.

Batch files are saved with a .qawbatch file extension.

12. Click Closewhen you finish.

85

Page 110: QA Wizard Pro User Guide v2017 - Perforce

Modifying batch files

Modifying batch filesWhen you create a batch file, QA Wizard Promakes a copy of the scripts and the associated datasheets andbundles them in the batch file. If youmake changes to the scripts or datasheets in the workspace, youmayneed to update the batch files that they are saved in. You can also change the order that scripts run, removescripts and datasheets, and add additional workspace files that scripts in the batchmay need.

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

1. ChooseBatch > Open Existing Batch.

TheOpen 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 batchmatches the file in theworkspace

n Old—File in the workspace has changed

n Missing—File is not found in the workspace

n Unknown—Theworkspace that contains the file is notopen

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

4. Make any changes to the file.

n Select a file with anOld status and click Update to replace it with the updated file. Click Update Allto update all files. You cannot update files with aMissing or Unknown status.

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

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

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

5. Click Save to save the changes.

6. Click Closewhen you finish.

86

Page 111: QA Wizard Pro User Guide v2017 - Perforce

Running batch files

Running batch filesYou can runQAWizard Pro batch files immediately or schedule them to run unattended. Keep the following inmind:

n If youmove a batch file to another computer to run it, the tested applications must be available in the globalor local application repository.

n When you run batch files, the QAWizard Pro playback options set on the computer running the scripts areused. 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 thedefault web browser, page 68.

n Batch file run reports are stored in the Reports folder in the workspace directory (e.g.,C:\Users\<username>\Documents\My Documents\QA Wizard ProWorkspaces\Reports).

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

If you want to: Then:

Immediately run onebatch file

Double-click the batch file (.qawbatch) you want to run inWindows Exploreror use the QAWRunScript command. See Running scripts from a commandprompt, page 80.

Schedule one or morebatch files to rununattended

Use a scheduling program, such as Windows Task Scheduler, to schedulethe batch file to run.

87

Page 112: QA Wizard Pro User Guide v2017 - Perforce
Page 113: QA Wizard Pro User Guide v2017 - Perforce

Monitoring Script PlaybackYou canmonitor local and remote script playback in real-time using the QAWizard Pro dashboard and statustool.

Dashboard

Use the dashboard to see an overview of themost recent playback sessions and statistics about yourautomated tests in a web browser. It can help you identify failed scripts that need closer review and determineif 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 beforewarnings 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

Page 114: QA Wizard Pro User Guide v2017 - Perforce

Viewing playback information in the dashboard

Viewing playback information in the dashboardYou can use theQAWizard Pro dashboard tomonitor playback information in a web browser. It can help yousee an overview of themost 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 includebatch files in a continuous build process, you can use the dashboard tomonitor regression test results andquickly 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.SeeQAWizard Pro Dashboard SupportedWeb Browsers and Servers for a list of supported browsers.

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

90

Page 115: QA Wizard Pro User Guide v2017 - Perforce

Viewing playback information in the dashboard

Tip: You can also use the status tool to review playback information line-by-line, which can help youdebug scripts more thoroughly and identify issues in product builds that caused scripts to fail. SeeViewing 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 QAWizard Pro Serveradministrator for the URL.

The URL includes the name or IP address of the web server that hosts the dashboard and the path to thedashboard 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

Page 116: QA Wizard Pro User Guide v2017 - Perforce

Dashboard widget types

Widget Displays: To use the widget:

Recent PlaybackSessions

An overview of themostrecent playback sessions.

Only the fivemost recentsessions are displayed bydefault the first time youaccess the dashboard.

Click to change the data displayed in thewidget. See Changing information displayedin dashboard widgets, page 95.

Mouse over a session and click to viewline-by-line details about it in the status tool ifit is installed. See Viewing playbackinformation in the status tool, page 99.

Playback Session History A chart of the number ofplayback sessions in each runstate per day in a date range.

Only sessions run during thelast week to today aredisplayed by default the firsttime you access thedashboard.

Click to change the data displayed in thewidget. See Changing information displayedin dashboard widgets, page 95.

Mouse over data in the chart to view moreinformation.

Mouse over a run state in the legend tohighlight the corresponding data on the chart.

Click a run state in the legend to hide thecorresponding data from the chart. Click ahidden run state to show the data.

Test Computer Activity A chart of the number ofplayback sessions in each runstate per test computer.

All sessions for all testcomputers are displayed bydefault the first time youaccess the dashboard.

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

Recent Playback Sessions

Displays an overview of themost recent playback sessions. Use this widget to quickly see the status ofsessions during or after playback. For example, you can see which scripts failed during an automatedregression 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 itstarted, and how long it ran. Active, canceled, and inactive sessions also include the last five script lines thatran. Failed sessions also include information about errors that caused scripts to fail.

92

Page 117: QA Wizard Pro User Guide v2017 - Perforce

Dashboard widget types

Example

Using the widget

n Click to change the data displayed in the widget. See Changing information displayed in dashboardwidgets, 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. SeeViewing 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 widgetto view trends in your automated testing efforts and compare how many sessions pass versus fail. Forexample, you can use this information to determine if adequate testing is complete before a product is ready torelease.

93

Page 118: QA Wizard Pro User Guide v2017 - Perforce

Dashboard widget types

Example

Using the widget

n Click to change the data displayed in the widget. See Changing information displayed in dashboardwidgets, 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 toshow the data.

Test Computer Activity

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

94

Page 119: QA Wizard Pro User Guide v2017 - Perforce

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 dashboardwidgets, 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 toshow the data.

Changing information displayed in dashboard widgetsYou 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 filtersummary to view the full summary.

1. Click in the upper right corner of the widget.

The Filter dialog box opens.

95

Page 120: QA Wizard Pro User Guide v2017 - Perforce

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 ofresults

The specified number of sessions. You can enter a value between 1 and 200. Onlyavailable 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 includessessions run on or before the selected date.

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

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

Runstates

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 30minutes, orsessions canceled by the user who started them.  Only available in the Recent PlaybackSessions widget.

96

Page 121: QA Wizard Pro User Guide v2017 - Perforce

Installing and configuring the dashboard

Option Displays in the widget

Testcomputers

Sessions run on the selected computers. Select an option to include or exclude thecomputers. Includes the following includes sessions run on the selected computersandExcludes the following includes sessions not run on the selected computers.

Sessionname

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

3. Click Apply.

The widget refreshes to show the updated information.

Installing and configuring the dashboardThe dashboard lets users monitor playback information and statistics in a web browser. Before users canaccess the dashboard, an administrative user must install the files on the computer that hosts the QAWizardPro Server and configureMicrosoft Internet Information Services (IIS) web server to host the dashboard.

Note: IIS must be installed and enabled on the same computer that hosts the QAWizard Pro Serverbefore installing the dashboard files. SeeQAWizard Pro Dashboard Supported Web Browsersand Servers for a list of supported IIS versions.

Installing the dashboard files

On the computer that hosts the QAWizard Pro Server, run the QAWizard Pro installer and select QA WizardPro Dashboard.

The files are installed in the C:\InetPub\wwwroot\qawdashboard directory by default. Only change thedirectory if you are familiar with mapping virtual directories in IIS.

Configuring IIS

After installing the dashboard files, youmust convert them to an application in IIS.

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

1. Open IIS Manager.

2. In theConnections pane, expand the local host node and chooseApplication Pools.

3. Click Add Application Pool.

The Add Application Pool dialog box opens.

4. Add the following application pool information.

Option Value

Name QAWizard Pro Dashboard

97

Page 122: QA Wizard Pro User Guide v2017 - Perforce

Installing and configuring the dashboard

Option Value

.NET Framework version .NET Framework v4.0

Managed pipelinemode 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 withstep 9.

6. Select the dashboard application pool and click Advanced Settings.

The Advanced Settings dialog box opens.

7. In theGeneral category, select True for theEnable 32-bit Applications option.

8. Click OK.

The settings are saved.

9. In theConnections pane, expand the local host, Sites, andDefault Web Site nodes.

10. Right-click the qawdashboard folder and chooseConvert to Application.

The Add Application dialog box opens.

11. Click Select, select theQA 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 onmost supportedWindows versions when installing the dashboard files, but youmust manually enable it onWindows Server2012.

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, selectWeb Server (IIS) and click Next.

7. Click Next to skip the Features andWeb Server Roles (IIS) pages.

8. On the Role Services page, expand theApplication Development node, select ASP.NET 4.5, and clickNext.

9. On the Confirmation page, click Install.

98

Page 123: QA Wizard Pro User Guide v2017 - Perforce

Viewing playback information in the status tool

Accessing the dashboard1. Make sure the QAWizard Pro Server is running. See Starting the QAWizard 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 thedashboard application. For example, http://yourserver.com/qawdashboard.

The dashboardmay take a few minutes to load the first time.

Note: To display information in the dashboard, make sure users configure QAWizard Pro to sendplayback 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 correctlyon 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 toolYou can review script playback line-by-line in the QAWizard Pro status tool. It displays detailed informationabout playback sessions, such as the current run state, the computer scripts ran on, how long they ran, anyerrors 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 surethat sending playback data to the QAWizard Pro Server is enabled if you want information about scripts runfrom 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 invarious formats. You can then share these reports with developers to provide helpful information for fixingissues found during testing.

Tip: You can also use the dashboard tomonitor 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. SeeViewing playback information in the dashboard, page 90.

1. To start the status tool, chooseStart > All Programs > Perforce > QA Wizard Pro > QA Wizard ProStatus Tool.

The status tool opens.

99

Page 124: QA Wizard Pro User Guide v2017 - Perforce

Viewing playback information in the status tool

Note: The status tool requires a connection to a QAWizard Pro Server. If it cannot connect to theserver, youmay need to update the connection information. Click , enter the server address andport 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 canupdate the filter options to view other sessions.

Option Displays:

Date Sessions run during the selected date range.

n More than includes sessions runmore 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 includessessions 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 30minutes, orsessions canceled by the user who started them.

100

Page 125: QA Wizard Pro User Guide v2017 - Perforce

Viewing playback information in the status tool

Option Displays:

Testcomputers

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

Sessionname

Sessions by name. You can include sessions with names that equal, start with, end with,contain, do not equal, or do not contain specific text. Select Ignore case to ignore thecase 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 savedas CSV, XLSX, and DOCX files.

101

Page 126: QA Wizard Pro User Guide v2017 - Perforce
Page 127: QA Wizard Pro User Guide v2017 - Perforce

Load TestingLoad testing helps you determine how aweb application behaves by simulating real-world scenarios andincreasing 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 userexperience.

Because load testing is a simulation of user behavior, use load test results as a guide to what usersexperience as application use increases. Load testing will not provide you with themaximum number of usersthat an application can support.

QA Wizard Pro load test scripts do not capture user interface actions. When you record load test scripts, QAWizard Pro only captures the information exchanged between the application and web server. You can thenrun those scripts under a load of virtual users to determine how the application and server behave.

Keep the following inmind:

n Before you record a load test script, make sure the testing environment is as basic as possible and doesnot contain elements that are not part of the application, which could affect the test results. For example,youmay need to clear the cache or disable browser toolbars.

n Before you run a load test, youmay need tomodify some scripts so they do not affect the test results. Forexample, keep basic setup and read/write actions in standard QAWizard Pro scripts and call those scriptsfrom load test scripts. Load tests should only include statements for testing performance under load.

Recording load test scriptsLoad 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. ChooseScript > Record Load Test.

The Record New Load Test Script dialog box opens.

2. Enter aScript name.

3. Select theApplication you want to record the script against.

Click New to add a web application. See Adding applications, page 47.

4. Select theBrowser to run the application in.

103

Page 128: QA Wizard Pro User Guide v2017 - Perforce

Running load tests

Note: You can only record load tests in Microsoft Internet Explorer andMozilla Firefox. See theQAWizard 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 fileextension.

After recording

The following datamay 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 andmalware protection sites, or web tracking sites. Review load testscripts and delete statements that are not directly related to the web site you are testing before runningload tests.

n If data that could cause invalid script lines or syntax errors in the load test script is posted to the webserver during recording, QAWizard Pro stores that data in a separate postdata file in the workspace. Toview a postdata file, select it in the workspace and choose File > Open.

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

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

1. ChooseScript > Run Load Test.

The Run Load Test dialog box opens. The settings from themost recent load test are displayed.

104

Page 129: QA Wizard Pro User Guide v2017 - Perforce

Running load tests

2. Enter the Total number of virtual users to simulate for the load test. This number cannot exceed thenumber of virtual users available on the computer running the test.

3. Select theScripts to run.

You can includemultiple scripts in a load test and divide the total number of virtual users between thescripts. For example, you can test how an application handles 500 users: 200 who use searchfunctionality 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 toinclude in the test and click Select.

n Enter the number of Virtual Users orPercent of total virtual users to simulate for each script. Thesum 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 theComputers to host virtual users. You can use amaximum of 250 virtual users on eachcomputer per load test.

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

105

Page 130: QA Wizard Pro User Guide v2017 - Perforce

Running load tests from a command prompt

n Enter the number of Virtual Users orPercent of total virtual users to host on each computer. The sumof 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 theBrowsers to use.

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

n Enter the number of Virtual Users orPercent 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 theScale startup toreach 100% load field.

Use this option if you want to gradually apply load to the application, which provides amore realistictesting 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 isreached. If scripts stop before time expires, they restart and continue to run for the duration of thespecified time.

8. Click Run.

Youmay be prompted to name the playback session before the test starts. Enter a session name andclick Set Name and Run or click Run Without Name to run the session without a name. If you do notwant to be prompted to enter a session name, disable it in the server options. See Setting serverconnection options, page 43.

A progress indicator opens and displays the run time, current load, and the number of errors and warningsreturned during the test. When the test is complete, a load test report is generated. See Viewing load testresults reports, page 109.

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

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

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

Running load tests from a command promptYou can use theQAWRunLoadTest command to run load test scripts from a command prompt. EnterQAWRunLoadTest /? to view help. To run standard QAWizard Pro scripts from a command prompt, use theQAWRunScript command. See Running scripts from a command prompt, page 80.

106

Page 131: QA Wizard Pro User Guide v2017 - Perforce

Running load tests from a command prompt

SyntaxQAWRunLoadTest.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] [/emailhosthost] [/emailport port] [/emailusername username] [/emailpassword passwordincleartext][/emailusesslencryption TRUE|FALSE] [/emailfrom emailaddress] [/emailtolistofemailaddresses] [/emailsubject "subject line"] [/emailmessagebody "message body"][/sessionname "name"]

ExampleThe following command runs the Shopping Cart load test script for 120 seconds and gradually adds 50 virtualusers 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 usersavailable on the computer running the test.

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

script Script filename. Separatemultiple scripts with spaces.

:numusers Number of virtual users to assign to an item, such as a script, computer, or browser. Ifno value is specified, the total number of virtual users is evenly distributed amongitems. Can assign amaximum of 250 virtual users to each computer.

/remotecomputername

Run scripts on the specified remote computer. Each remote computer must haveQAWizard Pro installed, QAWRemote.exe running, and a valid license. See Runningscripts remotely, page 250.

/useragent"useragentstring"

User agent or browser to use when running scripts. Internet Explorer 8 is used if nouser agent is specified.

/scalestartupscaletime

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

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

/runtimerunseconds

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

107

Page 132: QA Wizard Pro User Guide v2017 - Perforce

Running load tests from a command prompt

Item Description

/sessionname"name"

Playback session name. Only used if playback information is sent to the QAWizardPro Server.

Results reports

Item Description

/reportdir"path"

Directory path to save the run report in (e.g., C:\Users\<username>\Documents\MyDocuments\QA Wizard ProWorkspaces\Load Tests\Load Test Reports).

/reportfile"path"

Directory path to save the run report in including file name (e.g.,C:\Users\<username>\Documents\My Documents\QA Wizard ProWorkspaces\LoadTests\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|OnFailure|Always|Never

Indicates when to email results.

n OnSuccess: Only email when scripts pass.

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) orIP 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.

/emailpasswordpasswordincleartext

Password used to communicate with email server.

/emailusesslencryptionTRUE | FALSE

Use SSL encryption to communicate with the email server.

108

Page 133: QA Wizard Pro User Guide v2017 - Perforce

Viewing load test results reports

Item Description

/emailfrom emailaddress Sender's email address.

/emailtolistofemailaddresses

Recipient's email address. Separatemultiple addresses with a semicolon.

/email subject "subjectline"

Email subject line. Must start and end with quotes.

/emailmessagebody"message body"

Email message body. Must start and end with quotes. Only one line isallowed.

Helix ALM Data Warehouse integration

Item Description

/lsuser Helix ALM License Server username for ALM DataWarehouse integration. Overrides thesaved value on the computer running the script. If not specified, may be prompted toenter username.

/lspassword Helix ALM License Server password for ALM DataWarehouse integration. Overrides thesaved value on the computer running the script. If not specified, may be prompted toenter password.

/lssinglesignonon|off

Enable or disable single sign-on for use with ALM DataWarehouse integration. Overridesthe 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 orwarnings.

Value Description

0 No errors or warnings were returned.

Non-zeronumber

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

Viewing load test results reportsQAWizard Pro generates and saves a results report after a load test script runs. The report includesinformation about how well the server performed under load. Load test reports are named Load Test followedby 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 emailnotification options, page 44.

1. Double-click a load test report in the Load Test Reports folder in the Reports pane.

109

Page 134: QA Wizard Pro User Guide v2017 - Perforce

Viewing load test results reports

The report opens and displays an overview of the test results, details about errors and warnings returnedduring the test, and graphs of the virtual users, response time, page hits, bytes transferred, and number oferrors.

2. Click Export Graph Data in the report to save the graph data as a CSV file. You can open this file inMicrosoft 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 Exportingresults reports, page 76.

110

Page 135: QA Wizard Pro User Guide v2017 - Perforce

Stress TestingStress testing helps you determine how aWindows or Java application performs under stressful conditions.You can create stresses, such as disablingWindows networking services, or simulate scenarios, such asread-only disks or low memory and disk space.

QAWizard Pro can apply multiple stress simulations to an application at once. The simulations can startwhen the application starts or be staggered to stress the application at specific points.

Disk andmemory simulations only affect the application when interacting with it from QAWizard Pro. Whenscript playback completes, all stresses are stopped.

You can add stresses when recording new scripts, recording additional steps in existing scripts, or populatingthe application repository. You can alsomanually add stress testing statements to scripts. See Applyingstresses, page 112 or Creating and running stress tests, page 111.

Note: DisablingWindows networking disables all network adapters on the host or remote computer. Thisaffects all running applications. Close all applications that require a network connection before disablingnetworking.

Creating and running stress testsYou can create stress tests to determine how aWindows or Java application behaves under stressedconditions. You can add simulated stresses to test an application, such as low memory, low disk space, andread-only drives, or real stresses, such as disabledWindows networking.

You can add stresses to scripts during recording or manually add stress statements to existing scripts. Thefollowing example shows a stress test script.

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

111

Page 136: QA Wizard Pro User Guide v2017 - Perforce

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 theapplication starts or from a specific point in the script and use them throughout script playback. See Applyingstresses, 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 alsomanually add stress statements to existing scripts. This is helpful if you want to enable anddisable stresses at specific points during script playback. See Stress statements, page 346.

Running stress test scripts

Run stress test scripts the sameway 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 thetested application resumes normal operation. If email notifications are configured, the results are sent tospecified recipients.

Applying stressesYou can apply stress to applications when recording new scripts or additional script steps to test howapplications behave under stressful conditions, such as low disk space andmemory.

You can also apply stresses when populating the application repository to capture controls that are onlydisplayed under stressful conditions. For example, youmay want to simulate a read-only drive to capture anerror message dialog box.

Note: You canmanually add stress statements to scripts to enable and disable stresses at specific pointsduring script playback. See Adding statements, page 146.

1. Click theStressRecording toolbar button when recording a script or populating the repository.

The Configure Stress dialog box opens.

2. Select any Drive options.

112

Page 137: QA Wizard Pro User Guide v2017 - Perforce

Applying stresses

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

n Simulate drive <letter> as read only simulates a read-only disk. Select the drive letter.

3. Select any Memory options.

n Simulate memory with <space> remaining simulates low memory. Enter the remaining space andselect a unit of bytes.

n Simulate maximum of <space> per allocation specifies themaximum available memory perallocation 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 thatrequires 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 setduring recording are applied when you run the script. See Running scripts, page 73.

113

Page 138: QA Wizard Pro User Guide v2017 - Perforce
Page 139: QA Wizard Pro User Guide v2017 - Perforce

Managing Windows and ControlsWhen you record a script, QA Wizard Pro identifies windows and controls in the application and savesinformation about them in the application repository. This information is used during playback to locate andperform actions on windows and controls in the application. If the application changes after scripts arerecorded, new windows and controls are added to the repository.

You canmodify 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 Merge duplicate controls that are captured during recording if the application changes.

n Update references tomodified window and control names inmultiple scripts.

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

Capturing window and control dataEach window and control in an application has several properties that QAWizard Pro uses to uniquely identifyobjects. 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 theWindow Class.

Text Default text displayed in an edit box or combo box or the text that appears on a buttonor 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. Thisincludes capturing the window and controls andmodifying their properties. If a window or dialog box isdisplayed during recording, QAWizard Pro captures the window, controls, and their properties. SeeSetting up repositories, page 59.

115

Page 140: QA Wizard Pro User Guide v2017 - Perforce

Reviewing and saving repository changes

Reviewing and saving repository changesQAWizard Pro updates the application repository when you record a script, populate the applicationrepository, or apply URL formats. Before the repository is updated, you are prompted to review windows andcontrols that will be added or modified and optionally make changes.

It is important to take the time to review repository changes tomake sure that:

n A large number of duplicate controls will not be added to the repository, which canmake it unmanageable.

n New controls that will be added to the repository havemeaningful and intuitive names. You can renamecontrols before they are added. If you recorded a script, the new control names are used in the resultingscript.

n Generic controls that QAWizard 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 amorereadable, accurate resulting script with fewer ambiguous control names and better statements for interactingwith controls.

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

1. The Repository Changes dialog box opens after recording a script, populating the repository, or applyingURL 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 andenter a new name or select a suggested name from the list (new controls only). See Renamingwindows 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 newand will be added.Will modify indicates the window or control already exists and the properties willbe updated. None indicates no action will be performed.

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

116

Page 141: QA Wizard Pro User Guide v2017 - Perforce

Reviewing and saving repository changes

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

2. Select Smart matching to allow QAWizard 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 isselected, the list refreshes and displays the windows and controls to update based on smart matching.

Youmay 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 capturedcontrols to the application repository.

Youmay not want to clear this option if the application contains a large number of controls that you will nottest. This can help keep the repository moremanageable. If this option is cleared, the list refreshes withthe controls to add or modify.

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

117

Page 142: QA Wizard Pro User Guide v2017 - Perforce

Repository change reasons

4. Click Save to save the recommended changes or click Don't Save if you want to reject the recommendedchanges.

Youmay not want to save the changes if duplicate controls will be added to the repository. This indicatesthe properties selected as search criteria for the existing control are not unique and you need tomodify thecriteria. SeeModifying 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 stepsare not saved.

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

Reason Explanation

Newcontrol

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

Smartmatching

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

Imageupdate

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

Formatapplied

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

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

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 andcontrols that will be added or modified in the application repository. Smart matching, which is enabled bydefault for web scripts, allows QAWizard Pro to compare existing repository controls against the newcontrols.

118

Page 143: QA Wizard Pro User Guide v2017 - Perforce

Overriding naming conventions for new controls

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

Playback

During playback, QAWizard Pro attempts to find controls that match the control properties selected assearch criteria in the application repository. If more than onematching control is found or the control is notfound, QAWizard 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 matchingrepeats 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 wasperformed on and includes a 'Review recommended repository changes' link. You can click this link to openthe Repository Changes dialog box, which displays the recommended repository changes. You can reviewthe changes and save them to update the repository. The next time you run the script, QA Wizard Pro shouldbe 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 inthe control Properties dialog box. If you disable smart matching on a control, only the search criteria are usedto locate the control during recording and playback.

You should only disable smart matching for controls if:

n You always want to usemodified search criteria to locate a control during playback and do not want smartmatching to change the criteria during recording.

n QAWizard 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 controlsWhen recording scripts or populating the application repository, QA Wizard Pro captures windows andcontrols 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 tochange a control name, you can enter one or select one from a list of suggestions generated based on controlproperties.

119

Page 144: QA Wizard Pro User Guide v2017 - Perforce

Overriding naming conventions for new controls

To ensure new controls captured when you record or populate in the future use intuitive names that areconsistent with the tested application, you can override the default control naming convention. You canspecify a prefix to add to control names to help you organize controls by type in the repository. You can alsochange 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 thebutton text as the name, you can specify the 'btn' prefix for the Button control and select the Text propertyvalue as a priority to ensure that value is suggested for the rest of the control name before other propertyvalues.

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

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

2. Select aControl Type.

3. Enter aControl name prefix to prepend text to new control names.

4. Select a property from theAvailable Properties list and click the right arrow to add it to theOverridePriority list.

The override priority order determines which property values are used first whenQAWizard Pro suggestscontrol names in the Repository Changes dialog box. Values added to the Override Priority list are usedafter values in the default naming convention order. See Default control naming convention, page 121.Use the arrow buttons to reorder the list.

120

Page 145: QA Wizard Pro User Guide v2017 - Perforce

Default control naming convention

The <Default> value in the Available Properties list represents the default naming convention for thecontrol type. If you want to add property values not included in the default convention for the control type,add <Default> to the Override Priority list and then add the additional property values after it. This forcesQAWizard Pro to look for other property values in the control to use for name suggestions, but keeps thedefault 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 conventionWhen recording a script or populating the application repository, QA Wizard Pro suggests window and controlnames based on properties captured from the application. Before adding controls to the repository, you canreview them in the Repository Changes dialog box. You can select a name for controls from the list ofsuggestions or enter a name.

To create the list of suggested names for new controls, QA Wizard Pro uses up to five control property valuesin 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

Page 146: QA Wizard Pro User Guide v2017 - Perforce

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 tosuggest names for a specific control type, you can override the default control naming convention. SeeOverriding naming conventions for new controls, page 119.

Modifying window and control propertiesEach application window and control has a set of properties that are captured during recording and saved inthe application repository. These properties make each window and control in the repository unique soduplicate 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. Forexample, the Text property of an OK button is OK. QAWizard Pro automatically selects a unique set ofproperties to use as search criteria. A window or control is successfully located when its actual propertyvalues match the selected search criteria.

QA Wizard Pro stores two values for each window and control property. The original value is saved when thewindow or control is added to the application repository. The expected value is what scripts expect to findduring playback. These values usually match. If an application changes, youmay need tomodify expectedvalues tomake sure QAWizard Pro can locate the window or control during playback. You can also selectdifferent 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 SearchMethod tab selected.

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

122

Page 147: QA Wizard Pro User Guide v2017 - Perforce

Modifying window and control properties

2. Enter aName to identify the window or control in scripts and the application repository.

If you rename awindow or control, youmust also update the name in existing scripts. See Renamingwindows and controls, page 133.

3. Select aControl type to let QA Wizard Pro determine the actions that can be performed on the control.

Only change the control type if a different typemore accurately identifies the control or the current type isincorrect. You cannot change the type for windows. See Changing control types, page 132.

4. Click theSearch Method tab to view or change themethod and criteria used to search for the window orcontrol during playback. See About searchmethods, page 124.

5. Click theProperties tab to view a list of property names and values captured when the window or controlwas added to the application repository.

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

6. Click theAdvanced tab to select options that let QA Wizard Pro automatically update the properties usedduring recording and recommend better search criteria during playback. See Setting advanced controlproperties, page 131.

7. Click OK to save the changes.

123

Page 148: QA Wizard Pro User Guide v2017 - Perforce

About search methods

About search methodsDuring playback, QAWizard Pro searches for windows and controls using the Standard, XPath, or Functionmethod, which is selected in the window/control Properties dialog box.

Standard

When new windows and controls inWindows and Java applications are added to the application repository,the Standard searchmethod is selected in the control properties by default. This searchmethod locateswindows and controls using application properties and expected values. A control is located when its actualproperty values match the selected search criteria in the repository.

If a control set to use the Standard searchmethod is not located during playback, you canmodify theproperties to select different search criteria. See Changing standard search criteria, page 124. If QA WizardPro still cannot locate the control or selects the wrong control after modifying the criteria, you canmodify thecontrol to use the XPath or Function searchmethod instead.

XPath

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

Note: SomeHTML controls added to the repository in QA Wizard Pro 2016.2.0 or earlier may use theStandard searchmethod. If these controls are not located when running web scripts, modify the controlproperties to use the XPath searchmethod to improve playback accuracy. See Using the XPath searchmethod, page 223.

Function

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

Note: Only use the Function searchmethod if you are familiar with creating functions and understand howchanging search options can impact scripts. Scripts will not work if you use this searchmethodincorrectly.

Changing standard search criteriaA window or control must be unique soQAWizard Pro can differentiate it from other objects. QA Wizard Proautomatically selects a unique set of properties to use as search criteria. If QA Wizard Pro cannot locate awindow or control when scripts run, you can change the properties used as search criteria or the expectedvalues to better identify it during playback. Youmay also need to update search criteria if the applicationchanges to prevent QAWizard Pro from adding existing windows or controls to the repository duringsubsequent recordings.

1. Select a window or control in the Application Repository pane and choose File > Properties.

124

Page 149: QA Wizard Pro User Guide v2017 - Perforce

Changing standard search criteria

The Properties dialog box opens with the SearchMethod tab selected.

2. Select a property check box to use it as search criteria. Clear the check box to remove the property assearch criteria.

If the property you want to use as search criteria is not displayed, click Add Property to add it. Thisoption is only available for user-added windows and controls, which are identified by on the control typeicon in the Application Repository pane. See Adding properties to user-added windows and controls, page140.

If you select more than one property, the expected values for all selected properties must match theactual values during playback. If any of the values do not match, QAWizard Pro cannot find the windowor control.

Note: HTML element property names may be enclosed in brackets. For example, [href]. Thebrackets indicate that the property is a specified attribute in the HTML. QAWizard Pro does notrequire these properties when capturing information during recording or populating the repository, oruse them as search criteria by default. In some cases, youmay see two properties with the samename, such as href and [href]. The property values are the same, but the brackets indicate adifference in how the properties were captured.

3. Select anAction to specify how QAWizard 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

Page 150: QA Wizard Pro User Guide v2017 - Perforce

Editing window and control properties

n Contains searches for values that include the expected value.

n Matches regexmatches 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 webproperties with URL expected values, such as URL, Href, and Src. See Editing URL format rules incontrol properties, page 230.

4. Enter theExpected Value for the property or mouse over the current value and click Edit to modify it. SeeEditing window and control properties, page 126.

5. Click OK to save the changes.

Editing window and control propertiesQAWizard Pro stores two values for each window and control property. The original value is saved when thewindow or control is added to the application repository. The expected value is what scripts expect to findduring playback. These values usually match. If an application changes, youmay need tomodify expectedvalues tomake sure QAWizard 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 SearchMethod tab selected.

2. In the row for the property set as search criteria, select anAction to specify how QAWizard Prosearches for the expected value.

You can specify to search for values that match the exact expected value, start with, end with, or containthe expected value, match a regular expression, or match a URL format.

3. Mouse over theExpected Value and click Edit.

The Edit Property dialog box opens.

Note: IfMatches 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

Page 151: QA Wizard Pro User Guide v2017 - Perforce

Using regular expressions

Note: The Name field is only enabled for properties manually added to user-added windows andcontrols. Default properties QAWizard Pro saves with controls based on the type cannot berenamed.

5. Enter the expected value.

You can use repository variables in expected values soQAWizard Pro can locate dynamic windows andcontrols when an application changes. For example, you can replace a URLwith the URLROOTrepository variable. To use a repository variable in the value, select it from the list and click Insert. Thevariable is replaced with the variable value used during playback. See Creating repository variables, page215.

Tip: To enter a repository variable in the Expected value field, add percent signs to the beginning andend 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 expressionsRegular expressions provide amore powerful way to search for window or control properties that includedynamically generated text, such as a window title or button label. When a property used as search criteriaincludes dynamically generated text, QA Wizard Promay not be able to find the window or control duringplayback. Tomake sure QAWizard Pro finds the window or control, you can use a regular expression as theexpected value to search for a patternmatch.

For example, in Helix ALM, the edit window title can be either Edit Issue #x or Edit Record #x depending onthe project configuration, where x corresponds to the assigned issue number (e.g., Edit Issue #2). Tomakesure QAWizard Pro finds the window, Matches regex is selected in the Action column and the expected valueis replaced with Edit Issue|Record #. When the script runs, QAWizard Pro successfully finds the edit issue oredit record window because the expected valuematches Edit Issue # or Edit Record #, regardless of thenumber 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 SearchMethod tab selected.

127

Page 152: QA Wizard Pro User Guide v2017 - Perforce

Changing the search method for multiple controls

2. In the row for the property set as search criteria, selectMatches regex as theAction used to search forthe expected value. Selected properties are used as search criteria for the window or control.

3. Enter the regular expression as theExpected Value. QA Wizard Pro supports .NET regular expressions.

4. Click OK to save the changes.

Changing the search method for multiple controlsYou can change the searchmethod set for multiple controls at the same time. This lets you quickly switch to amore accurate searchmethod without manually updating the properties of each control. For example, ifmultiple HTMLLink controls in the application repository use a relative XPath, but have a dynamic ID attributethat changes every time the web page refreshes, you can update them all to use the full XPath.

See About searchmethods, page 124 for information about searchmethods.

1. Ctrl+click the controls to change the searchmethod for in the Application Repository pane. You can onlyselect multiple controls in the samewindow.

2. Right-click and chooseSearch Method.

A check mark indicates the current searchmethod. Custom indicates at least one of the selected controlsuses the Custom XPath or Function searchmethod.

128

Page 153: QA Wizard Pro User Guide v2017 - Perforce

Using the Function search method

3. Select the searchmethod to use.

Relative XPath and Full XPath are only available for HTML controls in web applications. Custom opensthe Properties dialog box and is only available when one control is selected.

You are prompted to confirm the change.

4. Click Yes.

The selected searchmethod is set in the control properties.

Using the Function search methodYou can use the Function searchmethod to create a custom algorithm that locates controls that are stored inthe application repository during playback. For example, you can use a search algorithm that includes and/orconditions. The function is executed during recording and playback andmust return True to locate the control.

Youmay want to use the Function searchmethod if a control is not located after you:

n Select additional or different search criteria in the Standard searchmethod. SeeModifying window andcontrol properties, page 122.

n Use regular expressions for expected values in the Standard searchmethod. See Using regularexpressions, page 127.

n Use the XPath searchmethod to locate an HTML control. See Using the XPath searchmethod, page 223.

129

Page 154: QA Wizard Pro User Guide v2017 - Perforce

Using the Function search method

Note: Only use the Functionmethod if you are familiar with creating functions and understand howchanging search options can impact scripts. Scripts will not work if you use this searchmethodincorrectly.

Creating the search function1. Select a window or control in the Application Repository pane and choose File > Properties.

The Properties dialog box opens with the SearchMethod tab selected.

2. Select Function from the Searchmethod list. The following code is automatically added to declare thefunction:Function ControlName(controlData)

End Function

3. Add the function to use to locate the control.

n The functionmust return True or False to indicate if the controlData passed to the function representsthe control.

n Use the ContainsRuntimeValue statement to check that the property is defined for the control and theGetRuntimeValue 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 theproperty is defined.GetRuntimeValue(ControlData,"PropertyDisplayName")

ControlData

The snapshot control data (properties).

PropertyDisplayName

Property display name to find.

Note: The ContainsRuntimeValue andGetRuntimeValue statements can only be used with the Functionsearchmethod.

130

Page 155: QA Wizard Pro User Guide v2017 - Perforce

Setting advanced control properties

ExampleA dialog box contains an Advanced>> button, which is a .NETWindows Forms push button control. When thebutton 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 wantQAWizard Pro to recognize the buttons as the same button during playback so youmerge them in theapplication repository and change the control name to AdvancedSimple.

Use the Function searchmethod to locate the AdvancedSimple control. The control is only located if thefunction 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 ifthe 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 propertiesYou 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 youcan 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 SearchMethod tab selected.

2. Click theAdvanced tab.

3. Select Enable smart matching to let QA Wizard Pro update window and control properties used assearch 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

Page 156: QA Wizard Pro User Guide v2017 - Perforce

Changing control types

Note: Ignore this overlay control during recording and playback and Force recursive ignoreare only available if they were selected for the control in an earlier QAWizard Pro version. Theseoptions ignore controls if they obstruct others in the application to work around playback issues. Ifyou clear Ignore this overlay control during recording and playback, both options arepermanently removed from the Properties dialog box.

4. Click OK to save the changes.

Changing control typesWhen you record a script or populate the application repository, QA Wizard Pro captures and analyzes theapplication controls and identifies the type of each one. The type is saved in the repository and used todetermine 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 canonly use low-level action statements to interact with generic controls.

Youmay need to change a control type to identify it more accurately so you can use other statements tointeract with it. For example, you can change a generic control that you enter text in to an edit box. This letsyou 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 scriptor populate the repository. The resulting script includes object action statements for controls you interactedwith instead of low-level actions. See Reviewing and saving repository changes, page 116. You can alsochange 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 aControl type.

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

3. Click OK to save the changes.

The control type is changed in the repository.

132

Page 157: QA Wizard Pro User Guide v2017 - Perforce

Renaming windows and controls

Renaming windows and controlsIt is important to make sure windows and controls in the application repository use intuitive names that areconsistent with the tested application. For example, when you recorded the first script against an application,QAWizard Pro named a Username field control as editbox8. You can rename the control to use the field nametomore easily identify it in the repository and scripts.

Windows and controls are displayed alphabetically in the repository. When you renamewindows and controls,use the same name as in the application or use a naming convention that groups similar controls. Forexample, to group buttons, rename theOK and Cancel buttons in the repository to buttonCancel andbuttonOK.

Tip:When you review new windows and controls in the Repository Changes dialog box after recording ascript or populating the application repository, QA Wizard Pro suggests names for them based on propertyvalues captured from the application. To use a different naming format for new controls, you can overridethe default naming convention for specific control types to reduce the time spent manually renamingwindows and controls. SeeOverriding 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 ared 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 thePreview 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 anddecide 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

Page 158: QA Wizard Pro User Guide v2017 - Perforce

Finding and replacing property values

Tip: To rename awindow or control without opening the Properties dialog box, right-click it in theApplication Repository pane and chooseRename.

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 withinthe 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 awindow or control, scripts created before the change will not work untilyou update them. See Synchronizing with the application repository, page 143.

Finding and replacing property valuesIf an application changes, youmay 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. Forexample, 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. ChooseRepository > Find and Replace.

The Repository Find and Replace dialog box opens.

134

Page 159: QA Wizard Pro User Guide v2017 - Perforce

Finding and replacing property values

2. Select theRepository path you want to search.

3. Enter the value to search for in the Find field.

4. Enter the replacement value in theReplace 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 Allto replace the values without performing a find.

5. SelectMatch 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 thevalue 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 thatcontain 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 theURL 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, <unable to replace> is displayed in the NewExpected Value column.

10. Click Replace All to replace the value in all expected values in the search results.

11. Click Closewhen you are finished.

135

Page 160: QA Wizard Pro User Guide v2017 - Perforce

Merging controls

Merging controlsNew controls may be added to an application or existing control properties may change after you recordscripts. BecauseQAWizard Pro uses properties to identify a window or control, theremay be duplicates ofthe same object in the application repository. You canmerge controls to eliminate the duplicates and keep onecontrol 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 changedto Cancel in a later release. You record a new script and there are now two items in the repository for the samecontrol. You want scripts to use the Cancel button repository item only. You could delete the Exit button, butscripts that use the old control namewill fail. Merge the controls to delete the duplicate control withoutbreaking 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. ChooseRepository > Merge.

TheMerge Controls dialog box opens.

4. Select theControl to keep.

This is the control that remains in the application repository after the controls aremerged. The controlsthat will be removed are displayed in the Controls to remove list.

5. Click OK.

The controls aremerged.

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

Configuring user-added windows and controlsWhen creating or modifying scripts, you can only add statements that perform actions on windows or controlsif the windows or controls are already in the application repository. If QA Wizard Pro cannot add windows orcontrols you need to test during recording because they do not exist in the application or cannot be displayedwhen recording, you canmanually add them to the repository.

Youmay want to manually add windows and controls to the repository if:

136

Page 161: QA Wizard Pro User Guide v2017 - Perforce

Configuring user-added windows and controls

n You use a test-driven development process and need to create scripts for testing windows and controlsbefore 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 befaster than repopulating the repository.

n You cannot set up the computer you are recording on to capture a specific window or control. For example,youmay need to add a statement that clicks a button on a dialog box that only is only displayed inWindows Vista. If you do not have access to a Vista computer and record on aWindows 7 computer, thedialog box is not displayed. You canmanually add the window and control to the repository and then addstatements to scripts to handle the scenario.

You can add new windows and controls to the repository and configure the properties and search criteriabased on your knowledge of the application. You can also duplicate an existing window and control and thenmodify 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 informationwhenever possible. Only manually add windows or controls if you are familiar with how QAWizard Prouses properties and expected property values to locate controls during playback. See Modifying windowand control properties, page 122.

1. Select the application version in the Application Repository pane and chooseRepository > ModifyVersion Windows and Controls.

TheModify 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.

SeeManually 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

Page 162: QA Wizard Pro User Guide v2017 - Perforce

Manually adding windows and controls to application repositories

Tip: Tomove 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, page133.

5. Select a window or control and click Properties to modify the properties, such as the control type, searchmethod and criteria, and expected property values. See Editing and deleting user-added windows andcontrols, page 143.

6. Select a window or control and click Delete to delete it. See Editing and deleting user-added windows andcontrols, page 143.

7. Click OK to save the changes.

Manually adding windows and controls to applicationrepositoriesIf QA Wizard Pro cannot add windows or controls you need to test during recording because they do not existin the application or cannot be displayed when recording, you canmanually add them to the repository. Thislets you add controls for use in statements without needing to record first.

Youmay 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 controlsbefore 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 befaster than repopulating the repository.

n You cannot set up the computer you are recording on to capture a specific window or control. For example,youmay need to add a statement that clicks a button on a dialog box that only is only displayed inWindows Vista. If you do not have access to a Vista computer and record on aWindows 7 computer, thedialog box is not displayed. You canmanually add the window and control to the repository and then addstatements to scripts to handle the scenario.

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

1. Select the application version in the Application Repository pane and chooseRepository > ModifyVersion Windows and Controls.

TheModify Windows and Controls dialog box opens.

138

Page 163: QA Wizard Pro User Guide v2017 - Perforce

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 Duplicatingwindows and controls, page 142.

The Properties dialog box opens.

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

139

Page 164: QA Wizard Pro User Guide v2017 - Perforce

Adding properties to user-added windows and controls

4. Select aControl 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 theSearch Method tab to select themethod and criteria used to search for the window or controlduring playback. See About searchmethods, page 124.

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

6. Click theProperties tab to view or update the list of property names and values to save with the controlwhen it is added the repository.

You usually do not need tomake changes to this information. You can use it as a reference for validproperty names to use when adding Checkpoint or Property statements to scripts or creatingcustom XPath queries to locate HTML controls during playback. You can also add or delete propertiesbased 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 theAdvanced tab to select options that let QA Wizard Pro automatically update the properties usedduring recording and recommend better search criteria during playback. See Setting advanced controlproperties, page 131.

8. Click OK to add the control.

The control is displayed in theModify Windows and Controls dialog box. A overlay on the control typeicon indicates it is a user-added control instead of a control added by QAWizard Pro.

9. Repeat steps 2 - 8 to add additional controls.

Tip: Tomove 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 controlsEach 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 duringsubsequent recordings. They are also used as search criteria for the Standard searchmethod to find thecontrols during playback. See About searchmethods, page 124.

When you select the control type for a user-added window or control, a default set of properties isautomatically added to it. To use a property that is not added to the control by default as search criteria or tomake the control unique in the repository, you canmanually add the property and value.

Note: Make sure to only add valid properties to user-added windows or controls based on the technologyused to develop the test application. You cannot add properties to windows and controls added to therepository by QAWizard Pro.

1. Click Add Property on the SearchMethod or Properties tab in the Properties dialog box when you areadding or editing a user-added window or control.

140

Page 165: QA Wizard Pro User Guide v2017 - Perforce

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, QAWizard Procannot identify it during recording and playback, whichmay cause errors or add duplicate objects to therepository.

3. Enter theRepository value to save as the original value for the property when the control is added to therepository.

Enter a valid value based on your knowledge of the test application that can be used as a reference if theexpected property value is changed later. If you do not know the value to enter, ask the applicationdeveloper for help.

4. Enter theExpected value to specify the value to find in the application during playback. The repositoryand expected values usually match when you first add properties to windows or controls, but you canmodify 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 soQAWizard Pro can locate dynamic windows andcontrols when an application changes. For example, you can replace a URLwith the URLROOTrepository variable. To use a repository variable in the value, select it from the list and click Insert. Thevariable is replaced with the variable value used during playback. See Creating repository variables, page215.

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

5. Click OK add the property.

Make sure the property is selected on the SearchMethod tab in the Properties dialog box to use it assearch criteria when recording or running scripts.

141

Page 166: QA Wizard Pro User Guide v2017 - Perforce

Deleting properties from user-added windows and controls

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

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

1. Click Delete Property on the SearchMethod or Properties tab in the Properties dialog box when you areadding 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 controlsIf you need to add a window or control that is similar to an existing window or control in the repository, savetime by duplicating the existing control and then editing the properties in the new control. For example, if QAWizard Pro cannot distinguish between two similar buttons on a web page during recording and adds them tothe repository as one control instead of two, you can duplicate the captured button control and then update theproperties 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 informationwhenever possible. Only manually add windows or controls if you are familiar with how QAWizard Prouses properties and expected property values to locate controls during playback. See Modifying windowand control properties, page 122.

1. Select the application version in the Application Repository pane and chooseRepository > ModifyVersion Windows and Controls.

TheModify 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 controltype icon to indicate it is a user-added window or control.

142

Page 167: QA Wizard Pro User Guide v2017 - Perforce

Editing and deleting user-added windows and controls

Tip: Tomove 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 Addingstatements, page 146.

Editing and deleting user-added windows and controlsEdit a user-added window or control to change the properties, such as the name, control type, searchmethodand 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 chooseRepository > ModifyVersion Windows and Controls.

TheModify 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 windowor control.

n To edit a control, select it and click Properties. Make any changes and click OK. For informationabout control properties, seeManually adding windows and controls to application repositories, page138.

n To delete a window or control, select it and click Delete. If you delete a window, all child controls in itare 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 updatethem. See Synchronizing with the application repository, page 143.

Synchronizing with the application repositoryWhen you rename awindow or control, any scripts recorded before the change will fail. Youmust update thename in scripts. Synchronization allows you to quickly update scripts with the application repository, insteadof spending time searching through scripts to look for changed names.

1. Open the script you want to update.

2. ChooseScript > 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. Ifdifferences are found, the script is updated with the new names. A results dialog box that includes thenumber of references updated in the script opens.

4. Click OK to close the results dialog box.

Note: To updatemore than one script, select the scripts in theWorkspace pane and chooseScript >Synchronize Multiple with Application Repository. See Synchronizingmultiple scripts with theapplication repository, page 144.

143

Page 168: QA Wizard Pro User Guide v2017 - Perforce

Synchronizing multiple scripts with the application repository

Synchronizing multiple scripts with the application repositoryWhen you rename awindow or control, any scripts recorded before the window or control was renamedwillfail. Youmust synchronize the scripts with the application repository to update the old window and controlnames.

1. Select the scripts to update in theWorkspace pane.

2. ChooseScript > 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. Ifdifferences are found, the scripts are updated with the new names. A results dialog box that includes thenumber of references updated in each script opens.

5. Click OK to close the results dialog box.

Testing context menusQAWizard Pro can perform actions on context (shortcut) menu items. Testing context menus requires theContextMenu object in a script statement with the X and Y coordinates, relative to a window or control, forwhere to open themenu.

After you specify where the context menu should be opened, you can enter a context menu item to test and anobject action statement, such as Click or Select, or a low-level action statement, such as mousemovementstatements, 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 ([]). Forexample, Window("CRM").ContextMenu(150, 20).Item("Reports/[4]").Select().

144

Page 169: QA Wizard Pro User Guide v2017 - Perforce

Modifying ScriptsRecorded scripts provide a baseline for application testing. After recording, you can createmore flexible andcomplex scripts by adding statements, calling other scripts, creating checkpoints, and using data sources forinput data.

You canmodify scripts in Keyword View and Text View. Text View provides greater flexibility and allows youto 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 additionalstatements 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 performdifferent tasks, you can use the CallScript statement to combine them and createmore complex scripts thatperform multiple tasks as the same time. When a script is called, QAWizard Pro runs it to completion andthen 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 expectedvalue during playback. If the actual value in the tested application and the expected value do not match, thescript 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, QAWizard Pro reads input values from a local or external datasheet. See Creating Data-Driven Scripts, page 187.

Other script modification tasks

As you becomemore familiar with how scripts work, you can perform the following tasks to work with andmanage 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

Page 170: QA Wizard Pro User Guide v2017 - Perforce

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 statementsStatements are instructions that specify how QAWizard Pro interacts with the tested application. Functionsare statements that return a value to a variable that can be passed to other statements. Some statements areautomatically added during recording, but you canmanually add other statements to createmore powerful andflexible 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 beforeadding it.

n In Text View, you can add the statement and then copy and paste the steps to include in thestatement block between the starting and ending statements.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

Tip: You can drag a statement from the Statements pane or controls from the Preview pane andApplication 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 lettersof the statement name in the Filter field to display matching statements.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls 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. SeeStatement value types, page 147.

Note: Screenshots are displayed when you add some statements. The screenshot is updated whenyou 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 optionalOutput variable to assign the return value to.

The list includes script variables declared before the current line and repository variables for theapplication. 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

Page 171: QA Wizard Pro User Guide v2017 - Perforce

Statement value types

Statement value typesStatement input fields support a variety of value types. A default value type is selected for each field, but youcan change the value type. This can help you createmore dynamic statements that use values from variablesor 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 aQAWizard Pro constant selected from a drop-down list. QA Wizard Pro constant(e.g., control propertyname, True/False)

Key Input Uses keyboard input. Key input for KeyPress,KeyDown, and KeyUpstatements

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

All input fields

Datasheet Uses a value in the current row of the associated datasheetbased on the selected column.

All input fields

147

Page 172: QA Wizard Pro User Guide v2017 - Perforce

Using function results as statement arguments

Value type Description Field types

Variable Uses a selected script variable or repository variable defined forthe application.

All input fields

Function Uses the value returned from a function. Click Edit in thecorresponding field to add a function. See Using function resultsas statement arguments, page 148.

All input fields

Using function results as statement argumentsYou can use a value returned by a function as an argument value in statements. For example, you can parse astring 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 aremarked 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. SeeStatement value types, page 147.

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

5. Click OK.

The function is added.

148

Page 173: QA Wizard Pro User Guide v2017 - Perforce

Adding browser actions

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

QAWizard Pro can perform browser navigation actions, including browsing back and forward, refreshing apage, and adding, selecting, and closing tabs. Object actions, window actions, mouse actions, checkpoints,and someweb statements are also available for browsers.

When you add a browser action, the Browser object is used instead of theWindow object. For example, thestatement for navigating back in a browser window is Browser().Button("Back").Click() instead ofWindow("Browser").Button("Back").Click().

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

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select a statement from theWeb Browser Actions category. SeeWeb browser action statements, page350.

149

Page 174: QA Wizard Pro User Guide v2017 - Perforce

Cleaning up scripts

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select a web page from theBrowser Containing Page list to specify the window to perform the actionon.

<AnyPage> is selected by default. If this option is selected and the script opens multiple browserwindows 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 scriptsAfter you record scripts, youmay want to clean up the steps by deleting unnecessary steps or outlining blocksof steps to group them.

Deleting unnecessary steps

BecauseQAWizard Pro records every action you perform, youmay end up with extra script steps you do notneed. For example, youmay press Tab tomove to a field and then enter information. QAWizard Pro recordsmoving to a field and typing in that field as two separate steps. Scripts only require steps that perform anaction, such as entering a value or submitting data. Generally, you do not need steps that select or move toanother field.

Tip: Tominimize the amount of clean up, select a field with themouse instead of tabbing to it duringrecording.

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 canbe expanded or collapsed. When a block is collapsed, only the first line is displayed.

QAWizard Pro automatically outlines low-level actions. You can outline other blocks of steps in Text Viewand Keyword View.

150

Page 175: QA Wizard Pro User Guide v2017 - Perforce

Editing statements

n Text View—Enter a pound sign (#) on an empty line directly above the first script step you want to includein the block of steps. Enter a pound sign on an empty line directly below the last script step you want toinclude in the block.

n Keyword View—Ctrl+click the steps you want to include in the block. ChooseScript > Add Statement,select theOutline 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 isdisplayed in a collapsed, outlined block.

Editing statementsYou can edit a statement to change its arguments.

1. Select the step that contains the statement you want to edit and chooseScript > 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 statements1. Select the script step that includes the statement you want to delete.

2. ChooseEdit > Delete.

The statement is deleted.

Note: You cannot delete statements in Keyword View that cause a script to become invalid. Switchto Text View to delete the statement.

Calling scripts from other scriptsCalling scripts lets you share common actions between scripts and eliminate the need to re-create tests whenan application changes. As a best practice, try to create simple, modular scripts that focus on performing aspecific task. After you create scripts to perform different tasks, you can use the Script.CallScript statementto combine them and createmore complex scripts that perform multiple tasks at the same time. SeeScript.CallScript, page 528.

For example, if you are testing a web application that requires logging in, you can create a login script that canbe called from other scripts in the workspace. When the login script is called, QA Wizard Pro runs it tocompletion and then returns to the script that called it to continue playback. If errors occur during login or thelogin process changes in the application, you only have to update the login script instead of all scripts that usethe same steps. The following example shows a script with the Script.CallScript statement that calls anotherscript named Login.

151

Page 176: QA Wizard Pro User Guide v2017 - Perforce

Calling scripts from other scripts

Note: You can call standard QAWizard Pro scripts from load test scripts and vice versa. If a load testscript 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 inmultiple scripts. See Calling functions and subroutines from another script, page 33 and Calling scriptvariables from another script, page 31.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select theScript Call Script statement from the Script Control category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theScript name to call.

6. If the script uses an associated datasheet to perform data-driven actions, select Constant from the valuelist in theOptional datasheet name field and select the datasheet.

Data sources associated with called scripts are ignored unless you specify a datasheet for them in theScript.CallScript statement. If a datasheet is specified, the called script runs once for each row in it. If adatasheet is not specified, the called script only runs once, but has access to the variables and datasource associated with the calling script and any statements declared before the Script.CallScriptstatement.

7. Click OK to add the statement to the script.

152

Page 177: QA Wizard Pro User Guide v2017 - Perforce

Finding variable, function, and subroutine references in scripts

Tip: You can also drag a script from theWorkspace pane to the open script to automatically add aScript.CallScript statement.

Finding variable, function, and subroutine references inscriptsYou can find all places where variables, functions, and subroutines are referenced in scripts in the openworkspace. When you aremodifying or debugging scripts, you can use this information to determine theimpact 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, orsubroutine, 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 chooseScript > Go To Definition. See Finding variable, function, and subroutine definitions in scripts, page153.

1. Select the variable, function, or subroutine in a script and chooseScript > Find All References.

The number of references found in the workspace is displayed in the References pane. Each result showsthe 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 QAWizard Pro.

Finding variable, function, and subroutine definitions inscriptsQAWizard Pro provides different ways to find where user-defined variables, functions, and subroutines aredeclared in scripts. This can help you reference the definitions whenmodifying scripts and understand howthese 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 ascript and choose Find All References. See Finding variable, function, and subroutine references inscripts, page 153.

153

Page 178: QA Wizard Pro User Guide v2017 - Perforce

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 subroutinesin the open script. Refer to this list when setting values in statements tomake sure the correct variable,function, and subroutine names are used consistently. You can also quickly find functions and subroutinesthat cause errors when debugging scripts.

Select a variable, function, or subroutine in the Definition field to go to the line where it is defined. Thedefinition is highlighted in the script.

Note: If you are editing a statement inside a function or subroutine, the function or subroutine name isdisplayed in the Definition field for context and to help indicate that any changes may affect other parts ofthe 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 thatcontains it and chooseScript > Go To Definition. This helps you quickly find definitions in more specificcontexts, such as when variables are defined inside functions or subroutines. You can also use this option tofind 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 theGo Backand Go Forward toolbar buttons or chooseScript > Go Back orGo Forward. This helps you easilyreturn to the location you were working in if youmove betweenmultiple scripts.

Commenting blocks of stepsYou can comment blocks of steps, instead of commenting each script step. This allows you to quicklycomment out sections of scripts, which is useful if you want to includemultiple 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+clickstatements to select them.

2. Right-click and chooseComment Block.

154

Page 179: QA Wizard Pro User Guide v2017 - Perforce

Handling known exceptions

The selected steps are commented.

3. To uncomment a block of steps, select the statements. Right-click and chooseUncomment Block.

Note: You can also add a comment to a single step. See Rem, page 516.

Handling known exceptionsExceptions are known events in an application that interrupt its expected operation. For example, anapplicationmay display an error dialog box if a user does not enter a username or password. If the error isdisplayed during playback, the script fails unless it contains steps to handle this behavior.

To handle exceptions, record a script that captures the exception. Add theWaitForExists statement to thescript to determine if the exception occurs and use conditional statements to indicate how to handle theexceptions you want to ignore. SeeWaitForExists, 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 dialogbox is displayed. TheWaitForExists statement is used to determine if the error is displayed and assigns trueor false to the LoginError variable based on the result. The If statement is used to instruct QAWizard Pro toclick the OK button in the error dialog box if the LoginError variable value is true and continue playback withthe 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 errorsQAWizard 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 theOn Error ResumeNext statement and Err object to collect error information during playback. SeeOn Error, page 504.

n Use structured error handling to identify a block of statements that can raise errors under specificconditions to avoid script failure. You can use the Try...Catch...Finally statements can be used to provideadditional statements for handling errors. See Try...Catch...Finally, page 565.

You can use inline and structured error handling together, but typically you only use onemethod per script.Consider using structured error handling in scripts that require advanced error responses. The Finallystatement 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, performvarious checkpoints, and indicate the end of the output log. The Try...Catch...Finally statements allow theerrors 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 buttontext is incorrect")

155

Page 180: QA Wizard Pro User Guide v2017 - Perforce

Identifying files and directories in statements

Window("Login").Button("btnCancel").Checkpoint("Text", "Cancel", True, "Cancel buttontext is incorrect")

Window("Login").Button("btnHelp").Checkpoint("Text", "Help", True, "Help button textis 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 tocontinue even if errors are encountered in the called scripts.

The following example shows a controller script that launches several other scripts. TheOn Error ResumeNext 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 statementsYou can use file statements to perform actions on and return values from files and directories. See Filestatements, page 329. For best results, use full paths in these statements to identify the exact files anddirectories to interact with. If you use relative paths, an incorrect file or directory could be used duringplayback if files or directories with the same names are stored in different locations QAWizard 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 usesthe returned workspace or script directory and combines it with a filename or directory path to create a fullpath, which you can then use in other statements. Using this method to define full paths helps ensure correctfiles and directories are located when scripts run on different computers where directory paths are likelydifferent.

The following example creates a full path to a file in the directory that stores the open workspace or batch filethe 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 instatements.

156

Page 181: QA Wizard Pro User Guide v2017 - Perforce

Finding and replacing text in scripts

n Input files and directories are existing files and directories with information used in statements. Thesefiles and directories must exist in a location QA Wizard Pro searches to provide correct information whenscripts run. For example, if you use the CompareFileContents statement to compare files, both files mustexist 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 afile, 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 thefollowingmethods when scripts run.

If a relative pathreferences an:

These locations are searched in the followingorder:

If the file or directory isnot found:

Input file 1. Workspace or batch file

2. Directory that stores the open workspace orbatch file the script is in

3. Directory the script is in

An error occurs

Output file 1. Workspace or batch file

2. Directory that stores the open workspace orbatch file the script is in

The file is created

Input directory 1. Directory that stores the open workspace orbatch file the script is in

2. Directory the script is in

An error occurs

Output directory Directory that stores the open workspace or batchfile the script is in

The directory is created

Finding and replacing text in scriptsYou can search for and replace text in individual open scripts, multiple open scripts, or all scripts in aworkspace. For example, to change a product name in statements and comments, you can search for the textstring 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 chooseEdit > Find orEdit > Replace. See Finding andreplacing text in individual scripts, page 158.

n To find text in multiple scripts, chooseEdit > Find in Workspace. See Finding text in multiple scripts,page 159.

n To replace text in multiple scripts, chooseEdit > Replace in Workspace. See Replacing text in multiplescripts, page 160.

Tip: To find all references to a variable, function, or subroutine in the workspace, select it in a script andchooseScript > Find All References. See Finding variable, function, and subroutine references inscripts, page 153.

157

Page 182: QA Wizard Pro User Guide v2017 - Perforce

Finding and replacing text in individual scripts

Finding and replacing text in individual scriptsYou can search for and replace text in a script. For example, if you change a variable name, you can find andreplace 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, chooseEdit > Find or Edit > Replace.

To only search in a specific section, select the script steps and chooseEdit > 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 expressionfor amore flexible search.

4. Enter the text to replace the returned text with in theReplace with field.

Note: You can use a regular expression in the Find what or Replace with fields. Expand the FindOptions and select Use regular expressions. Click next to text fields to view regular expressioncharacters.

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

Page 183: QA Wizard Pro User Guide v2017 - Perforce

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' doesnot 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 Findwhat 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 scriptsYou 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, page160.

1. ChooseEdit > Find in Workspace.

The Find and Replace inWorkspace 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 expressionfor amore flexible search.

3. Select an option from the Look in list. You can search all scripts in the workspace or all open scripts inthe 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

Page 184: QA Wizard Pro User Guide v2017 - Perforce

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' doesnot find 'clicks' or 'double-click'.

n Use regular expressions searches for a text pattern that matches the regular expression in the Findwhat field.

5. Click Find All.

The number of results found in the workspace is displayed in Find Results pane. Each result shows thescript 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 scriptsYou can replace text in multiple open scripts or all scripts in a workspace. For example, if a control namechanges 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 expressionfor amore flexible search.

3. Enter the text to replace the returned text with in theReplace with field.

160

Page 185: QA Wizard Pro User Guide v2017 - Perforce

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 inthe 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' doesnot find 'clicks' or 'double-click'.

n Use regular expressions searches for a text pattern that matches the regular expression in the Findwhat 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 orCollapse Allto 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 thechanges.

161

Page 186: QA Wizard Pro User Guide v2017 - Perforce

Encrypting text

Encrypting textYou can encrypt text strings tomake the text unreadable. Text encryption conceals the actual text entered infields, such as passwords. Passwords are automatically encrypted during recording, but you can re-encryptvalues that have beenmodified 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 theOriginal text.

The encrypted text is automatically generated.

3. Click Copy.

The encrypted text is copied to the clipboard.

4. Click Closewhen 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 elementsText in HTML elements is not captured and saved in the application repository during recording because it isnot a property of a window or control. To perform actions based on text on a web page or verify that the text iscorrect, you can add HTMLFindByID, page 450 and HTMLFindByTag, page 451 statements that examineHTML code and return text to scripts.

HTMLFindByID

The HTMLFindByID statement returns a string that contains the inner text of the tag with the specified HTMLelement ID. The following example uses this statement to return the ticket number from a confirmation webpage.htmlText = Window("Thank You").ExtractHTMLToString()

ticketNum = HTMLFindByID(htmlText, "ticket")

If ticketNum = "" Then

162

Page 187: QA Wizard Pro User Guide v2017 - Perforce

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 usingthe ExtractHTMLToString statement.

n The ticketNum variable is declared. The variable value is the string returned by the HTMLFindByIDstatement, 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:<td bgcolor="#DDF8D8" id="ticket">W72236</td>

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 HTMLelement with the specified tag. The following example uses this statement to return the text starting at anindex 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 pageusing the ExtractHTMLToString statement.

n The tag variable is declared. The variable value is an array of strings returned by the HTMLFindByTagstatement, 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 accessedusing 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 inthe tag variable. If "CustomerB" is returned, "The customer is" followed by the value of array index 2 isprinted in the Output pane.

Modifying script propertiesYou canmodify properties to rename a script or associate a datasheet with the script. As you add scripts andmake changes to existing ones, youmay find that a script name is no longer clear or does not accuratelydescribe its purpose.

1. Select a script.

2. Choose File > Properties.

The Properties dialog box opens.

163

Page 188: QA Wizard Pro User Guide v2017 - Perforce

About drag-and-drop scripting

3. Enter a new script Name.

4. Click OK to save the changes.

About drag-and-drop scriptingYou can drag elements from different QAWizard Pro panes directly into the Script pane tomore quickly createandmodify 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 theAdd Statement dialog box with the control pre-selected if parameters need to be set. Controls can also bedropped into the Statements pane to generate statements in an active script. SeeModifying Scripts, page145.

n Application versions from the Application Repository pane to add a SetContext statement to a script. SeeScript.SetContext, page 534. If the script already contains a context, a ClearContext statement is addedbefore 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 addstatements 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 atthe same time. Blocks of steps, such as If statements, are dragged as a single unit.

164

Page 189: QA Wizard Pro User Guide v2017 - Perforce

Using CheckpointsCheckpoints help you verify the tested application is working as expected. Checkpoints verify that attributesof an application exist or are correct when compared to an expected value during playback. For example, acheckpoint 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 orwarning in the Errors pane.

You can create window, control, and exists checkpoints during or after recording. Image andOCRcheckpoints can only be created after recording. See Checkpoint types, page 165 for additional informationand examples.

Note: You can also use checkpoints to verify if expressions are true and substrings are part of textstrings.

Checkpoint typesQAWizard Pro includes the following types of checkpoints.

Type Use to: Moreinformation

Window Verify the property values of application windows against an expectedvalue. For example, you can verify a window is maximized or has focus.

Creatingcheckpoints,page 169

Control Verify the property values of application controls against an expected value.For example, you can verify a control contains specific text, has focus, orthat some controls contain a specific number of items.

Creatingcheckpoints,page 169

Exists Check if windows or controls exist in the application. For example, you canverify that a contact form contains a Submit button.

Creatingexistscheckpoints,page 171

Expression Verify that an expression evaluates to True. For example, you can verify avariable value is less than a specified limit or that values returned by twovariables are different.

Creatingexpressioncheckpoints,page 176

Image Verify an image in the application against an expected image. For example,you can verify an image contains the correct colors or is displayed in thecorrect location.

Creatingimagecheckpoints,page 173

165

Page 190: QA Wizard Pro User Guide v2017 - Perforce

Creating record-time checkpoints

Type Use to: Moreinformation

OpticalCharacterRecognition(OCR)

Verify graphical text in images, controls QAWizard Pro cannot recognize,or a region in a window or control against an expected value. For example,you can verify text in web pages and images, such as charts and graphs.

CreatingOCRcheckpoints,page 183

StringExists

Check that a text substring exists or does not exist in another text string.For example, you can check for keywords in a label or verify data returnedfrom aURL in a load test script.

Creatingstring existscheckpoints,page 177

Creating record-time checkpointsYou can create checkpoints when recording a script or add them after recording. It is generally easiest tocreate checkpoints during recording. As you follow the steps in a test case and perform actions for QAWizardPro 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 thecheckpoint when recording a script and then edit the checkpoint statement after recording. See Editingcheckpoints, page 171.

1. Click theCheckpointRecording toolbar button when recording a script.

QA Wizard Pro switches to checkpoint mode. In this mode, the selected window or control is outlinedwith 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

Page 191: QA Wizard Pro User Guide v2017 - Perforce

Creating record-time checkpoints

Tip: Right-click a window or control to display a list of available controls to check. As youmouseover 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 toselect.

3. Select theProperty to check. TheExpected Value is automatically populated with the value in theCurrent Value column.

4. Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails.

5. Select the Failure Behavior.

n Generate an error and stop playback stops script playback, displays amessage in the Errors pane,and adds themessage to the run report.

n Generate a warning and continue playback continues running the script, displays amessage in theErrors pane, and adds themessage 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 theCheckpointRecording toolbar button to exit checkpointmode and continue recording.

167

Page 192: QA Wizard Pro User Guide v2017 - Perforce

Creating record-time check exists checkpoints

Creating record-time check exists checkpointsDuring recording, you can create exists checkpoints that verify that a specific window or control exists in theapplication. For example, you verify that a contact form on your web site contains a Submit button.

1. Click theCheckpointRecording toolbar button when recording a script.

QA Wizard Pro switches to checkpoint mode. In this mode, the selected window or control is outlinedwith 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 anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails.

5. Select the Failure Behavior.

n Generate an error and stop playback stops script playback, displays amessage in the Errors pane,and adds themessage to the run report.

n Generate a warning and continue playback continues running the script, displays amessage in theErrors pane, and adds themessage 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 theCheckpointRecording toolbar button to exit checkpointmode and continue recording.

168

Page 193: QA Wizard Pro User Guide v2017 - Perforce

Creating checkpoints

Note:When the script runs, QAWizard Pro waits for up to 30 seconds for the window or control toappear. The checkpoint fails if QA Wizard Pro cannot verify that the window or control exists.

Creating checkpointsCheckpoints verify that the value of a property in an application window or control matches an expected value.

During recording, QAWizard Pro captures properties of windows and controls in the application. Theseproperties are saved in the application repository and used during playback to locate objects. If the scriptinteracts with a window or control and the value of one of the properties used as search criteria changes, thescript 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 failthe script if the expected and actual values do not match. The available properties vary based on the type ofcontrol. 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 tomake 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, youmay need tocapture the new objects before you can create checkpoints for them. You can record a new script tocapture the objects or populate the repository to add windows and controls without recording. SeePopulating repositories, page 60.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint in the Checkpoint category.

169

Page 194: QA Wizard Pro User Guide v2017 - Perforce

Creating checkpoints

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow to check.

A screenshot of the selected window is displayed.

6. If you are creating a control checkpoint, select theControl 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 contextmenus, 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 theProperty 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 afunction that returns the value.

Note: If you need to create an HTML table checkpoint, see Creating HTML table checkpoints, page240.

170

Page 195: QA Wizard Pro User Guide v2017 - Perforce

Editing checkpoints

10. Enter or select theExpected 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, displaysamessage in the Errors pane, and adds themessage to the run report. Generate a warning andcontinue playback continues running the script, displays amessage in the Errors pane, and adds themessage to the run report.

n Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails. You can use a text string (default), expression, datasheet column value, variable, orfunction that returns the value.

12. Click OK to add the statement to the script.

Editing checkpointsYou canmodify a checkpoint to change the selected window, control, or properties and to change theexpected value.

1. Select the step that contains the checkpoint you want to edit.

2. ChooseScript > Edit Statement.

The Edit Statement dialog box opens.

3. Make any changes.

4. Click OK to save the changes.

Creating exists checkpointsExists checkpoints verify that a window or control exists in the application. The checkpoint fails if the windowor control is not found during playback.

Note: If windows or controls are added to an application after the script is recorded, youmay need tocapture the new objects before you can create checkpoints for them. You can record a new script tocapture the objects or populate the repository to add windows and controls without recording. SeePopulating repositories, page 60.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select Check Exists in the Checkpoint category.

171

Page 196: QA Wizard Pro User Guide v2017 - Perforce

Creating exists checkpoints

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow to check.

A screenshot of the selected window is displayed.

6. If you are creating a control checkpoint, select theControl 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 contextmenus, 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, displaysamessage in the Errors pane, and adds themessage to the run report. Generate a warning andcontinue playback continues running the script, displays amessage in the Errors pane, and adds themessage to the run report.

n Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails. You can use a text string (default), expression, datasheet column value, variable, orfunction 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

Page 197: QA Wizard Pro User Guide v2017 - Perforce

Creating image checkpoints

Creating image checkpointsImage checkpoints verify that an image in an applicationmatches an expected image. For example, you canverify 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 previousstatement as the expected image. If the test area in the application does not match the expected image withinaminimum percentage of accuracy, the checkpoint fails.

1. Select the script line above where to add the statement. Youmust select a statement that performs anaction in the application.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint Image in the Checkpoint category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

173

Page 198: QA Wizard Pro User Guide v2017 - Perforce

Creating image checkpoints

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Click theActual screenshot and drag the red rectangle to select the area to check or enter the Test Areainformation to specify the area to verify.

The Test Area fields are automatically populated based on the location and size of the rectangle relative tothe 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 addingthe checkpoint.

6. Click Save As Expected to save the actual image as the expected image to compare with the applicationduring 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 theminimum percentage of Accuracy between the actual and expected image required to pass thecheckpoint.

The actual and expected images may not match exactly. For example, if theminimum percentage ofaccuracy is 80% and the accuracy calculated during playback is 85%, the checkpoint passes withoutrequiring an exact match. The default accuracy is 100%.

Note: If you click Test before adding the statement, the actual and expected image always matchbecause the expected image is the same as the image in the application repository. If a checkpointfails during playback, you can edit it and click Test to compare the expected image against the actualimage captured when the script ran. This can help you determine if changes are needed to theexpected 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, displaysamessage in the Errors pane, and adds themessage to the run report. Generate a warning andcontinue playback continues running the script, displays amessage in the Errors pane, and adds themessage to the run report.

n Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails. You can use a text string (default), expression, datasheet column value, variable, orfunction 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

Page 199: QA Wizard Pro User Guide v2017 - Perforce

Editing image checkpoints

Editing image checkpointsYou can edit an image checkpoint to change the area to check, the expected image, or the accuracypercentage required for it to pass.

1. Select the step that contains the checkpoint to edit.

2. ChooseScript > 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 andexpected images is displayed.

Note: If the difference percentage is within an acceptable range to pass the checkpoint, youmaywant to adjust the accuracy percentage in the Edit Statement dialog box. For example, if theminimum accuracy is 92% and the difference percentage during playback is 90%, the checkpointfails.

4. Select Flicker from the Diff Mode list to flash the differences in the expected image. This can help youidentify 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

Page 200: QA Wizard Pro User Guide v2017 - Perforce

Creating expression checkpoints

Creating expression checkpointsExpression checkpoints verify if a value returned by an expression is True. The checkpoint fails if theexpression evaluates to False.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint Expression in the Checkpoint category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Enter theExpression 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, displaysamessage in the Errors pane, and adds themessage to the run report. Generate a warning andcontinue playback continues running the script, displays amessage in the Errors pane, and adds themessage to the run report.

n Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails. You can use a text string (default), expression, datasheet column value, variable, orfunction 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

Page 201: QA Wizard Pro User Guide v2017 - Perforce

Creating string exists checkpoints

Creating string exists checkpointsString 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 thesubstring is found.

Note: These are the only checkpoints you can add to load test scripts. They are typically used to verifydata returned fromWebGet andWebPost statements. See Load Testing, page 103.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint String Exists orCheckpoint String Not Exists in the Checkpoint category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls 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 columnvalue, variable, or function that returns the value.

6. Enter theSubstring 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 checkpoints1. Select the step that contains the checkpoint you want to delete.

2. ChooseEdit > Delete.

177

Page 202: QA Wizard Pro User Guide v2017 - Perforce

Checkpoint examples

The checkpoint is deleted.

Checkpoint examplesThe following examples show statements that verify properties of windows and controls. The properties youcan 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 AddStatement dialog box to add these statements and view the resulting statement in Keyword View.

Verifying window propertiesIn the following example, a checkpoint verifies a window is maximized. The Checkpoint statement verifies thevalue of theWindow Is Maximized window property is True, which indicates the window is maximized. If thewindow is not maximized, the checkpoint fails, playback stops, and "TheWysiCorp CRMwindow is notmaximized" is displayed in the Errors pane.Window("WysiCorp CRM").Checkpoint("Window Is Maximized", True, True, "The WysiCorp CRMwindow is not maximized")

Verifying static text in a controlIn the following example, a checkpoint verifies text on a button. The Checkpoint statement verifies the Textproperty for the buttonConnect button in theWysiCorp CRMLogin window is Connect. If the button text is notConnect, the checkpoint fails, playback stops, and "The Connect button text is incorrect" is displayed in theErrors pane.Window("WysiCorp CRMLogin").Button("buttonConnect").Checkpoint("Text", "Connect", True,"The Connect button text is incorrect")

Verifying dynamic text in a controlIn 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 verifiesthe Inner Text value for the Ticket HTML element control starts with aW. The@@ at the beginning of thevalue indicates to use a regular expression to check that the string starts with W. The .* indicates that theremaining characters can be any value. If the ticket number does not start withW, 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 controlIn the following example, a checkpoint verifies a tab has focus, or is currently selected. The Checkpointstatement verifies the Focused property for the Accounts tab on the tabControl tab bar in theWysiCorp CRMwindow 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 listsIn the following example, a checkpoint verifies a combo box contains a specific number of items. The

178

Page 203: QA Wizard Pro User Guide v2017 - Perforce

Capturing and checking property values during playback

Checkpoint statement verifies Number of Items property for the projectNameComboBox control in theWysiCorp 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 Errorspane.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 listsIn the following example, a checkpoint verifies a combo box contains the correct values. The Checkpointstatement verifies the ListItems property for the projectNameComboBox control in theWysiCorp CRMLoginwindow contains the following items: WysiCorp and ACME Bank. If the list does not contain all of theseitems, the checkpoint fails, playback stops, and "The Projects list does not contain the correct values" isdisplayed 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 controlsIn the following example, a checkpoint verifies a button is disabled. The Checkpoint statement verifies theEnabled property for the buttonEdit button in theWysiCorp CRMwindow is False, which indicates the buttonis disabled. If the button is enabled, the checkpoint fails, playback stops, and "The Edit button is enabled, butan item is not selected" is displayed in the Errors pane.Window("WysiCorp CRM").Button("buttonEdit").Checkpoint("Enabled", False, True, "The Editbutton is enabled, but an item is not selected")

Verifying a control existsIn the following example, a checkpoint verifies a tab exists. The CheckExists statement verifies the Accounttab in the tabControl tab bar in theWysiCorp CRMwindow exists. If the tab does not exist, the checkpointfails, playback stops, and "The Accounts tab does not exist" is displayed in the Errors pane.Window("WysiCorp CRM").TabBar("tabControl").Tab("Accounts").CheckExists(True, "TheAccounts tab does not exist")

Verifying properties match database valuesSee the DatabaseCheckpoints sample workspace for examples of using checkpoints to verify propertyvalues against database records.

Capturing and checking property values during playbackThe Property statement, which performs actions similar to checkpoints, captures window and control propertyvalues 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 valuedoes not match an expected value or when you do not know the expected value until the script runs. You canalso 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 pulledfrom a datasheet. You do not know the value entered in the Username field until the script runs.

179

Page 204: QA Wizard Pro User Guide v2017 - Perforce

Capturing and checking property values during playback

In the following script, the Property statement captures the value entered in the Username field and assigns itto a variable namedmyUser. Next, the If statement evaluates themyUser variable value. If the variable valueis sales, the TypeText statement enters 'money" in the Password edit box in theWysiCorp CRMLoginwindow. If the variable value is not sales, the TypeText statement in the Else block enters 'guest' in thePassword 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 waschanged to a different control type. QAWizard Pro uses optical character recognition (OCR) to interpretthe text. Keep inmind that OCR technology is not exact and the results may vary.

180

Page 205: QA Wizard Pro User Guide v2017 - Perforce

Using OCR to Work with Graphical TextQAWizard Pro uses optical character recognition (OCR) technology to read graphical text in applications andconvert it to text strings.

You can use theOCRGetText, page 497 statement to return text from images, control types QAWizard Procannot recognize, or a specified region in a window or control for use in other statements. Other OCRstatements are also available to perform different OCR actions, such as checkpoints. SeeOCR statements,page 342.

SomeOCR statements use a specific region relative to a window or control to find graphical text inapplications. To provide themost accurate region to check, use the Add Statement dialog box to addOCRstatements.

Note: The following information shows how to add theOCRGetText statement. Steps for adding otherOCR statements are similar.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select OCR Get Text in the OCR category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow to check for text in.

A screenshot of the selected window is displayed.

181

Page 206: QA Wizard Pro User Guide v2017 - Perforce

Using OCR to Work with Graphical Text

6. If you are checking for text in a control, select theControl.

The selected control is outlined with a red box in the screenshot.

7. Enter theOCR 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 updatesthe values.

n Left specifies the pixel location of the left side of the rectangle that contains the text, relative to theselected window or control.

n Top specifies the pixel location of the top side of the region that contains the text, relative to theselected 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 theaccuracy of found text and change theOCR language file to identify non-English characters before addingthe statement. See Setting playback options, page 76.

Note: OCR technology is not exact. See Troubleshooting OCR issues, page 186 for tips that canhelp provide best results.

9. Click OK to close the test dialog box.

10. If you are adding a function, select an optionalOutput variable to assign the return value to.

The list includes script variables declared before the current line and repository variables for theapplication. 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.

ExampleThe following example shows a script with anOCRGetText statement that returns converted graphical textfrom a specified region in the elementLoginTester control on theWysiCorp Home page and assigns it to thepassword 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 onthe web page where OCR was performed if theWysiCorp Report a Bug page does not load because the log infails. This image can then be used during debugging to help determine if the text returned by OCR or someother 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

Page 207: QA Wizard Pro User Guide v2017 - Perforce

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 checkpointsOptical character recognition (OCR) reads graphical text in applications and converts it to a text string. CreateOCR checkpoints to verify text in images, controls QAWizard Pro cannot recognize, or in a specified regionin 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 notmatch exactly due to factors such as font, font size, and contrasting background colors. Because of this, youcan specify theminimum level of accuracy for the checkpoint to pass. You can also change the defaultoptions 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. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select OCR Checkpoint in the OCR category.

183

Page 208: QA Wizard Pro User Guide v2017 - Perforce

Creating OCR checkpoints

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow to check for text in.

A screenshot of the selected window is displayed.

6. If you are checking for text in a control, select theControl.

The selected control is outlined with a red box in the screenshot.

7. Enter or select theExpected 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 theminimum percentage of Accuracy required between the actual and expected text to pass thecheckpoint.

The text in the application and the expected text may not match exactly. For example, if theminimumaccuracy percentage is 80% and the accuracy during playback is 85%, the checkpoint passes withoutrequiring an exact match. The default accuracy is 92%.

184

Page 209: QA Wizard Pro User Guide v2017 - Perforce

Creating OCR checkpoints

9. Enter theOCR 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 updatesthe values.

n Left specifies the pixel location of the left side of the rectangle that contains the text, relative to theselected window or control.

n Top specifies the pixel location of the top side of the region that contains the text, relative to theselected 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 accuracypercentage calculated when comparing the values. You can use this information to change the expectedtext or minimum accuracy tomake sure the checkpoint passes during playback. For example, if the testfails with 90% accuracy, you can decrease to theminimum 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, displaysamessage in the Errors pane, and adds themessage to the run report. Generate a warning andcontinue playback continues running the script, displays amessage in the Errors pane, and adds themessage to the run report.

n Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails. You can use a text string (default), expression, datasheet column value, variable, orfunction 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 checkpointsthat are no longer needed. See Editing checkpoints, page 171 and Deleting checkpoints, page 177.

ExampleThe ACME Bank login pagemenu bar uses images as buttons. You need to verify the text in each imagewhen the login script runs. The first menu bar button is PRODUCTS, which is the expected text in thecheckpoint. When the script runs, if the selected area in the tested applicationmatches the expected text(PRODUCTS) with 92% ormore accuracy, the checkpoint passes. If the text matches with 91% or lessaccuracy, the checkpoint fails, playback stops, and "Products button text is incorrect" is displayed in theErrors pane.

The following example shows theOCRCheckpoint statement:Window("ACME Bank").OCRCheckpoint(92, "PRODUCTS", 222, 66, 59, 12, True, "Products buttontext is incorrect")

185

Page 210: QA Wizard Pro User Guide v2017 - Perforce

Troubleshooting OCR issues

Troubleshooting OCR issuesOptical character recognition (OCR) technology is not exact. The following tips can help you successfully useOCR in QAWizard Pro.

n Use the test computer the script will run on to record scripts and add or debugOCR statements. Changesto the test environment, such as different screen resolutions, web browsers, orWindows themes, mayaffect 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 recordingbecause 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 positionedvertically or at an angle.

n OCR best recognizes dark-colored text on a contrasting background (e.g., black text on a whitebackground). 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 theOCRSetContrast statement toscripts to adjust it during playback. See Setting playback options, page 76 andOCRSetContrast, page501.

n Use the SaveRegionToImageFile statement to capture a screenshot of the region OCR reads text from ifOCR statements fail. You can use this screenshot to review the graphical text and change the region toreturn text from. See SaveRegionToImageFile, page 527. After verifying the region is correct, use theOCRGetTextFromFile statement to check the text returned from it. SeeOCRGetTextFromFile, page 498.If the text is incorrect, you can use theOCRConvertToGrayscale, OCRSetContrast, and OCRSetScalestatements to adjust the settings used for OCR. SeeOCRConvertToGrayscale, page 493,OCRSetContrast, page 501, andOCRSetScale, page 503.

n QAWizard Pro uses the Tesseract OCR engine. QAWizard 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 OCRlanguage file or add the OCRSetLanguageFilePath statement to scripts to specify the language file to useduring playback. See Setting playback options, page 76 andOCRSetLanguageFilePath, page 502.

186

Page 211: QA Wizard Pro User Guide v2017 - Perforce

Creating Data-Driven ScriptsData-driven testing allows you to test multiple scenarios and data ranges with one script. Instead of usinghard-coded values or creating a script for each set of data, data-driven scripts use a different set of test dataeach time the script runs. Data-driven testing also separates test data from the script, making it easier tomodify 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 withdatasheet values. When the script runs, the input values are read from the datasheet. The script repeats touse each row in the datasheet, allowing you to quickly test large amounts of data with one script.

About datasheetsQAWizard Pro supports both local and external datasheets. You can create test data in QAWizard Pro usinga local datasheet, which is a simple spreadsheet that is stored locally. You can also link to external test datastored inMicrosoft Access, Microsoft Excel, Microsoft SQL Server, Oracle, PostgreSQL, SQLite, or textfiles.

n Local datasheets are useful for testing a small amount of data or maintaining test data in QAWizard 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 Configuringexternal 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 datasheetsLocal datasheets are helpful if you have a small amount of data to test or you want to create andmaintain testdata in QAWizard Pro.

1. ChooseData > Create Datasheet.

The Create Datasheet wizard opens.

2. Select Create a local datasheet.

3. Click Next.

4. Enter aColumn Name and press Enter.

187

Page 212: QA Wizard Pro User Guide v2017 - Perforce

Adding existing local datasheets

Tip: Right-click and choose Insert Row orDelete 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 tomove 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 thenreplace the data in the script with datasheet values. See Associating datasheets with scripts, page203 and Using datasheet values in scripts, page 203.

Adding existing local datasheetsIf 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 youmake tothe datasheet are simultaneously made in all workspaces.

1. ChooseData > 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

Page 213: QA Wizard Pro User Guide v2017 - Perforce

Importing external test data

Importing external test dataYou can import test data into QAWizard Pro. This is helpful if you want to be able to change the test data inQAWizard Pro without affecting the external data source.

Note: If you want to automatically update local test data when changes aremade in the external datasource or vice versa, link to the data source instead. See Linking to external test data, page 189.

1. ChooseData > Create Datasheet.

The Create Datasheet wizard opens.

2. Select Import data from external source.

3. Click Next.

4. Select aDatasheet type.

The fields are different depending on the datasheet type. See Configuring external datasheets, page 190.

5. Enter or select theDatasheet 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 thenreplace the data in the script with datasheet values. See Associating datasheets with scripts, page203 and Using datasheet values in scripts, page 203.

Linking to external test dataYou can retrieve test data from an external data source by creating a linked datasheet. Linked datasheets aresynced between QAWizard Pro and the external data source, which eliminates the need for manual updates.When changes aremade to the test data in QA Wizard Pro or from scripts, the external source isautomatically updated and vice versa.

Note: You can only edit linkedMicrosoft Excel datasheets if Excel is installed on the test computer. Youcannot edit linked text datasheets from QAWizard Pro or scripts.

If you only want to copy test data to a datasheet andmake changes locally without affecting the externalsource, import the data instead. See Importing external test data, page 189.

1. ChooseData > Create Datasheet.

The Create Datasheet wizard opens.

2. Select Link to data in external source.

3. Click Next.

4. Select aDatasheet type.

The fields are different depending on the datasheet type. See Configuring external datasheets, page 190.

189

Page 214: QA Wizard Pro User Guide v2017 - Perforce

Configuring external datasheets

5. Enter or select theDatasheet Options.

6. Click Next.

7. Enter aDatasheet 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 thedata in the script with datasheet values. See Associating datasheets with scripts, page 203 and Usingdatasheet values in scripts, page 203.

Configuring external datasheetsQAWizard Pro can retrieve test data from external sources, includingMicrosoft Access, Microsoft Excel,Microsoft SQL Server, Oracle, PostgreSQL, SQLite, and text files. There are two options for retrievingexternal 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 QAWizard Pro without modifying data in theexternal source, import the test data from the external source. After the data is imported to QAWizard Pro,you canmodify it locally to test different scenarios. See Importing external test data, page 189.

If you want to sync the data between the external source andQAWizard Pro, link to the data. When changesaremade in the external source, data in the linked datasheet is automatically updated and vice versa. SeeLinking to external test data, page 189.

Creating Microsoft Access datasheetsIf you have a large amount of existing test data in aMicrosoft Access database, you can create an externaldatasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve asubset of data, or use a script-generated query to retrieve data during playback.

1. ChooseData > 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 andmaintains it in QAWizard 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 QAWizard Pro datasheet are synced with the source and vice versa.

3. Click Next.

4. SelectMicrosoft Access database as theDatasheet type.

190

Page 215: QA Wizard Pro User Guide v2017 - Perforce

Creating Microsoft Access datasheets

5. Enter the path to the Access file or click Browse to select it.

6. Enter theUser andPassword if user-level security is configured for the database. The default Accessuser 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 aSource 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 mustreturn data from the source database to populate the datasheet. See Retrieving external data withdatabase queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. Thisoption is only available if the datasheet links to an external data source. If this option is selected, youcannot view or edit the datasheet in QAWizard Pro or modify the data source using scripts. SeeRetrieving external data with script-generated queries, page 207.

10. Click Next.

11. Specify the datasheet properties.

191

Page 216: QA Wizard Pro User Guide v2017 - Perforce

Creating Microsoft Excel datasheets

n If you are importing data, click Browse to select theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet name.

12. Click Finish to add the datasheet to the workspace.

Creating Microsoft Excel datasheetsIf you have a large amount of existing test data in aMicrosoft Excel file, you can create an external datasheetto use it in data-driven scripts. You can retrieve all data from aworksheet in the file or use a script-generatedquery to retrieve data during playback.

1. ChooseData > 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 andmaintains it in QAWizard 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 QAWizard 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. SelectMicrosoft Excel sheet as theDatasheet type.

5. Enter the path to the Excel file or click Browse to select it.

6. Select aSource to use to retrieve data from the file.

192

Page 217: QA Wizard Pro User Guide v2017 - Perforce

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. Thisoption is only available if the datasheet links to an external data source. If this option is selected, youcannot view or edit the datasheet in QAWizard Pro or modify the data source using scripts. SeeRetrieving 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 isnot 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 theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet name.

10. Click Finish to add the datasheet to the workspace.

Creating Microsoft SQL Server datasheetsIf you have a large amount of existing test data in aMicrosoft SQL Server database, you can create anexternal datasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrievea subset of data, or use a script-generated query to retrieve data during playback.

1. ChooseData > 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 andmaintains it in QAWizard 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 QAWizard Pro datasheet are synced with the source and vice versa.

3. Click Next.

4. SelectMicrosoft SQL Server database as theDatasheet type.

193

Page 218: QA Wizard Pro User Guide v2017 - Perforce

Creating Microsoft SQL Server datasheets

5. Enter theServer host name or IP address.

6. Enter theDatabase name.

7. Select aNetwork 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 anAuthentication type.

n Use Windows authentication uses the username and password of the user logged in to thecomputer running QAWizard Pro to validate the SQL Server account name and password.

n Use SQL Server authentication uses the SQL Server username and password. Enter theUser andPassword.

9. Select aSource to use to retrieve data from the database.

194

Page 219: QA Wizard Pro User Guide v2017 - Perforce

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 mustreturn data from the source database to populate the datasheet. See Retrieving external data withdatabase queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. Thisoption is only available if the datasheet links to an external data source. If this option is selected, youcannot view or edit the datasheet in QAWizard Pro or modify the data source using scripts. SeeRetrieving external data with script-generated queries, page 207.

10. Specify the datasheet properties.

n If you are importing data, click Browse to select theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet name.

11. Click Finish to add the datasheet to the workspace.

Creating Oracle datasheetsIf you have a large amount of existing test data in an Oracle database, you can create an external datasheet touse it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, oruse a script-generated query to retrieve data during playback.

Note: Oracle 8i release 3 and later databases are supported.

1. ChooseData > 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 andmaintains it in QAWizard 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 QAWizard Pro datasheet are synced with the source and vice versa.

3. Click Next.

4. Select Oracle database as theDatasheet type.

195

Page 220: QA Wizard Pro User Guide v2017 - Perforce

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 OracleServer address andServer port. The default port is1521. Select a database connection option and enter theSID/Service name. Connect via SIDconnects to the database using a system identifier. Connect via Service Name connects to thedatabase using the service name.

6. Select anAuthentication 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 theUser andPassword.

7. Select aSource to use to retrieve data from the database.

196

Page 221: QA Wizard Pro User Guide v2017 - Perforce

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 mustreturn data from the source database to populate the datasheet. See Retrieving external data withdatabase queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. Thisoption is only available if the datasheet links to an external data source. If this option is selected, youcannot view or edit the datasheet in QAWizard Pro or modify the data source using scripts. SeeRetrieving 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 theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet name.

10. Click Finish to add the datasheet to the workspace.

Creating PostgreSQL datasheetsIf you have a large amount of existing test data in a PostgreSQL database, you can create an externaldatasheet to use it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve asubset of data, or use a script-generated query to retrieve data during playback.

1. ChooseData > 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 andmaintains it in QAWizard 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 QAWizard Pro datasheet are synced with the source and vice versa.

3. Click Next.

4. Select PostgreSQL database as theDatasheet type.

197

Page 222: QA Wizard Pro User Guide v2017 - Perforce

Creating PostgreSQL datasheets

5. Enter theServer host name or IP address.

6. Enter theDatabase name.

7. Enter the TCP/IP port used to communicate with the PostgreSQL server.

8. Select anAuthentication type.

n Use Windows authentication uses the username and password of the user logged in to thecomputer running QAWizard Pro to validate the PostgreSQL account name and password.

n Use PostgreSQL authentication uses the PostgreSQL username and password. Enter theUser andPassword.

9. Select aSource 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 mustreturn data from the source database to populate the datasheet. See Retrieving external data withdatabase queries, page 206.

198

Page 223: QA Wizard Pro User Guide v2017 - Perforce

Creating SQLite datasheets

n Script-generated query uses a function in a script to retrieve a subset of data during playback. Thisoption is only available if the datasheet links to an external data source. If this option is selected, youcannot view or edit the datasheet in QAWizard Pro or modify the data source using scripts. SeeRetrieving 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 theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet name.

12. Click Finish to add the datasheet to the workspace.

Creating SQLite datasheetsIf you have a large amount of existing test data in a SQLite database, you can create an external datasheet touse it in data-driven scripts. You can retrieve all data from a table, use a query to retrieve a subset of data, oruse a script-generated query to retrieve data during playback.

1. ChooseData > 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 andmaintains it in QAWizard 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 QAWizard Pro datasheet are synced with the source and vice versa.

3. Click Next.

4. Select SQLite database as theDatasheet type.

199

Page 224: QA Wizard Pro User Guide v2017 - Perforce

Creating text file datasheets

5. Enter the path to SQLite file or click Browse to select it.

6. Select aSource 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 mustreturn data from the source database to populate the datasheet. See Retrieving external data withdatabase queries, page 206.

n Script-generated query uses a function in a script to retrieve a subset of data during playback. Thisoption is only available if the datasheet links to an external data source. If this option is selected, youcannot view or edit the datasheet in QAWizard Pro or modify the data source using scripts. SeeRetrieving 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 theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet name.

9. Click Finish to add the datasheet to the workspace.

Creating text file datasheetsIf you have a large amount of existing test data in a text file, you can create an external datasheet to use it indata-driven scripts. Comma-delimited and fixed-width text files are supported.

1. ChooseData > Create Datasheet.

The Create Datasheet wizard opens.

2. Select an external data source option.

200

Page 225: QA Wizard Pro User Guide v2017 - Perforce

Creating text file datasheets

n Import data from external source imports data from the source andmaintains it in QAWizard 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 QAWizard Pro datasheet are synced with the source and vice versa.

3. Click Next.

4. Select Text file as theDatasheet 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, QAWizard Pro uses the values in the first row of the file to identify columns. Ifthis 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 fileduring playback. This option is only available if the datasheet links to an external data source. If thisoption is selected, you cannot view or edit the datasheet in QAWizard Pro or modify the data sourceusing 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: Youmay need to create a schema.ini file for the text file. If you are using a comma-delimitedfile with different data types in the same column, youmust create a schema.ini file to identify thedata types in the file. If you are using a fixed-width file, youmust always create a schema.ini file toidentify the file contents and columnwidth. This file must be saved in the same directory as thetext file. See Creating a schema.ini file for text files, page 202.

9. Specify the datasheet properties.

201

Page 226: QA Wizard Pro User Guide v2017 - Perforce

Creating text file datasheets

n If you are importing data, click Browse to select theDatasheet path to save the file in and enter aFile name. Datasheets are saved with a .qawsheet extension. You can also enter an optionalDescription for the datasheet.

n If you are linking to the external data source, enter aDatasheet 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 columnas 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 tocreate the schema file, whichmust 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 textfile.[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-delimitedtext 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 QAWizard Pro

202

Page 227: QA Wizard Pro User Guide v2017 - Perforce

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 signand decimal point

n INTEGER—Non-decimal numeric values (whole numbers); valid width values are32767 to -32766

n LONGCHAR—Text values; unspecified length returns 65500 KB width

n DATETIME—String that specifies date/time format

Width Columnwidth

CharacterSet Character set: ANSI or OEM

Associating datasheets with scriptsWhen a datasheet is associated with a script, the script runs once using the first datasheet row and thenrepeats for each additional row until it reaches the end of the datasheet.

Associate a datasheet with a script if:

n Youwant 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 thescript that called them.

If you want to perform advanced data-driven testing, youmay want to use datasheet statements instead ofassociating scripts with datasheets. Use datasheet statements if:

n You only want to run the script once and use one datasheet row per run.

n Youwant to run a small portion of the script once for each datasheet row.

n Youwant to append a row to the datasheet when the script runs.

n The script uses data frommore than one datasheet.

See Navigating datasheets, page 205.

1. Open the script you want to associate the datasheet with.

2. Select the datasheet from theData Source list in the Script pane.

Tip: You can also select a datasheet in script properties. SeeModifying script properties, page 163.

Using datasheet values in scriptsAfter you associate a datasheet with a script, you can edit the script to use data from the datasheet. When ascript runs, it uses the values from the first datasheet row and repeats the script until all rows are used.

203

Page 228: QA Wizard Pro User Guide v2017 - Perforce

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. ChooseScript > 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 theScript pane and select New Horizontal Tab Group orNew 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, youcan read and write values in database fields or delete database records. See Navigating datasheets, page205.

ExamplesIn this example, a script with an associated datasheet enters data in a web page form. The Cell statementretrieves data from the associated datasheet cell and assigns values to variables. The data is entered in thecorresponding form fields. The script continues to enter data based on the current datasheet row until all rowsare 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

Page 229: QA Wizard Pro User Guide v2017 - Perforce

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 adatasheet row. The Cell statement retrieves data from the associated datasheet cell and assigns a new valuefor the emailAddress variable. The data is entered in the corresponding form fields. The SetCell statement isalso 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 datasheetsYou 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 Youwant to run a small portion of the script once for each datasheet row.

n Youwant to append a row to the datasheet when the script runs.

n The script uses data frommore 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 OpenRecordsetstatement and datasheet to access.

TheOpenRecordset syntax is OpenRecordset("DatasheetName").

Note: If the datasheet uses a script-generated query to retrieve data during playback, add a variableequal to the OpenRecordsetQuery statement. SeeOpenRecordsetQuery, page 505.

3. Add variables for each datasheet column used in the script. Set each variable equal to the GetRowValuestatement.

TheGetRowValue syntax is GetRowValue (Recordset, "ColumnName").

4. Select the statement you want to assign data to.

5. ChooseScript > Edit Statement. The Edit Statement dialog box opens.

6. Select Expression.

7. Enter the variable that contains the datasheet column to use.

205

Page 230: QA Wizard Pro User Guide v2017 - Perforce

Retrieving external data with database queries

8. Click OK.

The datasheet reference is added to the statement.

ExampleIn the following example, database statements open a recordset named AccessDatabase and retrieve valuesfrom the First_Name, Last_Name, Company, Phone_Number, and Email_Address datasheet columns. TheSetRowValue 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 issubmitted, and the script navigates back to the form page.

The Do...Loop Until statement instructs the script to continue entering the corresponding datasheet values inthe 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 sampleworkspaces.

Retrieving external data with database queriesWhen creating external datasheets, you can add a query in the datasheet options to return a subset of datafrom aMicrosoft Access, Oracle, PostgreSQL, SQLite, or SQL Server database. Any query supported by thedatabase application can be used to import subsets of data to a datasheet or to update a datasheet linked toan 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 Retrievingexternal 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

Page 231: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleIn the following query, a subset of data is retrieved from aMicrosoft Access database. The SELECTstatement returns the First_Name, Last_Name, Email_Address, Company, and Phone_Number data. TheFROM statement specifies that the data should be returned from theWysiCorpData 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 queriesIf you usemultiple sets of data from one external data source, you can configure a single external datasheetand use a script-generated query to retrieve a recordset during playback instead of creatingmultiple externaldatasheets to retrievemultiple recordsets. This allows you to perform a dynamic query on a data sourceduring playback.

Script-generated queries can only be used for external datasheets linked to a data source. All data is stored inthe external source and you cannot view the data in QAWizard Pro.

You can use theOpenRecordsetQuery 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 sureyou select the Link to data in external source option in the datasheet options. See Configuring externaldatasheets, page 190.

2. Select Script-generated query in the datasheet information.

207

Page 232: QA Wizard Pro User Guide v2017 - Perforce

Editing local datasheets

3. Add theOpenRecordsetQuery statement to a script to specify the data to open from the external datasource during playback. SeeOpenRecordsetQuery, page 505.

ExampleIn the following script, the OpenRecordsetQuery statement uses the SELECT * FROM Email SQL query toretrieve all columns and rows from the Email table in the database linked to the Customers externaldatasheet. The recordset is assigned to themyRecordset variable. The RecordsetRowCount statementreturns the number of rows in the recordset and assigns the number to the count variable. The PrintLnstatement prints the number of rows stored in the count variable.myRecordset = OpenRecordsetQuery("Customers", "SELECT * FROM Email")

count = RecordsetRowCount(myRecordset)

PrintLn(count)

Editing local datasheetsYou can edit the column names and the description of local datasheets. You can also add columns to thedatasheet.

1. Select the datasheet and chooseData > Edit Datasheet.

The Edit Datasheet dialog box opens.

2. Make any changes.

Tip: Right-click and choose Insert Row orDelete Row to add or remove a column.

3. Click OK.

The datasheet is updated.

Modifying local datasheet propertiesYou can rename a local datasheet or view the location where it is saved.

1. Select the local datasheet in theWorkspace pane.

208

Page 233: QA Wizard Pro User Guide v2017 - Perforce

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. Youmust associate the renameddatasheet with scripts.

4. Click OK to save the changes.

Deleting local datasheets1. Select the local datasheet you want delete in theWorkspace pane.

2. ChooseEdit > Delete.

3. Optionally select Also delete the file from the disk to delete the datasheet from the workspace and thehard drive.

4. Click OK to delete the datasheet.

Modifying external datasheet propertiesYou can rename an external datasheet, change its data source, or select a different set of data.

1. Select the external datasheet in theWorkspace pane.

2. Choose File > Properties.

The Properties dialog box opens. The fields are different depending on the datasheet type.

209

Page 234: QA Wizard Pro User Guide v2017 - Perforce

Deleting external datasheets

3. Optionally enter a new Datasheet Name.

If you rename the datasheet, it is no longer associated with scripts. Youmust associate the renameddatasheet with scripts.

4. Make any changes to theDatasheet Options.

You cannot change the datasheet type.

5. Click OK to save the changes.

Deleting external datasheetsWhen you delete an external datasheet, it is only deleted from the workspace.

1. Select the datasheet you want to delete in theWorkspace pane.

2. ChooseEdit > Delete.

You are prompted to confirm the deletion.

3. Click Yes.

The datasheet is deleted.

210

Page 235: QA Wizard Pro User Guide v2017 - Perforce

Debugging ScriptsQAWizard 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 debugmode 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 thisvariable to prevent submitting Helix ALM issues when scripts run in debugmode.

n Change script and repository variable values in the Variables pane to troubleshoot steps without modifyingthe script.

Running scripts in debug modeRun scripts in debugmode to troubleshoot and fix script errors.

Keep the following inmind before debugging scripts:

n Make sure the Debug toolbar is open. ChooseView > 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 HelixALM project, comment them out so issues are not submitted while debugging. You can also use theINDEBUGMODE variable to prevent submitting issues when running scripts in debugmode. See Usingthe INDEBUGMODE variable, page 213.

n QAWizard Pro does not send results emails for scripts running in debugmode.

1. Open a script and then chooseDebug > Debug Script.

Note: If a script is set as themain script for the workspace, you can debug it without openingit. ChooseDebug > Debug Main Script. See Setting and running amain script, page 74.

The script stops running when an error occurs or the first breakpoint is reached. Breakpoints indicate thestep to stop playback on. See Using breakpoints, page 212.

2. Troubleshoot the script using the following debug commands.

Command Description

ToggleBreakpoint

Adds or removes a breakpoint.

Remove AllBreakpoints

Removes all 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

Page 236: QA Wizard Pro User Guide v2017 - Perforce

Using breakpoints

Command Description

Step Into Pauses playback and allows you to step through a called script, using the Stepcommand.

If the next step is a CallScript statement, QA Wizard Pro runs the entire called script. Ifthere is a breakpoint on a CallScript statement, QA Wizard Pro opens the called scriptand allows you to step through it.

Set NextStatement

Sets the next statement to run when playback continues. Use to run statements againor skip some statements while debugging. You can only set the next statement whenplayback is paused.

Stop Stops running the script in debugmode. Youmust stop running in debugmode beforeyou canmodify scripts.

Note: You can use the call stack to trace the functions called to the point when an error occurs or abreakpoint is reached. ChooseView > Call Stack to display the stack information.

Using breakpointsBreakpoints stop script playback at a specific step during debugging and allow you to step through the scriptso you can evaluate each step and fix the problem.

1. Run the script and determine where problems occur.

2. Select a script step and chooseDebug > Toggle Breakpoint.

A breakpoint, indicated by a red circle, is inserted. You can addmultiple 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 chooseDebug > Toggle Breakpoint.To remove all breakpoints, chooseDebug > Remove All Breakpoints.

Tip: You can also click the area left of the script line number to toggle a breakpoint.

212

Page 237: QA Wizard Pro User Guide v2017 - Perforce

Using the INDEBUGMODE variable

Using the INDEBUGMODE variableThe INDEBUGMODE Boolean variable determines if a script is running in debugmode. Use this variable withan If statement to skip a task if a script is in debugmode. In the following example, an issue is added to HelixALM if the value returned from the combobox items count is less than 5 and the script is not in debugmode.Script.SetContext("BugReporter/1.0")

Script.RunApp()

value = Window("BugReporter Dialog").ComboBox("combobox1").Property("Number ofItems")

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 variablesAs a script runs in debugmode, script and repository variables that are included in steps are displayed in theVariables pane. You can change the variable value during debugging without changing the script. This allowsyou 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 FunctionErrorNumber, or leave the value empty. The next step that uses the variable uses the Variables pane value insteadof the script value.

213

Page 238: QA Wizard Pro User Guide v2017 - Perforce
Page 239: QA Wizard Pro User Guide v2017 - Perforce

Using Repository VariablesRepository 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 tomake extensive script modifications or maintain a large number of scripts. For example, repository variablescan 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 inthe 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 ascript is recorded or run against the application version. Depending on the variable settings, users can beprompted to enter or select a different value for each recording or playback session. This value is used everytime the variable is referenced in the script. See Entering repository variable values during recording andplayback, page 221.

For example, a web application is hosted on a development server, test server, and production server. Youwant to record and run the same scripts against all three servers. You can create a repository variable thatcontains values for each server address. QAWizard Pro can prompt you to select the variable value thatcorresponds 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 variablevalues in scripts, which can be a text string, expression, or value from an associated datasheet. SeeAssignment, page 358.

Repository variables can also be used in expected values for application window and control properties. Forexample, a property for a web page changes based on the web site address. This property is used as searchcriteria during playback. Use a repository variable in the property's expected value soQAWizard Pro canlocate the window when the address changes. SeeModifying window and control properties, page 122.

Note: You can also use repository variables in URL format rules. See Creating URL format rules, page227.

Creating repository variablesRepository 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 theapplication conditions or inputs. Repository variables can be defined for each version in the applicationrepository 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 theRepository Variables tab.

3. Click Add.

A new row is added to the variables list.

215

Page 240: QA Wizard Pro User Guide v2017 - Perforce

Creating repository variables

4. Enter aVariable 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 aDescription.

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 theDefault 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 thevalues. The first list value is the default value used when recording and running scripts. See Addingrepository variable list values, page 218.

8. Select Replace to automatically replace all instances of the variable value with the variable name duringrecording.

The script and expected values for window and control properties are populated with the variable nameinstead of the variable value. Youmay want to select this option if you run scripts against different webservers so you do not have tomake extensivemodifications to scripts and the application repository.

For example, if you use the URLROOT variable, all instances of the variable value used during recordingare replaced with%URLROOT% in the script and application repository. When scripts run, the variable isreplaced 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 isnot unique, youmay 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 duringrecording and playback, page 221.

216

Page 241: QA Wizard Pro User Guide v2017 - Perforce

Editing repository variables

Note: If this option is selected, users are prompted to enter a variable value when the RunApp orConnectToProcess statements run. If the repository variable is set in the script before thesestatements, users are not prompted and the value set in the script is used.

10. Click OK.

The variables are saved.

Editing repository variablesYou 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 theRepository Variables tab.

3. Click a value andmake any changes.

4. Click OK to save the changes.

Deleting repository variablesYou 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 theRepository 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 valuesRepository variables can contain multiple list values that users can select from when they are prompted toenter a variable value.

1. Select a version in the application repository and choose File > Properties.

The Properties dialog box opens.

2. Click theRepository Variables tab.

217

Page 242: QA Wizard Pro User Guide v2017 - Perforce

Adding repository variable list values

3. Click the plus sign in the Default Value column.

TheManage List Values dialog box opens.

4. Click Add to add a value. See Adding repository variable list values, page 218.

5. Click a value tomodify 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 andMove 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 valuesYou can add list values to repository variables if you want to prompt users to select a value from a list duringrecording or playback. Users can also enter a value that is not included in the list. See Editing repositoryvariable list values, page 219.

Note: You can also enter list values in the Default Value column on the Repository Variables tab in theProperties 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

Page 243: QA Wizard Pro User Guide v2017 - Perforce

Editing repository variable list values

The Properties dialog box opens.

2. Click theRepository Variables tab.

3. Click in the Default Value column.

TheManage 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 valuesYou 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 andmake 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 Editingrepository variables, page 217.

Deleting repository variable list valuesYou 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 dialogbox.

TheManage List Values dialog box opens.

2. Select a value and click Delete.

219

Page 244: QA Wizard Pro User Guide v2017 - Perforce

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 Editingrepository variable list values, page 219.

About the URLROOT repository variableWhen you create a web application in QAWizard Pro, you can automatically create a URLROOT repositoryvariable to help with testing a web site hosted onmultiple servers. The variable value is the server addressthat hosts the web site you are testing. For example, if the URL for the new application iswww.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 windowand control properties. For example, you can add the variable before the RunApp statement to specify theaddress used to open the web site and replace other references to the variable throughout the script. SeeRunning 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 canmodify variable settings after you add the application. See Editing repository variables, page217.

Using repository variables in scriptsScript variables can only be used in the script they are created in. Repository variables can be used in allscripts recorded or run against an application. Repository variables are defined once and saved with a versionin the repository.

For example, a repository variable named loginID is defined for the application. To use the variable in a script,enter the variable namewhere 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 Enteringrepository variable values during recording and playback, page 221.

Keep the following inmind:

n If a script variable and repository variable have the same name, the script variable value overrides therepository variable value during playback.

n If a repository variable is declared explicitly before the RunApp or ConnectToProcess statement, usersare not prompted to select a variable value unless other repository variables require prompting.

220

Page 245: QA Wizard Pro User Guide v2017 - Perforce

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, youmust convert the values. For example, a variable named Time has a value of 30000. To use the variable inthe SetControlSearchTimeout statement, which requires an integer value, youmust use the followingInteger statement to convert the text value before the SetControlSearchTimeout statement is used:var=Integer(Time).

Entering repository variable values during recording andplaybackRepository 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 theQAWRunScript command to run scripts and batchfiles, youmust set the variable value in the QAWRunScript command or the script will fail. See Runningscripts from a command prompt, page 80.

n If a script variable and a repository variable have the same name, the script variable value overrides therepository variable value during playback.

1. If a repository variable is set to prompt, the Enter Variable Value dialog box opens when you record or runa 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 theValue column.

If you enter a new value, it is saved and used as the default value the next time you record or run scriptsagainst the application version.

3. Select Do not prompt again if you do not want the Enter Variable Values dialog box to open when yourecord 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

Page 246: QA Wizard Pro User Guide v2017 - Perforce
Page 247: QA Wizard Pro User Guide v2017 - Perforce

Testing Dynamic Web ApplicationsScripts that test dynamic web sites and applications may fail during playback because the application nolonger matches the data stored in QAWizard Pro. XPath queries and URL format rules can help you testdynamic content.

XPath queries find elements in HTML documents based on the unique path to the element within the hierarchyof all elements in the document. You can use XPath queries to specify the location of an HTML elementstored in the application repository, which allows QAWizard Pro to locate it during playback or performcheckpoints, 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 rulescan compare, ignore, or perform regular expression searches on parts of URLs, such as the domain andparameters. If you are testing a web application hosted onmultiple web servers, you can use URL formatrules to handlemultiple domain names. See Using URL format rules, page 227.

About XPath queriesXMLPath Language (XPath) can be used to find elements in HTML documents. Each element in a documenthas 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 QAWizard Promore accurately locatecontrols when running scripts against dynamic web sites.

Note: XPath language is defined by theW3C (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 searchmethod, 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 methodWhen new HTML controls in web applications are added to the application repository, the XPath searchmethod is selected in the control properties by default. This searchmethod uses an XPath query to search foran HTML control. Each control in the repository has a unique XPath, which is captured when the repository ispopulated. If the application changes, you canmodify the XPath query for a control to make sure it is located.During playback, the XPath query is performed andQAWizard Pro interacts with the first HTML element thatmatches 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. Duringplayback, QAWizard Pro can distinguish between the Buy buttons because each one has a unique XPathquery that specifies its exact location.

Keep the following inmind when using the XPath searchmethod:

223

Page 248: QA Wizard Pro User Guide v2017 - Perforce

Using the XPath search method

n Some controls require using the XPath searchmethod and themethod cannot be changed.

n If you upgradeQAWizard Pro, someHTML controls in the application repository may use the Standardsearchmethod. If these controls are not located during playback, you canmodify them to use the XPathsearchmethod. This helps improve playback accuracy by using the unique XPath for a control to specifyits exact location in the HTML document hierarchy instead of the control properties and expected valuescriteria used by the Standard searchmethod, whichmay 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 applicationrepository. 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 SearchMethod tab selected.

2. Select XPath as theSearch 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 IDattributes, 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 canmodify it if the application changes. For example, if a control on a web page has adynamic ID attribute that changes every time the web page refreshes, QAWizard Promay not findany control to perform the action on during playback. You can use a custom XPath that does notinclude 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 QAWizard 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+clickthem in the repository, right-click a selected control, and chooseSearch Method. See Changing thesearchmethod for multiple controls, page 128.

224

Page 249: QA Wizard Pro User Guide v2017 - Perforce

Using XPath queries in statements

Using XPath queries in statementsSomeHTML elements in web applications may not be stored in the application repository if actions cannot beperformed on them when recording, they are not recognized as controls, or they are dynamic. You can use anXPath query to identify these elements in statements soQAWizard Pro can interact with them when runningweb scripts. For example, use an XPath query in a checkpoint to verify that the image path for an SRCattribute on a web pagematches an expected value.

When adding XPath queries to statements, replace the control the action is performed on with theGetControlFromXPathQuery statement. You can also use the PerformXPathQuery statement to return anarray of results that matches a specific XPath query. SeeGetControlFromXPathQuery, page 425 andPerformXPathQuery, page 506.

Note: You can also use the XPath searchmethod to identify HTML controls stored in the applicationrepository if they are not located during playback. See Using the XPath searchmethod, page 223.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select the statement to add.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow that contains the element.

6. Select <XPath Query> as theControl.

7. Select theXPath 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), anexpression, a datasheet column value, a variable, or a function that returns the query.

Note: QAWizard Pro automatically adds the GetControlFromXPathQuery statement based on theselected search criteria. For example, the following statement uses an XPath query to locate andclick a button on theWysiCorp Homewindow:Window("WysiCorp Home").Button(Window("WysiCorp Home").GetControlFromXPathQuery("html[1]/body[1]/table[2]/tbody")).Click()

225

Page 250: QA Wizard Pro User Guide v2017 - Perforce

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 serversTo test a web application hosted onmultiple web servers, use repository variables and URL format rules tohandle 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 URLmost likely changes. To run scripts againstdifferent 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 valuesof http://dev.example.com and http://test.example.com to the URLROOT repository variable. After thevariable 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 andcontrols 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 runthe same script on a test server. The script fails on the because the application repository was populated withinformation associated with the development server, not the test server. You can create a URL format rulethat searches for only the specific part of the URL that does not change. If you create a URL format rule tosearch for the login.php file value, QAWizard Pro skips the server information in the URL and the script runscorrectly.

226

Page 251: QA Wizard Pro User Guide v2017 - Perforce

Using URL format rules

SeeCreating URL format rules, page 227.

Using URL format rulesIf you are testing a web application with dynamic URLs, youmay have tomodify the application repository soQAWizard Pro can locate controls during playback. If a control property, such as Href, URL, or Src, isselected as search criteria and the expected value contains a URL, QAWizard Pro cannot locate the controlwhen the URL changes because the expected and actual URLs are different. Dynamic URLs may also causeQAWizard Pro to add the sameweb page and controls to the application repository multiple times, whichmakes the repository unmanageable over time.

To handle this scenario, you can create URL format rules to compare, ignore, or perform regular expressionsearches on individual parts of URLs, such as the domain and parameters. For example, if a URL has asession ID parameter, you can create a URL format rule to ignore the parameter. During playback, QAWizardPro ignores the session ID parameter and searches for controls based on the rest of the URL. If you aretesting a web application hosted on different web servers, you can create a URL format rule that compares thedomain name in URLs tomultiple domain names specified in a regular expression. QAWizard Prosuccessfully locates a control if the domainmatches a value returned by the regular expression. See Runningweb scripts against different servers, page 226.

URL format rules can also be automatically applied to window and control properties captured when yourecord scripts or populate the repository. For example, if a URL format rule ignores the session ID parameterand formats are automatically applied during recording, URLs for control properties added to the repository donot 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 alsomodify control properties individually to specify URL format rules to apply during playback. SeeEditing URL format rules in control properties, page 230.

Creating URL format rulesIf you are testing a web application hosted on different web servers, you can create a URL format rule thatcompares the domain name in URLs tomultiple domain names specified in a regular expression. QAWizardPro successfully locates a control if the domainmatches a value returned by the regular expression. SeeRunning web scripts against different servers, page 226.

Use URL format rules to specify how to handle parts of dynamic URLs. This allows QAWizard Pro to locatecontrols when the URL changes. Format rules can always be applied to URLs or only be applied when URLsmeet 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, whichmay cause scripts to fail if controlproperties used as search criteria use this URL as the expected value. You can create URL format rules toignore specific parameters during playback.

Following are the parts of the URL you can create format rules for.

227

Page 252: QA Wizard Pro User Guide v2017 - Perforce

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 wysicrmnews2008

File File requested from the web server index.htm

Parameters Name/value pair appended to a URL that passes information from thebrowser to the web server; parameters start with a questionmark (?)and are separated by ampersands (&)

date=20081015lang=en

Anchor Named anchor, or bookmark, that identifies an internal section of aweb page; anchors start with a pound sign (#)

latest

1. Select a web application version in the application repository and choose File > Properties.

The Properties dialog box opens.

2. Click theURL Formats tab.

3. Click Add.

An empty row is added to the Rules list.

4. In the new row, select or enter aPart.

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 exceptProtocol, Domain, Path, File, or Anchor are interpreted as URL parameters.

5. Select anAction.

228

Page 253: QA Wizard Pro User Guide v2017 - Perforce

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. QAWizard Prosupports .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 theExpected Value.

QA Wizard Pro searches for the expected value in the URL and applies the rule if it is found. An expectedvalue 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 URLformat expected values. Repository variables are displayed on the Repository Variables tab in theversion Properties dialog box. See Creating repository variables, page 215.

7. Select aCondition 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 isadded 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, page229.

9. Optionally select Automatically apply formats during record to apply the rules during future recordingsessions.

If this option is selected, the action of every control property with a URL value in the application version isset to Matches format. The format rules are applied when controls are added to the repository afterrecording or populating.

10. Click OK to save the changes.

Applying URL format rulesIf URL format rules are defined for an application version, you can apply them to all existing windows andcontrols in the version in the application repository. Applying URL formats compares the format rules to allcontrol 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 theURL Formats tab.

3. Click Apply Formats.

The Repository Changes dialog box opens. Windows and controls with URL format changes aredisplayed. See Reviewing and saving repository changes, page 116.

229

Page 254: QA Wizard Pro User Guide v2017 - Perforce

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 rulesYou can edit URL format rules and apply changes to existing control property values in the applicationrepository.

Note: For information about editing format rules for individual control properties, see Editing URL formatrules in control properties, page 230.

1. Select a version in the application repository and choose File > Properties.

The Properties dialog box opens.

2. Click theURL Formats tab.

3. Click a value andmake any changes.

4. Optionally click Apply Formats to update URLs in existing control properties in the version in theapplication repository. See Applying URL format rules, page 229.

5. Click OK to save the changes.

Editing URL format rules in control propertiesIf you only need to change the URL format for a few controls in the repository, you canmodify each controlindividually.

230

Page 255: QA Wizard Pro User Guide v2017 - Perforce

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, tomatch a specified format during playback. URL format rules let you to specify how to handle parts of dynamicURLs, such as domain and parameters. This allows QAWizard Pro to locate controls during playback, evenwhen 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, QAWizard Pro ignores the session ID parameter and searches for controls based on therest of the URL.

Tip: You can also create and apply URL format rules to all window and control properties in the applicationrepository 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 SearchMethod tab selected.

2. In the row for the property with the URL in the expected value, selectMatches format as theAction usedto 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 QAWizard Pro searches for the expected value in the URL.

n Expected Value—ValueQAWizard 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, page126.

4. Select anAction to specify how QAWizard 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

Page 256: QA Wizard Pro User Guide v2017 - Perforce

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. QAWizard Prosupports .NET regular expressions.

n Exists verifies the expected value exists in the URL part. This action is only available for anchors andparameters.

n Ignore ignores the URL part. This action is only available for anchors and parameters.

5. Enter theExpected Value.

QA Wizard Pro searches for the expected value in the URL and applies the rule if it is found. An expectedvalue 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 URLformat expected values. Repository variables are displayed on the Repository Variables tab in theversion 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 rulesYou 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 theURL 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 aURL format rule, you need tomanually update the search criteria if you no longer want the URL tomatch aspecific format. In the window or control Properties dialog box, change theMatches format value in theAction column to another action. SeeModifying window and control properties, page 122.

232

Page 257: QA Wizard Pro User Guide v2017 - Perforce

Testing Nested ControlsQAWizard Pro can perform actions on controls that are nested in other controls. For example, youmay wantto test different items in a combo box on a toolbar. The best way to create scripts that test nested controls isto record them, but you can alsomanually add or modify statements. During recording, only containercontrols, which are the highest level control in the nesting hierarchy, are added to the application repository.

Supported nested controlsContainer 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 locatenested controls.

QA Wizard Pro recognizes the following control types as container controls:

n ComboBox

n Grid

n ListBox

n ListView

n Menu

n TabBar

n ToolBar

n Tree

Adding statements to test nested controlsYou 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 alsocreate checkpoints for nested controls. See Nested control object action examples, page 234.

1. Select the script line above where to add the statement.

2. ChooseScript > 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. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow that includes the nested control.

A screenshot of the selected window is displayed.

6. Select the container control as theControl.

The selected container control is outlined with a red box in the screenshot.

233

Page 258: QA Wizard Pro User Guide v2017 - Perforce

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. Youmust add each control in the hierarchy until youreach 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), anexpression, 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 examplesThe 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 theAdd Statement dialog box to add these statements and view the result statement in Keyword View.

Setting a check box in a combo boxIn this example, a check box is set in a combo box. The Set statement selects the Abby Adams check box inthe activeUsersComboBox combo box in theWysiCorp CRMwindow.

234

Page 259: QA Wizard Pro User Guide v2017 - Perforce

Nested control object action examples

Window("WysiCorp CRM").ComboBox("activeUsersComboBox").Item("Abby Adams").CheckBox().Set()

Setting a check box in a grid cellIn this example, a check box in a grid cell is selected. The Set statement selects the check box in the cell inthe first row of the Photo Column in the accountsDataGridView grid in theWysiCorp CRMwindow.Window("WysiCorp CRM").Grid("accountsDataGridView").Cell(1, "Photo").CheckBox().Set()

Setting a check box in a list boxIn this example, a check box item in a list box is selected. The Set statement checks the wysi_Develop itemin the only check box in the checkedListBoxProductInterest list box in theWysiCorp CRMContact window.Window("WysiCorp CRMContact").ListBox("checkedListBoxProductInterest").Item("wysi_Develop").CheckBox().Set()

Double-clicking an item in a list viewIn this example, an item is double-clicked using the text of its first two subitems. The ListView has multiplerows 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 ofSales.Window("WysiCorp CRM").ListView("listViewContacts").Item("Susan/Sales").DoubleClick()

Note: If the item text in the application includes slashes, youmust escape them in the statement with adouble backslash (\\), For example, if a row has a columnwith Item/Number in one column and ID in thesecond column, youmust add a double backslash in front of the slash in Item/Number tomake itItem\\/Number/ID. If a column includes the text Item\Number, the text in the statement needs to bechanged to Item\\\Number/ID.

Selecting a combo box item in a menuIn this example, an item is selected from a combo box nested in amenu. The Select statement selects theInactive item in the first combo box in the Account Typemenu.Window("WysiCorp CRM").Menu("menuBar").Item("Edit/Account Type").Menu().Item(1).ComboBox().Item("Inactive").Select()

Selecting a tab in a tab barIn this example, a tab is selected in a tab bar. The Select statement selects the Contacts tab in the tabControltab bar in theWysiCorp CRMwindow.Window("WysiCorp CRM").TabBar("tabControl").Tab("Contacts").Select()

Setting text in a combo box on a toolbarIn this example, text is entered in a combo box in a toolbar. The SetText statement enters the word Verdana inthe combo box with an index value of 2 in the formattingToolStrip toolbar in theWysiWrite window.Window("WysiWrite").ToolBar("formattingToolStrip").Item(2).ComboBox().SetText("Verdana")

Setting a check box in a treeIn this example, a check box in a tree is selected. The Set statement selects theWebClient item in the

235

Page 260: QA Wizard Pro User Guide v2017 - Perforce

Nested control object action examples

Software Development tree item in theWysiCorp CRMwindow.Window("WysiCorp CRM").Tree("treeViewProducts").Item("Software Development/WebClient").CheckBox().Set()

236

Page 261: QA Wizard Pro User Guide v2017 - Perforce

Testing HTML TablesDuring recording, HTML tables are added to the application repository as controls. If QA Wizard Prorecognizes controls in tables, they are also added to the repository. In some cases, youmay need to test atable element that is not in the repository, such as text in a cell, or search for a control during playbackbecause 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 anaction 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 incells. 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 controlcheckpoints. For example, verify text in a cell against an expected value. See Creating HTML tablecheckpoints, page 240.

n Determine if a table or control in a cell exists in the application during playback. For example, verify that anedit 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 CapturingHTML 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 columnindex values, page 244.

Adding statements to test HTML tablesQAWizard Pro can perform mouse action statements, such as Click andMouseMove, on HTML tables,cells, and controls in cells.

When you add a statement to an HTML table, you identify search criteria to help QAWizard Pro locate thecontrol to perform the action on it during playback. The search criteria is identified in the GetControlFromTablestatement, which is used in place of the control name in statements. See Using the GetControlFromTablestatement, page 243. QA Wizard Pro automatically adds the GetControlFromTable statement to mouseactions in the Add Statement dialog box, but you can also add it whenmodifying scripts in Text View.

Note: Youmay need to usemultiple GetControlFromTable statements to addmouse and keyboard actionstatements to nested HTML tables. See Testing nested HTML tables, page 245.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select a statement in theMouse Actions category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow that includes the table.

237

Page 262: QA Wizard Pro User Guide v2017 - Perforce

Adding statements to test HTML tables

A screenshot of the selected window is displayed.

6. Select the table as theControl.

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 theRow Index andColumn Index to search.

238

Page 263: QA Wizard Pro User Guide v2017 - Perforce

HTML table object action statement examples

You can use integers, script variables, or the ANYROW and ANYCOLUMN constant variables, whichsearch 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 GetRowFromColumnIndexstatements to find the row index or column index during playback. See Finding HTML table row andcolumn index values, page 244.

9. Select theControl Type to search for.

The HTMLElement control type can be used to search for table cells or other HTML elements, such as<div> tags, that are not recognized as controls.

10. Select aProperty, Action, andExpected Value to use to identify the control.

A control must be unique for QAWizard Pro to differentiate it from other controls in the table. Select atleast one property if the table includes more than one instance of the selected control type. SeeModifyingwindow 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 amore 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 examplesThe following examples show script steps that click a control in an HTML table cell that includes a singlecontrol or multiple controls.

Clicking a control in cells with a single controlIn this example, a control is clicked in a table cell that only includes one control. The Click statement clicksthe HTMLLink in the first row and second column of the Address table in the Data Entry window. TheGetControlFromTable 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 controlsIn this example, a control is clicked in a table cell that includes multiple controls. The Click statement in clicksthe button with a Text property value of Save in the second row and second column of the Address table in theData Entry window. TheGetControlFromTable statement is used to locate the button. The Text property andSave 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

Page 264: QA Wizard Pro User Guide v2017 - Perforce

Creating HTML table checkpoints

Creating HTML table checkpointsQAWizard 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 checkpointsverify that a table or control in a table exists. For example, you can verify that a button is included in a tablecell. 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-timecheckpoints, 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 thecontrol. QA Wizard Pro uses this criteria during playback to search the table for the control to check. Thesearch criteria is identified in the GetControlFromTable statement, which is used in place of the control namein checkpoints. See Using the GetControlFromTable statement, page 243. QAWizard Pro automatically addsthe GetControlFromTable statement to checkpoints in the Add Statement dialog box, but you can also add itwhenmodifying scripts in Text View.

Note: Youmay need to usemultiple GetControlFromTable statements to add checkpoints for nestedHTML tables. See Testing nested HTML tables, page 245.

1. Select the script line above where to add the statement.

2. ChooseScript > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint orCheck Exists in the Checkpoint category.

4. TheApplication/version field is automatically set with the context. This information is used to populatetheWindow and Control fields on the Add Statement dialog box with values from the applicationrepository. See Script.SetContext, page 534.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you addstatements to a utility script that is only called by other scripts because the context is set in the script thatcalls it. If an application/version is required, select it from the list.

5. Select theWindow that includes the table.

A screenshot of the selected window is displayed.

6. Select the table as theControl.

The selected table is outlined with a red box in the screenshot.

240

Page 265: QA Wizard Pro User Guide v2017 - Perforce

Creating HTML table checkpoints

7. Click Table Data to select the control search criteria.

The Child Control Search Criteria dialog box opens.

8. Enter theRow Index andColumn Index to search.

You can use integers, script variables, or the ANYROW and ANYCOLUMN constant variables, whichsearch all rows and columns in the table. The index of the first table row and column is 1.

241

Page 266: QA Wizard Pro User Guide v2017 - Perforce

HTML table checkpoint examples

Note: If the table is dynamic, use the GetColumnFromRowIndex or GetRowFromColumnIndexstatements to find the row index or column index during playback. See Finding HTML table row andcolumn index values, page 244.

9. Select theControl Type to search for.

The HTMLElement control type can be used to search for table cells or other HTML elements, such as<div> tags, that are not recognized as controls.

10. Select aProperty, Action, andExpected Value to use to identify the control.

A control must be unique for QAWizard Pro to differentiate it from other controls in the table. Select atleast one property if the table includes more than one instance of the selected control type. SeeModifyingwindow 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 amore 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 contextmenus, page 144.

14. If you are adding a control checkpoint, select theProperty to check from the list. You can use a textstring, constant, expression, datasheet column value, variable, or function that returns the value.

15. If you are adding a control checkpoint, enter or select theExpected Value to compare against the actualvalue. You can use a text string, expression, datasheet column value, variable, or function that returns thevalue.

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, displaysamessage in the Errors pane, and adds themessage to the run report. Generate a warning andcontinue playback continues running the script, displays amessage in the Errors pane, and adds themessage to the run report.

n Enter anWarning/failure message to display in the Errors pane and add to the run report when thecheckpoint fails. You can use a text string (default), expression, datasheet column value, variable, orfunction 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 examplesThe following examples show script steps that verify table properties, table cell properties, and properties ofcontrols in table cells against expected values.

Verifying table propertiesIn this example, a checkpoint verifies the properties of an HTML table. The Checkpoint statement verifies theAddress table in the DataEntry window includes two rows. If the table includes more or less than two rows,

242

Page 267: QA Wizard Pro User Guide v2017 - Perforce

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 ofrows is not 2")

Verifying table cell propertiesIn this example, a checkpoint verifies the properties of an HTML table cell. The Checkpoint statement verifiesthe Inner Text property value of the HTMLElement control in the first row and second column of the Addresstable in the Data Entry window matches the expected value of "Zip Code". TheGetControlFromTablestatement is used to locate the HTMLElement control. If the cell does not include the Zip Code text, thecheckpoint fails and playback stops.Window("Data Entry").HTMLElement(Window("Data Entry").HTMLTable("Address").GetControlFromTable("HTMLElement", 1, 2)).Checkpoint("Inner Text", "ZipCode", True, "")

Verifying properties of controls in table cellsIn this example, a checkpoint verifies the properties of a control in an HTML table cell. TheGetControlFromTable statement is used to locate the button in the second row and third column of theAddress table in the DataEntry window. The SubType property and BrowserPushButton value are used in thestatement to locate the correct button in the cell. The returned control is stored in the DETAILS_BUTTONvariable. 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, thecheckpoint 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 statementTheGetControlFromTable statement provides a way to parse an HTML table and find a specific control tointeract with. The statement searches a specific table cell for a control and returns the control. TheGetControlFromTable statement can be used instead of a control name in statements, which allows QAWizard 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,QAWizard 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 thesecond 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 controlproperties and expected values to uniquely identify the control you want to find. In the following example, thesame statement is used in addition to the Inner Text property and the Details property value. During playback,QAWizard 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 anerror is displayed the Errors pane.

243

Page 268: QA Wizard Pro User Guide v2017 - Perforce

Capturing HTML table control property values during playback

Note: Usemultiple GetControlFromTable statements to locate controls in nested tables. See Testingnested HTML tables, page 245.

Capturing HTML table control property values duringplaybackYou 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 atable, store the value in a variable, and use the variable in a For...Next statement to loop through script stepsfor each table row.

In the following example, QAWizard Pro returns the value of the Number of Rows property for the Addresstable 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 propertyvalue of a control in an HTML table cell. TheGetControlFromTable statement searches a specific table cell fora control and returns the control. It can be used instead of a control name in statements, which allows QAWizard Pro to dynamically locate the correct control during playback. You can also use the data retrievedusing the GetControlFromTable statement to control loops and conditional statements.

In the following example, the GetControlFromTable statement searches for an HTMLLink control in thesecond 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 controlproperties and expected values to uniquely identify the control you want to find. In the following example, thesame statement is used in addition to the Inner Text property and the Details property value. During playback,QAWizard 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 valuesIf you are testing dynamic HTML tables, youmay need to retrieve the row or column index from a table duringplayback to use in the GetControlFromTable statement. QA Wizard Pro includes the following statements forfinding 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 thecolumn 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 returnsthe row index of the cell. See FindRowByColumnIndex, page 416.Window("WindowName").Control("ControlName").FindRowByColumnIndex(SearchColIndex,"PropertyName", "ExpectedValue", ...)

244

Page 269: QA Wizard Pro User Guide v2017 - Perforce

Testing nested HTML tables

Note: If the control is not found, -1 is returned as the index value.

ExampleSuppose you are testing a web page that includes a table with hyperlinks to documents in a database. When adocument is added to the database, a new row with the document ID and hyperlink is added to the table. Youwant to click the hyperlink that corresponds to a specific document ID, which the script pulls from a localdatasheet. The hyperlink is always in the second column in the table, but you do not know the row indexbecause the table is dynamic.

In the following example, the document ID is stored in a variable named ID. The FindRowByColumnIndexstatement finds the row index of the cell in the List table in the Documents window that contains an Inner Textproperty value that matches the value of the ID variable. The row index is stored in a variable namedROWINDEX, which is used in the Click statement to indicate the row index of the cell that includes thehyperlink 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 tablesWhenQAWizard Pro performs aGetControlFromTable statement during playback, tables are searchedrecursively. Parent tables are searched first followed by any nested tables. In some rare cases, QAWizardPromay not locate a control in a nested table because the same control is located in the same cell in theparent 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 hasdifferent row and column indexes than the parent table, QA Wizard Pro can usually locate the correct controlin the nested table.

If a parent table cell and nested table cell both include a control with the same property, value, row index, andcolumn index, you need to use nested GetControlFromTable statements to locate the nested table and thenlocate 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 aText property value of Buy in the first row and fourth column of the nested table. The parent table includes abutton with the Text property of Buy, but it is in the second row and second column. In this case, you can usea 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 andfourth column, the button in the parent table is clicked becauseQAWizard Pro finds it before the button in thenested table. To locate the button in the nested table, you need to use nested GetControlFromTablestatements. For example:Window("Cart").Button(Window("Cart").HTMLTable(Window("Cart").HTMLTable("Items").GetControlFromTable("HTMLTable", 2, 2)).GetControlFromTable("Button", 1, 4,"Text", "Buy")).Click()

245

Page 270: QA Wizard Pro User Guide v2017 - Perforce

Nested HTML table examples

The inner GetControlFromTable statement searches for an HTMLTable control in the second row and secondcolumn of the Items table in the Cart window. This is the nested table. The outer GetControlFromTablestatement searches for a Button control with a Text property of Buy in the first row and fourth column of theHTML table located by the inner GetControlFromTable statement. The Click action is performed on thiscontrol.

Nested HTML table examplesThe following examples show how nested GetControlFromTable statements are used to perform actions onnested tables.

Clicking a control in a nested table cellIn 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 fourthcolumn 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 inthe third row and third column of the table returned by the inner GetControlFromTable statement. Thereturned 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 propertiesIn 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 thirdcolumn 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 thirdcolumn 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, whichis 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 valueIn this example, the column index for a cell is returned from a nested table based on a specific row andproperty value.

n TheGetControlFromTable statement searches for an HTMLTable control in the first row and fourth columnof 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 ofActivities in the fifth row of the table returned by the GetControlFromTable statement. This value is savedin the columnIndex variable.

246

Page 271: QA Wizard Pro User Guide v2017 - Perforce

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 valueIn this example, the row index for a cell is returned from a nested table based on a specific column andproperty value.

n TheGetControlFromTable statement searches for an HTMLTable control in the second row and secondcolumn 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 ofScores 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 cellsIn 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 fifthcolumn 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 ofBrowserPushButton in the first row and third column of the table returned by the innerGetControlFromTable 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

Page 272: QA Wizard Pro User Guide v2017 - Perforce
Page 273: QA Wizard Pro User Guide v2017 - Perforce

Running Scripts on Remote ComputersYou can distribute automated testing across remote computers to more quickly run through tests. Forexample, you can run a script on a computer in your QA lab to test it on an operating system that you do nothave installed locally.

Before you can run scripts remotely, youmust configure remote computers and start QAWRemote.exe. SeeConfiguring 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 Runningscripts remotely, page 250 and Runningmultiple scripts remotely, page 251.

Configuring remote computersBefore you can run scripts remotely, you need to configure the remote computer options.

Note: Each remote computer must haveQAWizard Pro installed, QAWRemote.exe running, and a validlicense.

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click theRemote Computers tab.

3. Click Add to add a remote computer.

n Enter aName. This can be the computer name or another descriptive name.

n Enter theHostname or IP Address.

n Enter thePort 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

Page 274: QA Wizard Pro User Guide v2017 - Perforce

Starting QAWRemote.exe

Note: Scripts use the playback options set on the remote computer, which youmay need to change.See Setting playback options, page 76.

Starting QAWRemote.exeQAWRemote.exe, which is used to run scripts remotely, must be started on the remote computer. SeeRunning scripts remotely, page 250.

1. Browse to the QAWizard Pro directory on the remote computer. Double-click qawremote.exe.

Running scripts remotelyYou can run scripts remotely to distribute automated tests across multiple computers andmore quickly runtests. For example, you can run a script on a computer in your QA lab to test it on a different operating systemversion.

Keep the following inmind before you run scripts remotely:

n A QAWizard Pro licensemust be available on each remote computer.

n Remote playback is only supported throughQAWRemote.exe, whichmust be started on the remotecomputer. 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 browsermust 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 namemust be a text string.

n If an OpenRecordset statement is used to access a local datasheet, the datasheet namemust be a textstring. Variables and other expressions are not supported.

1. Open the script to run remotely and chooseScript > Run Remote.

Note: If a script is set as themain script for the workspace, you can run it remotely without openingit. ChooseScript > Run Main Script Remote. See Setting and running amain script, page 74.

The RunRemote 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

Page 275: QA Wizard Pro User Guide v2017 - Perforce

Running multiple scripts remotely

3. SelectMonitor remote run to automatically start the status tool when remote scripts run. This lets youmonitor 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: Youmay 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 inC:\Users\<username>\Documents\My Documents\QA Wizard Reports.

Note: If you want to email the results and run report, youmust configure email notifications on theremote computer. See Setting email notification options, page 44.

Running multiple scripts remotelyYou can runmultiple scripts on remote computers. For example, run scripts onmultiple computerssimultaneously to perform tests while you work on other tasks.

Note: QAWizard Promust be installed andQAWRemote.exemust be running on the remote computer.To start QAWRemote, double-click the executable in the QAWizard Pro directory. The remote computermust also have access to the tested application in the global or local application repository.

1. ChooseScript > 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

Page 276: QA Wizard Pro User Guide v2017 - Perforce

Running multiple scripts remotely

The RunRemote 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: Youmay 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 inC:\Users\<username>\Documents\My Documents\QA Wizard Reports.

To email the results and run report, youmust configure email notifications on the remote computer. SeeSetting email notification options, page 44.

Tip: Use the dashboard or status tool to monitor remote script playback. See Viewing playbackinformation in the dashboard, page 90 and Viewing playback information in the status tool, page 99.

252

Page 277: QA Wizard Pro User Guide v2017 - Perforce

Managing the QA Wizard Pro ServerTheQAWizard Pro Server stores global application data and hosts the server database, which storeshistorical playback data, in a central location. The server is hosted on a computer that can be accessed over anetwork. See Installing the QAWizard Pro Server, page 253.

TheQAWizard Pro Server is required to:

n Use the global application repository to provide access to application data tomultiple users.

n Use the dashboard tomonitor 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 DataWarehouse 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 onthe server computer. QA Wizard Pro communicates directly with the server through TCP/IP, and the servermanages the global repository files and server database.

Server administration

You can use theQAWizard Pro Server Admin Utility to perform the following tasks.

n Change the global repository directory and port number

n Enable ALM DataWarehouse 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 ServerTheQAWizard Pro Server applicationmust be installed on a networkedWindows computer. It does notrequire a QAWizard Pro license or QAWizard Pro to be installed on the server computer.

To install the server application and admin utility, run the QAWizard Pro installer and select theQA WizardPro Server option.

TheQAWServer directory is created in the root directory of the server computer the first time the server starts.For example, if you install the QAWizard Pro Server in the C:\Program Files (x86)\Perforce\QA Wizard Prodirectory, the server directory is C:\QAWServer. The server directory stores global application data and theserver database. A SQLite server database (QAWServer.db) is automatically created in this directory. Youcan use this database to store playback data or use aMicrosoft SQL Server, Oracle, or PostgreSQLdatabase. See Configuring the server database, page 255.

If you upgradedQAWizard Pro, a backup copy of the global repository is created in the server directory andnamedwith the highest version number (for example, repositoryV3). If you upgraded from QAWizard Pro2011.0 or earlier, the default server directory is namedQAWRepository.

Note: Users must configure a connection to the server before they can access it. See Setting serverconnection options, page 43.

253

Page 278: QA Wizard Pro User Guide v2017 - Perforce

Starting the QA Wizard Pro Server

Starting the QA Wizard Pro ServerTheQAWizard Pro Server application (QAWServer.exe) runs as aWindows service and starts automaticallywhen the server computer starts.

If the server does not start, you canmanually start it. Refer to theWindows documentation for informationabout starting a service.

Starting the QA Wizard Pro Server Admin UtilityChooseStart > Programs > Perforce > QA Wizard Pro > QA Wizard Pro Server Admin.

Configuring general server optionsYou can change the directory where global application data is stored on the server computer and the port QAWizard Pro clients use to connect to the server if the default port is already in use.

You can also enable Helix ALM DataWarehouse integration. ALM DataWarehouse communicates with theHelix ALM License Server to retrieve data from theQAWizard Pro server database and imports the data tothe data warehouse. The data can be used for creating reports using third-party reporting tools, such asSQL Server Reporting Services (SSRS) andOracle Reports. See the Helix ALM DataWarehouse help forinformation.

1. Start the QAWizard Pro Server Admin Utility.

2. Click Server Options.

The Server Options dialog box opens.

3. Click theGeneral tab.

4. Enter the TCP/IP port number for QAWizard Pro clients to use to connect to the global repository. Thedefault port is 8002.

254

Page 279: QA Wizard Pro User Guide v2017 - Perforce

Configuring the server database

5. Enter theRepository directory to store global repository data in or click Browse to select a location. Thedefault repository directory is the QAWServer directory at the root of the server computer (e.g.,C:\QAWServer).

Note: If you upgraded from QAWizard Pro 2011.0 or earlier, global application data is in theQAWRepository directory.

6. Select Enable ALM Data Warehouse integration to import QA Wizard Pro data to the data warehousefor reporting purposes. Enter theHelix ALM License Server address, port, and communicationspassword. Leave the communications password empty if the license server does not require it.

7. Click Save to save the changes.

Youmust restart the QAWizard Pro Server for the changes to take effect. See Starting the QAWizardPro Server, page 254.

Configuring the server databaseTheQAWizard Pro Server stores playback data in a Relational DatabaseManagement System (RDBMS).SQLite is the default RDBMS and does not require any setup or configuration before or after installation. Theserver database is created automatically when the server starts, but you can change the database location.

You can also use aMicrosoft SQL Server, Oracle, or PostgreSQL database for the server database, but youmust create an empty database before configuring it in QAWizard Pro. See Setting UpRDBMS Databases,page 317.

Note: If you change the server database, data in the current server database is not copied to the newdatabase. You should not need to change the database location frequently.

1. Start the QAWizard Pro Server Admin Utility.

2. Click Server Options.

The Server Options dialog box opens.

3. Click theDatabase tab.

4. Select the database Type.

5. Enter the databaseOptions. The available options depend on the selected database type.

255

Page 280: QA Wizard Pro User Guide v2017 - Perforce

Removing playback data

Databasetype

Options

SQLite By default, theDatabase file path is set to the QAWServer.db database file that isautomatically created in the C:\QAWServer directory. If youmoved the database file toa different directory, click Browse to select the database location. You can also selecta different directory to automatically create a new database file in when the serverrestarts.

MicrosoftSQL Server

Enter theServer address, Server port, andDatabase name for the database youcreated. Select an authenticationmethod to use to connect to the database. UseWindows Authentication uses the username and password of the logged in user onthe server computer. Use SQL Server Authentication uses the provided SQL ServerUser andPassword.

The database configurationmay affect playback data removals. See IncorrectPlayback Sessions May BeRemoved from QAWizard Pro SQL Server Databases.

Oracle Enter theServer address, Server port, and Service name for the database youcreated and theOracleUser andPassword to connect to it.

PostgreSQL Enter theServer address, Server port, andDatabase name for the database youcreated. Select an authenticationmethod to use to connect to the database. UseWindows Authentication uses the username and password of the logged in user onthe server computer. Use PostgreSQL Server Authentication uses the providedPostgreSQL User andPassword.

6. Click Save to save the changes.

Youmust restart the QAWizard Pro Server for the changes to take effect. See Starting the QAWizardPro Server, page 254.

Removing playback dataYou can remove unneeded historical playback data captured from QAWizard Pro applications that sendinformation to the server. This helps remove outdated and unimportant information from theQAWizard Prodashboard and status tool and frees up space in the server database. For example, you can remove inactiveand canceled playback sessions tomake 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 alsomanually remove data.

n To schedule data removal or manage scheduled removals, click Data Removal Schedule. SeeScheduling playback data removal, page 257.

n Tomanually remove data, click Data Removal. SeeManually removing playback data, page 261.

Tip: You can set a password to prevent unauthorized data removal. See Changing the playback dataremoval password, page 262.

256

Page 281: QA Wizard Pro User Guide v2017 - Perforce

Scheduling playback data removal

Scheduling playback data removalYou can schedule automatic removal of unneeded playback data at a set time or on a regular basis.Scheduling removals can help reducemanual effort to remove unimportant information from the dashboardand status tool, and free up space in the server database.

You can alsomanually remove playback data. SeeManually removing playback data, page 261.

Note: If the server database is hosted in SQL Server, the database configurationmay cause importantplayback data to be unintentionally removed. Review Incorrect Playback Sessions May BeRemovedfrom QAWizard Pro SQL Server Databases before removing data.

1. Start the QAWizard 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 Editingscheduled playback data removal filters, page 259.

5. Select a scheduled removal and click Edit Schedule to change the schedule for removing data. SeeEditing playback data removal schedules, page 260.

6. Select a scheduled removal and click Delete to delete it. See Deleting scheduled playback dataremovals, page 260.

7. Click Closewhen you finish.

Adding scheduled playback data removalsYou can schedule automatic removal of unneeded playback data from theQAWizard Pro Server at a set timeor on a regular basis. For example, you can schedule to remove all canceled playback sessions at the end ofeach 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 thedashboard or status tool.

Note: If the server database is hosted in SQL Server, the database configurationmay cause importantplayback data to be unintentionally removed. Review Incorrect Playback Sessions May BeRemovedfrom QAWizard Pro SQL Server Databases before removing data.

1. Start the QAWizard Pro Server Admin Utility.

257

Page 282: QA Wizard Pro User Guide v2017 - Perforce

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: Youmay be prompted to enter the data removal password first.

4. Select any options to specify thePlayback Sessions to Remove.

Option Removes:

Date Sessions run during the selected date range.

n More than includes sessions runmore 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 includessessions 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 30minutes, orsessions canceled by the user who started them.

258

Page 283: QA Wizard Pro User Guide v2017 - Perforce

Editing scheduled playback data removal filters

Option Removes:

Testcomputers

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

Sessionname

Sessions by name. You can include sessions with names that equal, start with, end with,contain, do not equal, or do not contain specific text. Select Ignore case to ignore thecase 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 scheduleOptions. 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 timemust be at least 5minutes 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 themonth for monthly removals.

8. Click OK.

The removal is scheduled. The date and time for the next removal is displayed in the DataRemoval Schedule dialog box.

Editing scheduled playback data removal filtersYou 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, page260.

1. Start the QAWizard Pro Server Admin Utility.

2. Click Data Removal Schedule.

The Data Removal Schedule dialog box opens.

259

Page 284: QA Wizard Pro User Guide v2017 - Perforce

Editing playback data removal schedules

3. Select a scheduled removal and click Edit Filter.

The Edit Scheduled Data Removal Filter dialog box opens.

Note: Youmay be prompted to enter the data removal password first.

4. Make any changes. For information about options, see Adding scheduled playback data removals, page257.

5. Click OK to save the changes.

Editing playback data removal schedulesYou 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 QAWizard 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: Youmay be prompted to enter the data removal password first.

4. Make any changes. For information about options, see Adding scheduled playback data removals, page257.

5. Click OK to save the changes.

Deleting scheduled playback data removalsYou 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 removalschedules, page 260.

1. Start the QAWizard Pro Server Admin Utility.

2. Click Data Removal Schedule.

The Data Removal Schedule dialog box opens.

Note: Youmay 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

Page 285: QA Wizard Pro User Guide v2017 - Perforce

Manually removing playback data

Manually removing playback dataYou canmanually remove playback data that is no longer needed. Removed playback data is permanentlydeleted 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 playbackdata removal, page 257.

Note: If the server database is hosted in SQL Server, the database configurationmay cause importantplayback data to be unintentionally removed. Review Incorrect Playback Sessions May BeRemovedfrom QAWizard Pro SQL Server Databases before removing data.

1. Start the QAWizard Pro Server Admin Utility.

2. Click Data Removal.

The Data Removal dialog box opens.

Note: Youmay be prompted to enter the data removal password first.

3. Select any options to specify thePlayback Sessions to Remove.

261

Page 286: QA Wizard Pro User Guide v2017 - Perforce

Changing the playback data removal password

Option Removes:

Date Sessions run during the selected date range.

n More than includes sessions runmore 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 includessessions 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 30minutes, orsessions canceled by the user who started them.

Testcomputers

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

Sessionname

Sessions by name. You can include sessions with names that equal, start with, end with,contain, do not equal, or do not contain specific text. Select Ignore case to ignore thecase 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 passwordYou can set or change the password required to remove playback data from theQAWizard Pro Serverdatabase, which helps prevent unauthorized removals.

1. Start the QAWizard 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 ServerTheQAWizard Pro Server database and global application repositories should be backed up regularly.

262

Page 287: QA Wizard Pro User Guide v2017 - Perforce

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 thecomputer the QAWizard 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 QAWizard Pro 2011.0 or earlier, the default server directory isC:\QAWRepository.

To back up the database:

1. Stop the QAWizard Pro Server.

2. Copy theQAWServer.db file to a backup directory.

3. Restart the QAWizard Pro Server.

Microsoft SQL Server, Oracle, or PostgreSQL

If the server database is stored inMicrosoft SQL Server, Oracle, or PostgreSQL, ask your DBA for help withbackups.

Global application repositories

To back up applications in global repositories, export them and save the copy in a backup directory. SeeExporting applications, page 49.

263

Page 288: QA Wizard Pro User Guide v2017 - Perforce
Page 289: QA Wizard Pro User Guide v2017 - Perforce

Integrating with Helix ALMQAWizard Pro integrates with Helix ALM, which lets you create scripts from test case steps, run tests, addissues found during testing, and perform other testing-related tasks from QAWizard Pro. Using the integrationcan help reduce information loss that can occur between completing testing and reporting problems, and savetime by eliminating the need to switch between applications.

Note: TestTrack was renamedHelix ALM starting with the 2017.1 release.

To work with Helix ALM items in QAWizard 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 integrationTowork with Helix ALM issues, test cases, test runs, or workbook tasks, enable the integration for theworkspace 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

Page 290: QA Wizard Pro User Guide v2017 - Perforce

Configuring the Helix ALM integration

4. Select theServer to connect to. See the Helix ALM help if you need to add a server.

5. Enter yourUsername andPassword.

If available, you can select Use single sign-on to log in with your network credentials orUse externalauthentication to log in with your authentication system credentials. Ask your Helix ALM administratorfor help.

6. Select Always log in with this username and password to automatically log in using the credentialsyou entered every time you access the project from QAWizard Pro.

7. Click Connect.

The Helix ALM Project Selection dialog box opens.

8. Select theProject 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 QAWizard Pro. Allareas you have access to are selected by default. If your team uses floating licenses, youmay want toreconfigure the connection before performing Helix ALM actions to only log in to the areas you will use forthe current session.

10. Click OK.

266

Page 291: QA Wizard Pro User Guide v2017 - Perforce

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 windowsYou can view basic information and add, edit, view, and delete items from Helix ALM list windows. Listwindows are displayed in the Issues, Test Cases, Test Runs, andWorkbook panes. You can customize listwindows to find the information you need to work with and perform other actions, such as add events to moveitems through the workflow and duplicate items.

Tip: Use the Helix ALM toolbar to quickly add items and open list windows. To view the toolbar, chooseView > Toolbars > Helix ALM.

Opening list windowsTo open a list window, select the item type to work with in the View menu. For example, to open the Issueslist window, chooseView > Issues. You can also choose Tools > Helix ALM and then select the listwindow.

Navigating list windowsFollowing are the key components in list windows. Some of these are only available in the Issues, TestCases, and Test Runs list windows.

# Area Use to:

Tabs Switch betweenmultiple instances of lists that display different information. Click a tabto display it. You can also rename tabs, add tabs, and remove tabs you no longer use.

Actionbuttons

Add a new item to the project, or view, edit, or delete a selected item.

Items n Open an item: Double-click the item.

n Perform an action on an item: Select the item and click the corresponding actionbutton in the list window, or right-click the item and select an action from theshortcut menu.

Indicators Quickly identify new, changed, closed, and your assigned items. Mouse over anindicator to view a description.

267

Page 292: QA Wizard Pro User Guide v2017 - Perforce

Working with Helix ALM test cases and test runs

# Area Use to:

Sortarrows

Sort items based on column values. Click a column heading to sort items based on thecolumn values. An up arrow indicates ascending order and a down arrow indicatesdescending order. You can alsoShift+click another column heading to sort on asecondary value.

Columnfilter

Filter lists based on values in columns. When you select a filter value, the list is updatedto display only items that contain the selected value.

Inlineeditingbutton

Edit item fields inline in list windows without opening the item to edit them.

Filter list Apply filters to narrow the list to only items that meet specific criteria.

Finding items in listsTo find items in lists, you can:

n Select a Filter to display specific items. Only items that match the filter criteria are displayed. Select NotFiltered to display all items.

n Use type ahead searching. Matching text is highlighted in the list window as you type.

Performing actions on itemsn 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 runsIf Helix ALM integration is enabled for the workspace, you can work with test cases and test runs from QAWizard Pro. This makes it easy tomake sure information in scripts and test cases matches, and saves timeby 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 tomake 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

Page 293: QA Wizard Pro User Guide v2017 - Perforce

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: Youmust be logged in to the test casemanagement area to access test cases and test runs. SeeConfiguring the Helix ALM integration, page 265.

Adding Helix ALM test casesYou can add a test case to Helix ALM from QAWizard Pro to capture test details, such as the conditions,steps, expected results, and other criteria used to determine if a product component works correctly andmeets the specified requirements.

You can also record test case steps instead of entering themmanually. See Recording Helix ALM test casesteps, page 270.

Tip: If you need to add a test case with the same basic information as another one, save time byduplicating the existing test case and then editing the new one. See Duplicating Helix ALM items, page282.

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 theinformation your team requires.

269

Page 294: QA Wizard Pro User Guide v2017 - Perforce

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 mustbemet 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 iscreated 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 stepsIf you need to add a new Helix ALM test case, you can record the test steps instead of manually enteringthem. This helps save time when documenting longer tests and reduces the possibility of incorrect orincomplete test cases.

When recording test case steps, you interact with applications the same as when recording QAWizard Proscripts. 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 QAWizardPro.

1. Choose Tools > Helix ALM > Record New Test Case. You can also click Record in the Test Caseslist window.

The Record New Test Case dialog box opens.

270

Page 295: QA Wizard Pro User Guide v2017 - Perforce

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 aWindows application running on the testcomputer.

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 theCheckpointRecording toolbar button to add checkpoints to the script during recording. SeeCreating 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 recordingmode. Low-level actionstatements perform mouse actions that QAWizard 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 theCommentRecording toolbar button to add a comment to the script. Comment statementsare not run during playback.

5. Click theStopRecording toolbar button.

The Add Test Case dialog box opens and the recorded steps are displayed. A screenshot is attached toeach step.

271

Page 296: QA Wizard Pro User Guide v2017 - Perforce

Creating scripts from Helix ALM test cases

6. Enter the test caseSummary, Type, expected results, and any additional information. You canmodifythe 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 casesIf youmanage test cases in Helix ALM, you can create QAWizard Pro scripts from steps in test cases. Thishelps ensure each test case step is represented with a statement in a script and automatically adds a link tothe test case in the script.

Use one of the followingmethods 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 expectedresults 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 ishelpful if you want to perform other tasks before recording, such as cleaning up script lines or populatingthe application repository.

Note: Helix ALM (or TestTrack 2012.0 - 2016.1) must be installed on the computer running QAWizardPro.

1. Click theSteps 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

Page 297: QA Wizard Pro User Guide v2017 - Perforce

Creating scripts from Helix ALM test cases

3. Enter aScript name. The default name is Automated Test Case appended with the test case number.

4. Select a script creationmethod.

n Create script from test case steps creates a basic script with test case steps and expected resultswithout 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, page47.

Select Connect to running application to record against aWindows application running on the testcomputer.

6. If you are recording a web script, select aBrowser.

7. Click Record.

The application starts. The Recording Automated Test Case toolbar opens and displays the test casesteps 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 aftereach step, all recorded actions are added to the end of the script.

273

Page 298: QA Wizard Pro User Guide v2017 - Perforce

Viewing Helix ALM test cases

n Click theCheckpointRecording toolbar button to add checkpoints to the script during recording. SeeCreating 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 recordingmode. Low-level actionstatements perform mouse actions that QAWizard 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 theCommentRecording toolbar button to add a comment to the script. Comment statementsare 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. SeeTestCaseStep, page 559.

Note: You canmodify the script or record additional steps before running the script. SeeModifyingScripts, page 145 or Recording additional script steps, page 69.

Viewing Helix ALM test casesYou can view read-only Helix ALM test case information without preventing other users from editing a testcase at the same time.

1. Select the test case in the Test Cases list window and click View.

274

Page 299: QA Wizard Pro User Guide v2017 - Perforce

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 theOverview tab. View additionalinformation 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 casesEdit a Helix ALM test case to change the information, such as the steps to perform. When you edit a testcase, related test runs are not updated to reflect the change. Youmust generate new test runs or regeneratetest runs in Helix ALM to use the updated test case. See the Helix ALM help for information about generatingor regenerating test runs.

You can also delete test cases if they are not needed. Related test runs can also be deleted when you delete atest 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, youmay be able to add a workflow event to close it. SeeMoving Helix ALM items through the workflow, page281.

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 ALMtest 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 hasrelated test runs, click Yes, delete all to delete the test case and test runs orNo, only delete testcases to only delete the test case.

Running Helix ALM testsRunning 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 beincluded in the details and scripts or other test files required to perform the test may be attached. SeeViewing 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 enterresults (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 problemstatements and attach run reports to document the issues. See the Helix ALM help for information aboutentering test results in grid view, detail grid view, and text view.

275

Page 300: QA Wizard Pro User Guide v2017 - Perforce

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. SeeMoving Helix ALMitems through the workflow, page 281.

If you find issues during the test, click Create Issue to report them. See Adding Helix ALM issues, page277.

Viewing Helix ALM test runsYou can view read-only Helix ALM test run information without preventing other users from editing the test runat 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 theOverview tab. View additionalinformation 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 runsEdit a Helix ALM test run to enter test results or change the information. You can also delete test runs if theyare not needed.

Note: If you want to keep a record of a test run, but it does not need to be performed again, youmay beable to add a workflow event to ignore it. SeeMoving 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 forinformation.

n To delete a test run, select it and click Delete. Click Yes to confirm the deletion.

Working with Helix ALM issuesIf Helix ALM integration is enabled for the workspace, you can work with issues in QAWizard Pro. Thismakes it easy to thoroughly report problems encountered during testing and saves time by eliminating theneed 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

Page 301: QA Wizard Pro User Guide v2017 - Perforce

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: Youmust be logged in to the issuemanagement area to access issues. See Configuring the HelixALM integration, page 265.

Adding Helix ALM issuesYou can add an issue to Helix ALM from QAWizard 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 duplicatingthe 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 informationyour team requires.

277

Page 302: QA Wizard Pro User Guide v2017 - Perforce

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 bydefault, but you can choose another user.

3. On theDetail tab, enter any additional information on the correspondingmini tab.

Tab Name Use to:

Found by details Enter information about the user who found the issue and a detaileddescription.

Steps to reproduce Enter the steps to reproduce the issue.

Computerconfiguration

Enter the hardware and software configuration for the computer the issuewas 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 reportsYou 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 chooseCreate 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

Page 303: QA Wizard Pro User Guide v2017 - Perforce

Adding Helix ALM issues from scripts

Adding Helix ALM issues from scriptsYou can add Helix ALM issues using statements in scripts to automatically report errors found duringplayback. 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 relatedto the issue.

If you want to: Then:

Create an issue with information only in the Summary, Description, Stepsto Reproduce, andOther Hardware and Software fields

Use the AddIssuestatement

Create an issue with information in other fields, add file attachments to the issue, orget information from the issue before adding it to the project

Use advancedissue statements

Using the AddIssue statement

Use the AddIssue statement to add an issue with information only in the Summary, Description, Stepsto Reproduce, andOther Hardware and Software fields during playback. See AddIssue, page 353.

To add information in other issue fields, youmust either manually edit the issue after it is added to Helix ALMor use advanced issue statements.

ExampleIn the following example, an issue is created, the Summary, Description, Steps to Reproduce, andOtherHardware and Software field values are set, and the issue is added to the Helix ALM project to report an errorwith the number of items available in the comboboxProduct control.numProducts = Window("BugReporter").ComboBox("comboboxProduct").Property("Number ofItems")

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, attachfiles 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 AddFileAttachmentstatement 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

Page 304: QA Wizard Pro User Guide v2017 - Perforce

Viewing Helix ALM issues

ExampleIn the following example, a new issue object is created to report an error with the text displayed in theresultsDlg control. The issue Summary, Description, Product, Severity, andWindows Version fields are setbefore 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 theresults 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 issuesYou can view read-only Helix ALM issue information without preventing other users from editing an issue atthe 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 theOverview tab. View additionalinformation on the other tabs. See the Helix ALM help for information.

280

Page 305: QA Wizard Pro User Guide v2017 - Perforce

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 issuesEdit a Helix ALM issue to provide additional or updated information. You can also delete issues if they are notneeded.

Note: If you want to keep a record of the issue but it does not need to be fixed, youmay be able to add aworkflow event to close it. SeeMoving 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 ALMissues, 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 workflowHelix ALM workflows define the path that issues, test cases, and test runs take from the time they are createduntil they are completed and closed. As you work on items, add workflow events to move them through theirlifecycle and describe the work you completed, work that another teammember needs to complete, oradditional information about the item.

For example, you can enter an Assign event to assign an item to another user who is responsible for workingon it. When work is complete, the assigned user adds the appropriate event to record their work and the itemmoves 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 usemay be different depending on your team's workflow, but the steps toadd events are similar.

1. Right-click an item in a list window and choose an event. For example, choose Assign to assign an issueto 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

Page 306: QA Wizard Pro User Guide v2017 - Perforce

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 helpusers 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 itemsIf you need to add a Helix ALM issue, test case, test run, or workbook task with the same basic information asanother 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 theWorkbook list window, but you can only modify the duplicated items in Helix ALM. See the Helix ALMhelp for information about duplicating requirements and requirement documents.

1. Right-click the item to duplicate in a Helix ALM list window and chooseDuplicate.

If you are duplicating a workbook task, the task is duplicated and added to the workbook. Continue withstep 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 aDefinition to specify the relationship between the items. The list includes all link definitionsin the Helix ALM project for the selected item type. Click View Definition to view information aboutthe definition.

n Enter aComment to display on the item Links tab and the link diagram.

282

Page 307: QA Wizard Pro User Guide v2017 - Perforce

Using the Helix ALM workbook

n If you select a parent/child definition, selectMake original item the parent to make the original itemthe 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 theWorkflow tab on thenew 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 theDescription 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 theoriginal item is displayed on the corresponding tab in the new item. Folder information copies the new itemto 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 workbookUse the Helix ALM workbook to organize your assigned items and track other project-related tasks. Forexample, you can add a task to remind you to install the latest build before running tests. Workbook tasks areprivate and not shared with other users.

You can perform the following tasks in theWorkbook 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 tasksYou can add project-related tasks to the Helix ALM workbook. For example, you can add a task to remind youto 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 duplicatingthe 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 theWorkbook list window.

The Add Task dialog box opens.

283

Page 308: QA Wizard Pro User Guide v2017 - Perforce

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 aNeed by date or enter aNeed by version.

6. Enter aDescription.

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 ALMworkbook tasks, page 284.

Viewing Helix ALM workbook tasksYou can view Helix ALM workbook tasks to see detailed information you entered, such as the description orneed by date.

You can also view Helix ALM items assigned to you.

1. Select the task in theWorkbook 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 tasksEdit 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.

Youmay also be able to edit Helix ALM items assigned to you.

1. Select the task in theWorkbook 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 ALMworkbook tasks, page 283 for information.

n To delete a task, select it and click Delete. Click Yes to confirm the deletion.

284

Page 309: QA Wizard Pro User Guide v2017 - Perforce

Integrating with Source Control ToolsQAWizard Pro integrates with Surround SCM andMicrosoft Source Code Control Interface (SCCI) compliantapplications to provide complete script management and facilitate team communication. After adding scriptsand other files to source control, you can perform most source control tasks directly from QAWizard Pro,easily share changes, andmaintain 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 datawith the application code and design documents, while other organizations maintain test data separatelyfrom development files.

n Themost recent file versions are always available, ensuring that tests are performed using the correctfiles.

n The source control application tracks who, when, and what changed for every revision of QAWizard Profiles. You can easily revert back to previous file version, if needed.

n Testers can perform source control tasks directly from QAWizard Pro without opening the source controlapplication.

Note: The following examples use Surround SCM. Youmay follow different steps depending on thesource control application you are using.

Configuring source control integrationBefore you can work with files under source control files in QAWizard Pro, you need to associate theworkspace 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 useSurround 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 aSource control provider.

3. If the workspace was already added to Surround SCM, QAWizard Pro automatically associates it withthe 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

Page 310: QA Wizard Pro User Guide v2017 - Perforce

Setting source control options

4. Click Fix.

The Surround SCMRepository 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 adirectory.

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 addthem before you can perform other source control actions. See Adding files to source control, page 289.

Setting source control optionsThese 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 areprompted to check out the workspace file if youmake any changes to it, such as adding a new script.

1. Choose Tools > Options.

TheOptions dialog box opens.

2. Click theSource Control tab.

286

Page 311: QA Wizard Pro User Guide v2017 - Perforce

Understanding source control file status icons

3. Select theOn 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 theOn 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, youmust manually check out sourcecontrol files to edit them or enable the option to allow editing of read-only files. See Setting generaloptions, page 40.

5. Click OK to save the changes.

Understanding source control file status iconsWhen aworkspace stored in a source control application, icons in theWorkspace pane indicate the filestatus.

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

Page 312: QA Wizard Pro User Guide v2017 - Perforce

Opening workspaces under source control

Opening workspaces under source controlIf QA Wizard Pro is integrated with Surround SCM, you can open workspaces from Surround SCM to retrievea local copy of an entire workspace or only old, modified, andmissing files.

1. Choose Tools > Source Control > Open Workspace from Surround SCM.

The Surround SCMRepository Browser dialog box opens.

2. Select the repository that contains the QAWizard Pro workspace.

3. Click OK.

If the repository contains multiple workspaces, you are prompted to select the workspace to open.

TheGet 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. Youmay be prompted to replace, skip, or merge files if there areconflicts.

288

Page 313: QA Wizard Pro User Guide v2017 - Perforce

Excluding files from source control

Excluding files from source controlIf a workspace includes files you do not want to add to source control, you canmark them to be excluded.

1. Select the file you want to exclude in theWorkspace pane.

2. Choose Tools > Source Control > Exclude from Source Control.

The file is marked with a redminus sign icon and will be excluded when adding all files in the workspaceto source control.

Note: To include files again, select an excluded file and choose Tools > Source Control > Excludefrom Source Control to toggle the option.

Working with source control filesIf QA Wizard Pro is integrated with a source control application, such as Surround SCM, you can perform thefollowing actions without switching to the source control application.

n Add files. See Adding files to source control, page 289.

n Get files. SeeGetting 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. SeeManaging 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 controlYou can add individual files or an entire workspace to a source control application tomanage files, control fileaccess, 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 theWorkspace 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

Page 314: QA Wizard Pro User Guide v2017 - Perforce

Getting files from source control

3. Select Add all files in the workspace to add the entire workspace to source control. This option is onlyavailable if you selected the workspace file.

4. Optionally enter aComment. 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 controlGet files when you want to view a file but do not need tomake any changes. A read-only copy of the file iscreated in the working directory.

Tip: If you use Surround SCM, you can get files and open a workspace from Surround SCMsimultaneously. SeeOpening workspaces under source control, page 288.

1. Select the files you want to get in theWorkspace pane.

2. Choose Tools > Source Control > Get.

TheGet dialog box opens. The selected files are displayed.

3. Click OK.

The files are copied to the working directory.

290

Page 315: QA Wizard Pro User Guide v2017 - Perforce

Checking out files from source control

Checking out files from source controlCheck out files when you need tomake 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, youmust check out the workspace.

1. Select the files you want to check out in theWorkspace 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 aComment. 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 propertiesFile properties include basic file information, such as comments and the last modified date.

1. Select a file in theWorkspace pane and choose Tools > Source Control > Source ControlProperties.

The Properties dialog box opens.

291

Page 316: QA Wizard Pro User Guide v2017 - Perforce

Viewing source control file history

2. View the file information.

You can view general information, such as size, version, andmodified date, and custom fieldinformation. Depending on the file you select, youmay also be able to view check out and sharinginformation.

3. Click OK to close the Properties dialog box.

Viewing source control file historyAll actions performed on a source file are stored in the source control application. You can view file history andwork with historic versions.

1. Select a file in theWorkspace pane and choose Tools > Source Control > History.

The History dialog box opens.

292

Page 317: QA Wizard Pro User Guide v2017 - Perforce

Viewing source control file history

Note: You can change the columns in the History dialog box. To display a column, right-click acolumn and select the column you want to add from the shortcut menu. Click and drag the column tochange 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, andlabel 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 aspart of a changelist.

Set the workflow state for the file.

Label the selected version.

View labels applied to the selected version.

5. Click Closewhen you finish.

293

Page 318: QA Wizard Pro User Guide v2017 - Perforce

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 changesIf QA Wizard Pro is integrated with Surround SCM, you can use line-by-line annotation to trace the history offile changes. Annotation helps you identify new or changed lines between file versions, whomade the change,when it was made, and the action that caused the change.

1. Select a file in theWorkspace pane and choose Tools > Source Control > Annotate.

The Annotate dialog box opens.

2. Select aVersion to annotate.

You can annotate the latest server version, a historic server version, the current server version based on atimestamp, the version with a specified label, or the latest version in a workflow state in the source controlapplication.

3. Select aShow changes since option. You can view changes since a historic server version, the currentserver version based on a timestamp, the version with a specified label, or the latest version in a workflowstate in the source control application.

Changes are displayed for the version after the selected version and all versions up to the selectedversion. For example, if you select to annotate version 10 and select version 5 in this field, annotationsare displayed for versions 6 through 10.

Note: If you select all the changes since a historic version, it can take several minutes to perform theannotation if there aremany 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 whomade the last change to the line

Version File version the change was included in

294

Page 319: QA Wizard Pro User Guide v2017 - Perforce

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 changemade 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. Alllines in a group share the column information displayed in the first row of the block. Only the Content columninformation is different.

Note: If Surround SCM cannot annotate a line, a dash (-) is displayed and the line is grayed out. Deletedlines 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 themenu. Tomove 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 thesame value. This can help you see the relationship between changes. For example, click a version in theVersion 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 enteredwhen the event was performed. This can help you see information in columns hidden in the Annotatewindow.

n If the event type is Promote or Rebase, click the hyperlink in the Event Type column to annotate theversion that was promoted or rebased.

295

Page 320: QA Wizard Pro User Guide v2017 - Perforce

Viewing pending changes

n To search the Content column, enter a word or phrase in the Find field and click Find. Click Find again togo to the next match.

n To go to a specific line, click Go To, enter the line number, and click OK.

Viewing pending changesYou can view a list of all files that are checked out, modified, or new in the workspace in the Pending Changespane to easily keep track of added or changed files since you checked them out. You can perform sourcecontrol 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 amodified file or add a new file to the source control application. SeeChecking in files to source control, page 298.

n Click Undo Check Out to discard changes and check in the file. See Undoing source control checkout, page 300.

n Click Differences to view the differences between the local file and a version in the source controlapplication server. See Viewing file differences, page 296.

Viewing file differencesYou can view file differences to compare differences between two file versions. After youmake changes to afile, 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

Page 321: QA Wizard Pro User Guide v2017 - Perforce

Viewing file differences

2. Select aVersion.

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 bechanged.

3. Select aSecond 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 selecta file.

4. Click Advanced to select a branched file, historic file version, or unrelated file. The Second File areaexpands 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 toselect a file.

5. Click Differences.

297

Page 322: QA Wizard Pro User Guide v2017 - Perforce

Checking in files to source control

The differences utility starts. Refer to the utility's documentation for additional information.

Checking in files to source controlCheck in files after you finishmaking changes. Check in updates the files with changes, removes the lock,andmakes changes available to other users.

1. Select the files you want to check in in theWorkspace pane.

2. Choose Tools > Source Control > Check In.

The Check In dialog box opens. The selected files are displayed.

3. Optionally enter aComment. 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 changelistsSurround SCM changelists group related files and the actions performed on them and treat the files as oneunit. You can view, edit, and commit changelists from QAWizard Pro.

1. Choose Tools > Source Control > Changelists.

The Changelists dialog box opens.

298

Page 323: QA Wizard Pro User Guide v2017 - Perforce

Managing changelists

Note: The changelists displayed depend on the selected filter. You can display your pendingchangelists, 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.

CommitChangelists

Commit the changelist, which perform actions on all files in the changelist at the sametime.

RenameChangelist

Rename the changelist.

RemoveChangelist

Remove the changelist and all related file actions.

Set Comment Add comments to the file or all files in the changelist.

EditAction Details

Change the file action options.

Move Action Move the file action to another changelist.

299

Page 324: QA Wizard Pro User Guide v2017 - Perforce

Undoing source control check out

Button Use to:

RemoveAction

Remove the file action from the changelist.

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 CodeReview

Add the changelist to a code review.

3.  Click Save As to save the changelist orPrint to print it.

4. Click Closewhen you finish.

Note: See the Surround SCM help for more information about using changelists.

Undoing source control check outIf youmodify a file then decide you do not want to save the changes, you can undo the check out. Thisdiscards changes, checks the file in, and does not create an entry in the version history.

1. Select the checked out files in theWorkspace 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

Page 325: QA Wizard Pro User Guide v2017 - Perforce

Renaming source control files

Renaming source control filesWhen you rename a source control file in QAWizard Pro, you can also rename it in the source controlapplication if you have the appropriate permissions.

1. Right-click the file you want to rename and chooseProperties.

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 orNo to only rename the local copy.

Removing source control filesYou can remove source control files from workspaces, the local disk, and the source control application.

1. In theWorkspace 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 ifyou selected the corresponding option.

301

Page 326: QA Wizard Pro User Guide v2017 - Perforce
Page 327: QA Wizard Pro User Guide v2017 - Perforce

Converting QuickTest Pro Data to QAWizard ProIf you have existing automated tests in HP QuickTest Professional (QTP), you can convert them to QAWizard Pro.

You can convert QTP repository objects, tests, actions, and function libraries. During the conversion, QAWizard Pro analyzes eachQTP item, automatically determines an equivalent, and adds the correspondingitems. Repository objects are added to the QAWizard Pro application repository, tests are added asworkspaces, actions and function libraries are added as scripts, and checkpoints are added as statements inscripts.

Conversion process

Converting QTP data to QAWizard Pro includes the following steps.

1. Get familiar with QA Wizard Pro concepts and how data is converted

If you are a new QAWizard Pro user, take the time to learn about key QAWizard Pro concepts beforeconverting your QTP data. This can help youmore easily find and work with converted data so you canstart running tests more quickly. See Key QAWizard Pro concepts, page 8.

Next, learnmore about how QAWizard Pro converts QTP data. See Understanding QTP dataconversion, page 304.

2. Export data from the QTP Object Repository

Before you can convert objects and checkpoints from theQTP Object Repository, you need to export thedata 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 dataat 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 QAWizard Pro. This can help youidentify any errors that occurred and changes needed tomake tests run correctly. See Reviewing QTPconversion results, page 312.

Supported applications

QTP tests and objects for the following application types can be converted to QAWizard Pro. See SupportedTechnologies 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 theQAWizard Pro SystemRequirements for supported browsers.

n Microsoft Windows Standard

n Microsoft .NETWindows Forms

n DevExpress and Infragistics grid controls

303

Page 328: QA Wizard Pro User Guide v2017 - Perforce

Understanding QTP data conversion

Understanding QTP data conversionWhen converting QTP data, each item is analyzed and converted to a QAWizard Pro equivalent. Forexample, QTP tests are converted to QAWizard Pro workspaces and actions are converted to scripts.

In some cases, an equivalent may not exist in QAWizard Pro. For example, QTP has somemethods that arenot supported in QAWizard Pro. If an equivalent does not exist, QA Wizard Pro indicates it in the conversionlog and resulting scripts. See Reviewing QTP conversion results, page 312.

Following are QTP items and how they are converted to QAWizard Pro. See Key QAWizard Pro concepts,page 8 for more information about the QAWizard Pro components.

QTP item Converted to in QA Wizard Pro

Test objectsstored in theObjectRepository

Windows and controls in the application repository

Test (.usr file) Workspace

Action Script

VBScript(.vbs) file

Script

Functionlibrary (.qflfile)

Script

Standardcheckpoint

Multiple Checkpoint statements in scripts. Other QTP checkpoint types are notconverted.

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 withscripts during the conversion. See Associating datasheets with scripts, page 203

The following QTP data is not converted to QAWizard 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 SetSecuremethod are notdecrypted during conversion. SetSecure is replaced with the SetText statement, which contains a plaintext password. See Encrypting text, page 162 for information about encrypting text strings.

Exporting QTP repository and checkpoint dataBefore you convert QTP repository object and checkpoint data to QAWizard Pro, you need to export it fromtheQTP Object Repository. First, export the data to a SharedObject Repository (TSR) file and then exportthe TSR file to XML.

304

Page 329: QA Wizard Pro User Guide v2017 - Perforce

Converting QTP data

Note: Youmay have to export TSR and XML files for eachQTP action depending on how theObjectRepository is set up.

Exporting TSR files1. In QTP, chooseResources > Object Repository.

TheObject Repository opens.

2. Choose File > Export Local Objects.

The Save SharedObject 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 files1. In QTP, chooseResources > Object Repository Manager.

TheObject Repository Manager opens.

2. Choose File > Open.

TheOpen SharedObject 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 QAWizard Pro. SeeConverting QTP repository objects and checkpoints, page 306.

Converting QTP dataDuring conversion, QAWizard Pro analyzes eachQTP object you choose to convert, automaticallydetermines 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

Page 330: QA Wizard Pro User Guide v2017 - Perforce

Converting QTP repository objects and checkpoints

The information you select in the Convert from QTP dialog box depends on theQTP data you want to convert.For example, youmay want to convert data in small portions depending on the size of QTP repositories andtests.

n Convert only repository objects and checkpoints—Complete only the Repositories area. SeeConverting QTP repository objects and checkpoints, page 306.

n Convert only tests and function libraries—Complete only theWorkspaces area. See Converting QTPtests and function libraries, page 309.

n Convert all QTP data—Complete both the Repositories andWorkspaces areas.

Note: If you convert the sameQTP files again, data already converted is not overwritten in QAWizardPro. Only new data is converted.

Converting QTP repository objects and checkpointsYou can convert QTP repository objects and checkpoints to add them to the QAWizard Pro applicationrepository and scripts.

Note: Before you can convert QTP data, youmust export it from theQTP Object Repository to a TSR fileand then to an XML file. See Exporting QTP repository and checkpoint data, page 304.

306

Page 331: QA Wizard Pro User Guide v2017 - Perforce

Converting QTP repository objects and checkpoints

The application repository contains information about the applications and versions you are testing. Thisinformation is used during playback to locate and perform actions in the application. See About applicationrepositories, page 57.

QTP checkpoints are added as multiple Checkpoint statements in QAWizard Pro scripts.

Note: You can select multiple items to add in the Repositories andWorkspaces areas, but keep inmindthat all selected data is added to the application version in the repository and workspace you select. Toconvert 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 theQA Wizard Pro application repository to convertQTP data to.

The Select Application Version dialog box opens.

307

Page 332: QA Wizard Pro User Guide v2017 - Perforce

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 newapplication. See Adding applications, page 47.

Tip:We recommend converting to an application in the local repository instead of the globalrepository. After the conversion, you canmake any changes in the local repository before promotingto the global repository and sharing the version with other QAWizard Pro users. See Promotingapplications, page 50.

4. Click OK.

5. In the Repositories area, click Add to add the QTP repository objects and checkpoints to convert.

TheOpen 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 QAWizard Pro item type.

Icon Indicates:

Window or control

Checkpoint

7. Add any additional QTP XML files to convert.

308

Page 333: QA Wizard Pro User Guide v2017 - Perforce

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 theWorkspaces 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 QAWizard Pro before stopping theconversion is not removed.

10. When conversion is complete, review the results to identify any issues that occurred or additionalchanges tomake in scripts and other test data.

It is important to compare the items processed against the items converted. Discrepancies betweenthese numbers indicate you should review the converted items to see if you need tomake any changes.See Reviewing QTP conversion results, page 312.

Note: Click View Log to view the conversion log, which provides details about each item processedduring the conversion. See Viewing the QTP conversion log, page 314.

11. Click Close to close the progress dialog box.

Converting QTP tests and function librariesYou can convert QTP tests and function libraries to add them as QAWizard Pro scripts.

Data tables associated with converted tests are added as QAWizard Pro datasheets.

Note: You can select multiple items to add in the Repositories andWorkspaces areas, but keep inmindthat all selected data is added to the application version in the repository and workspace you select. Toconvert to different applications or workspaces, perform another conversion.

1. Choose Tools > Convert from QTP.

The Convert from QTP - Setup dialog box opens.

309

Page 334: QA Wizard Pro User Guide v2017 - Perforce

Converting QTP tests and function libraries

2. In the Repositories area, click Browse to select theQA Wizard Pro application repository to convertQTP 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 newapplication. See Adding applications, page 47.

310

Page 335: QA Wizard Pro User Guide v2017 - Perforce

Converting QTP tests and function libraries

Tip:We recommend converting to an application in the local repository instead of the globalrepository. After the conversion, you canmake any changes in the local repository before promotingto the global repository and sharing the version with other QAWizard Pro users. See Promotingapplications, page 50.

4. Click OK.

5. In theWorkspaces area, click Browse to select theQA Wizard Pro workspaces directory to convertQTP 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 inC:\Users\<username>\Documents\My Documents\QA Wizard ProWorkspaces.

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 (.qflor .vbs) file to convert and click Open.

A preview of the items to convert is displayed.

The following icons indicate the QAWizard 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

Page 336: QA Wizard Pro User Guide v2017 - Perforce

Reviewing QTP conversion results

9. To change the name of a workspace, script, or datasheet during conversion, select the item in the previewand enter the new name.

If you change a workspace name, it also changes in the file path for any scripts added to the workspaceduring conversion.

10. If you want to convert any QTP repository objects and checkpoints, complete the fields in theRepositories 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 QAWizard Pro before stopping theconversion is not removed.

12. When conversion is complete, review the results to identify any issues that occurred or additionalchanges tomake in scripts and other test data.

It is important to compare the items processed against the items converted. Discrepancies betweenthese numbers indicate you should review the converted items to see if you need tomake any changes.See Reviewing QTP conversion results, page 312.

Note: Click View Log to view the conversion log, which provides details about each item processedduring the conversion. See Viewing the QTP conversion log, page 314.

13. Click Close to close the progress dialog box.

Reviewing QTP conversion resultsWhen theQTP conversion is complete, it is important to take the time to review the results andmake anychanges tomake sure scripts run correctly.

312

Page 337: QA Wizard Pro User Guide v2017 - Perforce

Reviewing QTP conversion results

Review conversion statistics

When the conversion is complete, statistics are displayed in the progress dialog box. Compare the itemsprocessed against the items converted. Discrepancies between these numbers indicate that you shouldreview the converted items to see if you need tomake any changes.

View the conversion log

A log file is created during each conversion, which provides details about eachQTP item processed andconverted. 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 commentsadded during the conversion. Comments are indicated with an apostrophe and appended after statements.These comments provide information about statements you shouldmodify or remove for best results.

Note: Statements starting with QTPCompat, such as QTPCompatSetCaretPos, may be added toconverted scripts. These statements help QAWizard Pro test actions that are performed differently inQTP, but they are not supported statements in the scripting language. We recommend replacingQTPCompat statements with the recommendedQAWizard Pro statement provided in the comments forbest results.

SeeModifying Scripts, page 145 for information.

313

Page 338: QA Wizard Pro User Guide v2017 - Perforce

Viewing the QTP conversion log

Run scripts

Run scripts to verify that they complete successfully. See Running scripts, page 73. If scripts do not runsuccessfully, youmay need tomake changes to the script or application repository. Review the results reportto identify any issues. See Viewing results reports, page 75.

Tip: You can also debug scripts to troubleshoot issues. See Running scripts in debugmode, page 211.

Viewing the QTP conversion logA log file is generated during eachQTP conversion. The log includes details about each item converted to QAWizard Pro and any ignored items. The log can help you or Perforce Support troubleshoot conversion issuesor 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 theQAWizard Pro directory in the AppData directory for theuser who ran the conversion (e.g., C:\Users\JeffUser\AppData\Roaming\Perforce\QA Wizard Pro).Log files are namedQTPConversionLog followed by the date and time the conversion wasperformed. For example, QTPConversionLog_1_10_2013.txt.

2. Close the log when you are finished.

Troubleshooting QTP conversionsTo avoid issues that prevent scripts from running successfully, make sure you review the conversion resultsand scripts after converting from QTP. See Reviewing QTP conversion results, page 312. Addressing anycomments added to converted scripts helps resolvemany issues that cause script failures.

You can also view the conversion log for details about eachQTP item processed and converted. See Viewingthe QTP conversion log, page 314.

Following are some common issues that occur after converting scripts to QTP.

Items selected using indexes are incorrect

QAWizard Pro uses 1-based indexes andQTP uses 0-based indexes. Youmust increment references toindexes in statements by 1. For example, in the following statement, 9 must be updated to 10 to select thecorrect 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, youmay want to check the window and controlnames in scripts against the names in the application repository. SeeModifying window and controlproperties, page 122.

If the names do not match, modify scripts or the repository to use the correct name. QTP items are onlyrenamed during conversion if a conflict occurs. To view the original QTP object name, right-click the windowor control in the application repository and chooseProperties. TheQTP Object Name property value is theoriginal QTP name.

314

Page 339: QA Wizard Pro User Guide v2017 - Perforce

Troubleshooting QTP conversions

Note: If QTP items were not converted successfully and you are unable to resolve the issues, contactPerforce Support and provide any conversion logs for troubleshooting.

315

Page 340: QA Wizard Pro User Guide v2017 - Perforce
Page 341: QA Wizard Pro User Guide v2017 - Perforce

Setting Up RDBMS DatabasesTheQAWizard Pro Server database is stored in a Relational DatabaseManagement System (RDBMS).SQLite is the default database type and does not require any setup or configuration before or after installation.

QAWizard Pro data can also be stored in other RDBMS types, which allows you to leverage your existingdatabase administration process. Microsoft SQL Server, Oracle, and PostgreSQL are supported. SeeQAWizard 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 databasesPerforce does not provide support for installing, configuring, or maintaining Oracle. A qualified Oracledatabase administrator should install and configure the database and create the required schemas andtablespaces.

Keep the following inmind:

n Do not add, delete, or modify any fields in the QAWizard 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 andcorrecting these issues is not covered by Perforce.

n Create a process to back up database tables on a regular schedule.

n Running Oracle and theQAWizard Pro Server on the same computer can result in slow performance if notconfigured correctly. Make sure Oracle is configured correctly to avoid using all the systemmemory.

Connecting to Oracle

The recommendedmethod for using Oracle is via Oracle Call Interface (OCI). Download and install therequired Oracle Instant Client libraries.

Creating database tables

TheQAWizard Pro Server automatically creates tables when you start the server or convert the serverdatabase. TheQAWServerDbCreate.sql script file, which is located in the Oracle directory in the QAWizardPro application directory, is used to create the tables.

Creating Oracle users

Youmust create anOracle user for the QAWizard Pro Server. The user only requires default connectionprivileges and should not have any Oracle DBA privileges. Use your preferred tablespacemanagement for theusers. An easy method is to set up the user to share the USERS tablespace and to enable an unlimited quota.

317

Page 342: QA Wizard Pro User Guide v2017 - Perforce

Setting up PostgreSQL databases

Sizing, memory, and tuning

Oracle sizing and tuning settings should be consistent with your corporate standards. Review the SQL scriptsfor schema creation installed with the QAWizard Pro Server to determine the appropriate settings.

Setting up PostgreSQL databasesPerforce does not provide support for installing, configuring, or maintaining PostgreSQL. A qualifiedPostgreSQL database administrator should install and configure the database.

Keep the following inmind:

n Do not add, delete, or modify any fields in the QAWizard 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 andcorrecting these issues is not covered by Perforce.

n Create a process to back up database tables on a regular schedule.

n Running PostgreSQL and theQAWizard Pro Server on the same computer can result in slow performanceif not configured correctly. Make sure PostgreSQL is configured correctly to avoid using all the systemmemory.

Creating server database tables

TheQAWizard Pro Server automatically creates tables in PostgreSQLwhen you start the server or convertthe server database. TheQAWServerDbCreate.sql script file, which is located in the PostgreSQL directory inthe QAWizard Pro application directory, is used to create the tables.

Setting up SQL Server databasesPerforce does not provide support for installing, configuring, or maintaining SQL Server. A qualified SQLServer database administrator should install and configure the database.

Keep the following inmind:

n Do not add, delete, or modify any fields in the QAWizard 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 andcorrecting 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 theQAWizard Pro Server on the same computer can result in slow performanceif not configured correctly. Make sure SQL Server is configured correctly to avoid using all the systemmemory.

Note: Youmust be amember of the db_ddladmin role and have the CREATE TABLE, CREATEPROCEDURE, and CREATE VIEW permissions to create the QAWizard Pro tables.

318

Page 343: QA Wizard Pro User Guide v2017 - Perforce

Troubleshooting RDBMS connections

Creating server database tables

TheQAWizard Pro Server automatically creates tables when you start the server or convert the serverdatabase. TheQAWServerDbCreate.sql script file, which is located in the SQLServer directory in the QAWizard Pro application directory, is used to create the tables.

Troubleshooting RDBMS connectionsThe following information can help you troubleshoot commonRDBMS issues. Refer to the database vendordocumentation for additional help.

Note: If the QAWizard Pro Server cannot connect to the server database, errors are added to theWindows Event Log.

The QA Wizard Pro Server cannot start because another QA Wizard Pro Serveris using the same databaseThis error occurs when the database is in use by a different QAWizard Pro Server. Youmust manually modifythe QAWizard 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 foruser '(null)'. Reason: not associated with a trustedSQL Server connection.

The database connection was not configured touseWindows Authentication in the QAWizardPro Server Admin Utility.

System.Data.SqlClient.SqlException Login failed foruser 'xxxx'.

The username or password entered in thedatabase connection information is not valid.

Oracle connection errors

Error Cause

System.ExceptionSystem.Data.OracleClientrequires Oracle clientsoftware version 8.1.7 orgreater.

TheOracle Instant client drivers are not installed. See Setting upOracledatabases, page 317 for information about downloading the installers.

319

Page 344: QA Wizard Pro User Guide v2017 - Perforce

Troubleshooting RDBMS connections

Error Cause

ORA-12514: TNS:listenerdoes not currently know ofservice requested inconnect descriptor QOCI

The service name specified in the RDBMS connection information does notexist. Make sure that an Oracle listener was created with the specifiedservice name on the host computer.

This error can also occur if a version of the full Oracle client older than 10g isinstalled. If the full client appears in the PATH environment variable, the olderoci.dll may be loaded. To resolve this issue, search for all instances of theoci.dll file. If multiple copies are found, remove the other copies or removetheir directory reference from the PATH environment variable.

ORA-12154: TNS:couldnot resolve the connectidentifier specified QOCI

The computer specified in the RDBMS connection host name cannot befound. Make sure the host name is correct and the host computer is running.

ORA-12541: TNS:nolistener QOCI

The port number specified in the RDBMS connection information is not avalid TNS listener port on the specified host computer. Check the host portnumber.

ORA-01017: invalidusername/password;logon denied QOCI

The username or password specified in the RDBMS connection informationis not valid. Check the username and password.

PostgreSQL connection errors

Error Cause

Opening the database connection failed because theQAWizard Pro Server could not connect to the serveror translate the host name

TheQAWizard Pro Server cannot connect to thePostgreSQL service. Check the following andthen 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 remoteconnections.

320

Page 345: QA Wizard Pro User Guide v2017 - Perforce

StatementsStatements are instructions that specify how QAWizard Pro interacts with an application. Some statementsare automatically added to scripts during recording, while others must be addedmanually. Statements canalso 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 Checkpoint

n Comment

n Conditional

n Datasheet

n Date/Time

n Error Handling

n File

n Helix ALM

n Image

n Integrated Actions

n JSON

n Keyboard Actions

n Load Testing

n Loop

n Math

n Mouse Actions

n Object Actions

n OCR

n Programming

n QAWizard Pro

n Script Control

n Stress

n String

n System

n Timing

n Touch Actions

n Web

n WebBrowser Actions

n Window Actions

Note: Some statements accept null arguments and return null values. If a statement cannot accept orreturn a null value, an error is returned.

Application control statementsApplication control statements perform actions at the application level.

Statement Description More information

BoundaryChecks Activates or inactivatesboundary checking formouse coordinates, whichprevents enteringcoordinates outside acontrol's boundary.

BoundaryChecks, page 360

CaptureScreenshot Captures a screenshot aftera statement runs and savesit as a PNG file.

CaptureScreenshot, page 360

GetControlSearchTimeout Returns themaximum timeset to find a window orcontrol in the application.

GetControlSearchTimeout, page 425

321

Page 346: QA Wizard Pro User Guide v2017 - Perforce

Application control statements

Statement Description More information

GetCurrentBrowserType Returns an integer thatindicates the browserrunning the script.

GetCurrentBrowserType, page 426

GetLowLevelSpeed Returns the playback speedset for low-level actions.

GetLowLevelSpeed, page 434

GetPlaybackDelay Returns the delay setbetween each statement.

GetPlaybackDelay, page 436

GetPropertyMap Returns amap of allproperty names and valuesfrom awindow or control.Additional statements canbe called on a PropertyMap,but are not available in theAdd Statement dialog box.See PropertyMapstatements, page 344.

GetPropertyMap, page 437

GetPropertyNames Returns an array of allproperty names from awindow or control.

GetPropertyNames, page 438

IgnoreAutocompleteDropDowns Ignores autocomplete drop-down lists in webapplications.

IgnoreAutocompleteDropDowns,page 452

IsIgnoringAutocompleteDropDowns Returns True or False toindicate if autocompletedrop-down lists are ignored.

IsIgnoringAutocompleteDropDowns,page 458

Property Returns a window or controlproperty value.

Property, page 509

Script.ClearContext Terminates the existingconnection to an applicationin the application repository.

Script.ClearContext, page 529

Script.ClearLoadTestContext Terminates the existingconnection to an applicationin the application repositorywhen running a load test.

Script.ClearLoadTestContext, page529

Script.CloseApp Closes all applications QAWizard Pro is currentlyconnected to.

Script.CloseApp, page 530

322

Page 347: QA Wizard Pro User Guide v2017 - Perforce

Application control statements

Statement Description More information

Script.ConnectToProcess Connects to an applicationrunning on the testcomputer.

Script.ConnectToProcess, page 530

Script.GetContext Returns the applicationname and version numberthe script is running against.

Script.GetContext, page 531

Script.GetLoadTestContext Returns the applicationname and version numberthe load test is runningagainst.

Script.GetLoadTestContext, page532

Script.RunApp Starts the application to useduring playback.

Script.RunApp, page 532

Script.SetBrowser Sets the browser used torun the script.

Script.SetBrowser, page 533

Script.SetContext Establishes a connection tothe application repositoryand specifies the applicationname and version to use.

Script.SetContext, page 534

Script.SetLoadTestContext Establishes a connection tothe application repositoryand specifies the URL andversion number to use for aload test.

Script.SetLoadTestContext, page534

SetControlSearchTimeout Sets themaximum time towait for QAWizard Pro tosearch for a window orcontrol in the application.

SetControlSearchTimeout, page 540

SetLowLevelSpeed Sets the playback speed oflow-level actions.

SetLowLevelSpeed, page 545

SetPlaybackDelay Sets the number ofmilliseconds to waitbetween statements duringplayback.

SetPlaybackDelay, page 546

323

Page 348: QA Wizard Pro User Guide v2017 - Perforce

Checkpoint statements

Statement Description More information

WaitForExists Waits a period of time for awindow or control to existbefore continuing with thenext statement and returnsTrue or False to indicate if itis found.

WaitForExists, page 567

WaitForExistsTimed Waits a period of time for awindow or control to existbefore continuing with thenext statement and returnsthe number of millisecondsit took to find it.

WaitForExistsTimed, page 568

WaitForProperty Waits a period of time to finda value in a window orcontrol property beforecontinuing with the nextstatement and returns Trueor False to indicate if it isfound.

WaitForProperty, page 569

Checkpoint statementsCheckpoint statements verify values and images against expected results.

Statement Description More information

CheckExists Verifies a window or control exists in theapplication.

CheckExists, page 362

Checkpoint Verifies the value of a window and controlproperty matches an expected value.

Checkpoint, page 363

CheckpointExpression Verifies if the value returned by anexpression is True.

CheckpointExpression,page 364

CheckpointImage Verifies an image in an applicationmatchesan expected image.

CheckpointImage, page 364

CheckpointStringExists Verifies a substring exists in a text string. CheckpointStringExists,page 365

CheckpointStringNotExists Verifies a substring does not exist in a textstring.

CheckpointStringNotExists,page 366

324

Page 349: QA Wizard Pro User Guide v2017 - Perforce

Comment statements

Comment statementsComment statements add comments to scripts, which can help you explain how a script works to othertesters.

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 statementsConditional statements evaluate an expression and run a block of script steps depending on the result.

Statement Description Moreinformation

Case Contains a value that is compared to the resulting value of an expressionin a Select...Case statement.

Case, page361

Else Runs an alternate block of statements when an If or ElseIf statementcondition is False.

Else, page392

ElseIf A combination of If and Else statements. Runs an alternate block ofstatements when an If statement condition is False and an alternatecondition is True.

ElseIf, page392

If Conditionally runs a block of statements based on the value of anexpression (True or False).

If, page 451

Select...Case Performs one of several blocks of statements for a condition with morethan two outcomes. Compares the result of an expression againstvalues in one or more Case statements.

Select...Case,page 536

Datasheet statementsDatasheet statements return values from script data sources.

Statement Description More information

Cell Returns the value from a column in thecurrent row of the script data source.

Cell, page 362

CommitRecordsetRow Adds a data row to the currentrecordset.

CommitRecordsetRow, page370

CreateRecordsetRow Returns a new data row that can bepopulated and added to a recordset.

CreateRecordsetRow, page375

325

Page 350: QA Wizard Pro User Guide v2017 - Perforce

Datasheet statements

Statement Description More information

DeleteRecordsetRow Deletes the current row from arecordset.

DeleteRecordsetRow, page386

FirstRow Makes the first row in a recordset theactive row.

FirstRow, page 417

GetDataSourceColumnNames Returns an array of column namesfrom the data source associated withthe script.

GetDataSourceColumnNames,page 427

GetRecordsetColumnNames Returns an array of column namesfrom a recordset or data row.

GetRecordsetColumnNames,page 439

GetRowValue Returns the column value from thecurrent row of a recordset.

GetRowValue, page 440

GetSQLScalar Returns a value from a data sourcelinked to an external datasheet basedon a SQL scalar query.

GetSQLScalar, page 442

LastRow Makes the last row in a recordset theactive row.

LastRow, page 472

NextRow Moves to the next row in a recordset. NextRow, page 491

OpenRecordset Returns a recordset object openedfrom a datasheet.

OpenRecordset, page 504

OpenRecordsetQuery Returns a recordset object from a datasource linked to an external datasheetbased on a SQL query.

OpenRecordsetQuery, page505

PrevRow Moves to the previous row in arecordset.

PrevRow, page 508

RecordsetBOF Returns True or False to indicate if thecurrent recordset row index is beforethe beginning of the data.

RecordsetBOF, page 513

RecordsetEOF Returns True or False to indicate if thecurrent recordset row index is past theend of the data.

RecordsetEOF, page 514

RecordsetRowCount Returns the total number of records ina recordset.

RecordsetRowCount, page 515

RunSQLCommand Runs a SQL command on a datasource linked to an external datasheetand returns the number of rows thecommand is performed on.

RunSQLCommand, page 526

326

Page 351: QA Wizard Pro User Guide v2017 - Perforce

Date/time statements

Statement Description More information

SetCell Sets the column value in the currentrow of the script data source.

SetCell, page 539

SetRowValue Sets a field value in a recordset or datarow.

SetRowValue, page 547

Date/time statementsDate/time statements convert, query, and return date/time values.

Statement Description Moreinformation

Date Returns the date in MM/DD/YYYY format based on integers thatrepresent the year, month, and day.

Date, page 376

DateAdd Adds a time to a date/time value and returns the resulting value inthe short date and time format used on the test computer.

DateAdd, page377

DateDiff Returns the difference between two date/time values based on aninterval type.

DateDiff, page378

DatePart Returns a part from a date/time value as an integer. DatePart, page379

DateTime Returns the date and time inMM/DD/YYYY format based onintegers that represent the year, month, day, hour, minute, andsecond.

DateTime, page380

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 theminute from a date/time value. Minute, page 481

Month Returns themonth from a date/time value as an integer. Month, page 484

MonthName Returns amonth name based on amonth integer. MonthName,page 485

MonthNum Returns amonth integer based on amonth name. MonthNum, page485

327

Page 352: QA Wizard Pro User Guide v2017 - Perforce

Error handling statements

Statement Description Moreinformation

Now Returns the current date and time in the format used on the testcomputer.

Now, page 491

Second Returns the seconds from a date/time value. Second, page535

Time Returns the time in seconds since epoch (January 1, 1970 12:00AM).

Time, page 560

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 fora date.

Weekday, page590

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 statementsError 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 Trycalls up to the script line where the last error occurred.

Err.CallStack, page395

Err.Description Returns a string with the last error that occurred, as definedin the Err.Raise statement.

Err.Description,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 erroroccurred.

Err.LineText, page398

Err.Number Returns the error number for the last error that occurred, asdefined in the Err.Raise statement.

Err.Number, page399

Err.Raise Generates a script error. Err.Raise, page 400

328

Page 353: QA Wizard Pro User Guide v2017 - Perforce

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,as defined in the Err.Raise statement.

Err.Source, page401

Fail Stops script playback, displays amessage in the Errorspane, and adds themessage to the run report.

Fail, page 408

GetCallStack Returns the complete stack of function, subroutine, script,and Try calls up to the current script line.

GetCallStack, page423

GetVariableValues Returns all script and repository variables and the currentvalues as a string.

GetVariableValues,page 446

IgnoreErrors Stops displaying errors in the Errors pane during playbackand in run reports.

IgnoreErrors, page453

IgnoreWarnings Stops displaying warnings in the Errors pane duringplayback and in run reports.

IgnoreWarnings,page 453

IsIgnoringErrors Returns True or False to indicate if errors are displayed inthe Errors pane during playback and in run reports.

IsIgnoringErrors,page 458

IsIgnoringWarnings Returns True or False to indicate if warnings are displayedin the Errors pane during playback and in run reports.

IsIgnoringWarnings,page 459

On Error Sets the error handling behavior for a script, function, orsubroutine.

On Error, page 504

Throw Regenerates the error handled by the containing Catchblock.

Throw, page 559

Try...Catch...Finally Wraps a block of statements where errors may occur.Statements in the Try block run until an error occurs. If anerror occurs, playback continues with statements in theCatch block. Statements in the Finally block always runeven if errors do not occur.

Try...Catch...Finally,page 565

Warning Displays a warningmessage in the Errors pane and adds itto the run report.

Warning, page 570

File statementsFile statements perform actions on and return values from files and directories.

Note: QAWizard Pro uses full paths to search for files and directories referenced in scripts. SeeIdentifying files and directories in statements, page 156 for information about configuring full paths relativeto the workspace or script directory.

329

Page 354: QA Wizard Pro User Guide v2017 - Perforce

File statements

Statement Description More information

AppendToFile Appends text to a file. Creates the file if it does notexist.

AppendToFile, page 355

CombinePaths Combines two directory paths into one and returnsthe combined path.

CombinePaths, page369

CompareFileContents Returns True or False to indicate if two files areidentical.

CompareFileContents,page 370

CopyFile Copies a file to a new location. CopyFile, page 373

CreateDirectory Creates a directory and subdirectories in a path. CreateDirectory, page374

CreateTempFile Creates an empty temporary file and returns the fullpath.

CreateTempFile, page376

DeleteDirectory Deletes a directory. DeleteDirectory, page385

DeleteFile Deletes a file. DeleteFile, page 386

DirectoryExists Returns True or False to indicate if a directoryexists.

DirectoryExists, page387

FileBaseName Returns a filenamewithout the extension ordirectory.

FileBaseName, page408

FileDateCreated Returns the date and time a file or directory wascreated.

FileDateCreated, page409

FileDateLastModified Returns the date and time a file or directory was lastmodified.

FileDateLastModified,page 409

FileDirectoryName Returns the directory from a path from a file path orthe parent directory path from a subdirectory path.

FileDirectoryName,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 afile path.

FileExtension, page 411

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

Page 355: QA Wizard Pro User Guide v2017 - Perforce

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 QAWizardPro.

GetCurDir, page 426

GetDirectory Returns the path to a system or QAWizard Prodirectory.

GetDirectory, page 428

GetDirectoryNames Returns an array of all subdirectory names from adirectory or only the subdirectory names that matcha search pattern.

GetDirectoryNames,page 428

GetFileNames Returns an array of all filenames from a directory oronly the filenames that match a search pattern.

GetFileNames, page432

GetFilePath Returns the file path to a QAWizard Pro script orrunning application.

GetFilePath, page 433

MoveDirectory Moves or renames a directory. MoveDirectory, page487

MoveFile Moves or renames a file. MoveFile, page 488

ReadTextFile Reads a text file and returns the contents to avariable.

ReadTextFile, page 513

SetAllFilesReadOnly Sets or clears the read-only attribute on all files in adirectory.

SetAllFilesReadOnly,page 539

SetFileReadOnly Sets or clears the read-only attribute on a file. SetFileReadOnly, page543

Helix ALM statementsHelix ALM statements add issues to Helix ALM projects and identify test case steps.

Note: TestTrack was renamedHelix ALM starting with the 2017.1 release.

Statement Description More information

AddFileAttachment Attaches a file to a Helix ALM issue. AddFileAttachment,page 352

331

Page 356: QA Wizard Pro User Guide v2017 - Perforce

Image statements

Statement Description More information

AddIssue Adds an issue to the Helix ALM project configured for theworkspace. Specified text is added to the Summary,Description, Steps to Reproduce, andOther Hardware andSoftware fields.

AddIssue, page 353

AddToHelixALM Adds an issue created by the NewIssue statement to theHelix ALM project configured for the workspace after all fieldvalues to include are set.

AddToHelixALM,page 354

GetFieldValue Returns the value of a Helix ALM issue field as a string. GetFieldValue,page 431

NewIssue Creates an empty Helix ALM issue. NewIssue, page490

RemoveField Removes a field value from aHelix ALM issue. RemoveField, page517

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 statementsImage statements return values based on image comparisons and capture images of specified regions inapplications relative to windows, controls, or the test computer screen.

Statement Description More information

CompareImage Returns True or False to indicate if an applicationimage captured during playback matches anexpected image within an accuracy percentage.

CompareImage, page371

SaveRegionToImageFile Saves a region relative to a window, control, or thetest computer screen as a PNG file.

SaveRegionToImageFile,page 527

Integrated action statementsIntegrated action statements perform accessibility actions on controls, run statements against.NET properties, and retrieve data from the .NET framework.

332

Page 357: QA Wizard Pro User Guide v2017 - Perforce

JSON statements

Statement Description More information

GetDotNETProperty Returns the value of a .NETproperty.

GetDotNETProperty, page 429

GetDotNETPropertyWithArgs Returns the value of a .NETproperty with parameters in anarray.

GetDotNETPropertyWithArgs,page 430

InvokeDotNETMethod Invokes a .NETmethod and returnsthemethod value.

InvokeDotNETMethod, page454

InvokeDotNETMethodWithArgs Invokes a .NETmethod withparameters in an array and returnsthemethod value.

InvokeDotNETMethodWithArgs,page 455

MSAADoDefaultAction Uses Active Accessibility toperform a control's default action.

MSAADoDefaultAction, page488

MSAASetName Uses Active Accessibility to set thename of a control.

MSAASetName, page 488

MSAASetValue Uses Active Accessibility to set thevalue of a control.

MSAASetValue, page 489

SetDotNETProperty Sets the value of a .NET property. SetDotNETProperty, page 544

SetDotNETPropertyWithArgs Sets the value of a .NET propertywith parameters in an array.

SetDotNETPropertyWithArgs,page 545

JSON statementsJavaScript Object Notation (JSON) statements validate, return, set, and remove values in JSONObjects andJSONArrays.

Note: The following statements are available in the Add Statement dialog box. Additional statements canbe called on instances of JSONObjects and JSONArrays, but are not available in the Add Statementdialog box. See JSONArray statements, page 334 and JSONObject statements, page 335.

Statement Description More information

JSONArrayGetValue Returns the value of an index from a JSONArrayor a default value if the index is out of range.

JSONArrayGetValue,page 463

JSONArraySetValue Sets or adds the value to an index in aJSONArray and returns themodified array.

JSONArraySetValue,page 464

JSONCanParseAsArray Returns True or False to indicate if anexpression contains a JSONArray.

JSONCanParseAsArray,page 465

333

Page 358: QA Wizard Pro User Guide v2017 - Perforce

JSON statements

Statement Description More information

JSONCanParseAsObject Returns True or False to indicate if anexpression contains a JSONObject.

JSONCanParseAsObject,page 465

JSONIsValid Returns True or False to indicate if anexpression is valid JSON.

JSONIsValid, page 466

JSONNewArray Creates and returns an empty JSONArray. JSONNewArray, page467

JSONNewObject Creates and returns an empty JSONObject. JSONNewObject, page467

JSONObjectGetValue Returns the value of a property from aJSONObject or a default value if the propertyname is not found.

JSONObjectGetValue,page 467

JSONObjectSetValue Sets or adds the value to a property name in aJSONObject and returns themodified object.

JSONObjectSetValue,page 468

JSONParse Returns a value after parsing an object usingJSON syntax.

JSONParse, page 469

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, page433

GetValue Returns the value of an index in a JSONArray or a default value if theindex is out of range.

GetValue -JSONArray, page444

InsertAt Inserts a value at an index in a JSONArray and pushes all valuesafter it in the array back one position.

InsertAt, page 453

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 orFalse to indicate if it was successfully removed.

RemoveAt, page516

334

Page 359: QA Wizard Pro User Guide v2017 - Perforce

Keyboard action statements

Statement Description More information

SetValue Sets or adds a value to an index in a JSONArray. SetValue -JSONArray, page549

ToString Converts a JSONArray type to a string and returns the string. ToString -JSONArray, page561

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 adefault value if the property name is not found.

GetValue -JSONObject, page 445

HasProperty Returns True or False to indicate if a property name existsin a JSONObject.

HasProperty -JSONObject, page 447

RemoveProperty Removes a property from a JSONObject and returns Trueor False to indicate if it was successfully removed.

RemoveProperty, page518

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 thestring.

ToString -JSONObject, page 561

Keyboard action statementsKeyboard action statements perform actions using the keyboard. These actions can be performed on aspecified window or control or at the application level.

Statement Description Moreinformation

KeyDown Presses and holds one or more keyboard keys on a window or control, or atthe application level.

KeyDown,page 470

KeyPress Presses and releases one or more keyboard keys on a window or control, orat the application level.

KeyPress,page 470

KeyUp Releases one or more keyboard keys on a window or control, or at theapplication level.

KeyUp, page471

335

Page 360: QA Wizard Pro User Guide v2017 - Perforce

Load testing statements

Statement Description Moreinformation

TypeText Enters text in a control or at the application level. TypeText,page 566

Load testing statementsLoad 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 thecurrent virtual user.

GetVirtualUserID, page 446

WebAddNetworkCredential Adds a set of credentials to thecache of network credentialssent with all web requests.

WebAddNetworkCredential, page570

WebAddSessionVariable Adds a form variable to look for ininput fields on responses fromtheWebGet andWebPoststatements and replaces thevariable value captured duringrecording with the value returnedfrom the web server.

WebAddSessionVariable, page571

WebClearAllCustomHeaders Clears all custom headerscreated byWebSetCustomHeaderstatements sent with all webrequests.

WebClearAllCustomHeaders,page 572

WebClearNetworkCredentials Clears the cache of networkcredentials created byWebAddNetworkCredentialstatements sent with all webrequests.

WebClearNetworkCredentials,page 572

WebCloseAllConnections Closes all open connections toall web servers.

WebCloseAllConnections, page572

WebCloseConnection Closes the connection to a webserver.

WebCloseConnection, page 573

WebDelete Sends a DELETE command andreturns the data received from aweb page.

WebDelete, page 573

336

Page 361: QA Wizard Pro User Guide v2017 - Perforce

Load testing statements

Statement Description More information

WebGet Sends aGET command andreturns the data retrieved from aweb page.

WebGet, page 574

WebGetCookie Returns the cookie value set by aWebSetCookie, WebGet, orWebPost statement.

WebGetCookie, page 575

WebGetAllCustomHeaders Returns an array of customheader names set byWebSetCustomHeaderstatements.

WebGetAllCustomHeaders, page574

WebGetCustomHeader Returns the header value set byaWebSetCustomHeaderstatement.

WebGetCustomHeader, page 576

WebGetReferrer Returns the referrer set by aWebSetReferrer statement.

WebGetReferrer, page 577

WebGetUserAgent Returns the browser user agent. WebGetUserAgent, page 578

WebHead Sends a HEAD command andreturns the data received from aweb page.

WebHead, page 578

WebOptions Sends anOPTIONS commandand returns the requestsaccepted by the web server thathosts the URL.

WebOptions, page 579

WebPatch Sends a PATCH command andreturns the data received from aweb page.

WebPatch, page 579

WebPatchFromFile Sends a PATCH command froma file and returns the datareceived from aweb page.

WebPatchFromFile, page 580

WebPatchJSON Sends a PATCH command froma JSON statement and returnsthe data received from web page.

WebPatchJSON, page 581

WebPost Sends a POST command andreturns the data received from aweb page.

WebPost, page 581

337

Page 362: QA Wizard Pro User Guide v2017 - Perforce

Load testing statements

Statement Description More information

WebPostFromFile Sends a POST command from apostdata file and returns the datareceived from aweb page.

WebPostFromFile, page 582

WebPostJSON Sends a POST command from aJSON statement and returns thedata received from aweb page.

WebPostJSON, page 583

WebPut Sends a PUT command andreturns the data received from aweb page.

WebPut, page 584

WebPutFromFile Sends a PUT command from afile and returns the data receivedfrom aweb page.

WebPutFromFile, page 584

WebPutJSON Sends a PUT command from aJSON statement and returns thedata received from aweb page.

WebPutJSON, page 585

WebRemoveAllSessionVariables Stops updating all form variablesset by WebAddSessionVariablestatements for all web requests.

WebRemoveAllSessionVariables,page 586

WebRemoveCustomHeader Removes a custom header setby aWebSetCustomHeaderstatement from the list ofheaders sent with all webrequests.

WebRemoveCustomHeader,page 586

WebRemoveSessionVariable Stops updating a form variableset by aWebAddSessionVariablestatement for all web requests.

WebRemoveSessionVariable,page 587

WebSetCookie Sets a cookie to send with otherload testing statements.

WebSetCookie, page 588

WebSetCustomHeader Sets a custom header to sendwith other load testingstatements.

WebSetCustomHeader, page 588

WebSetReferrer Sets the referrer URL used byother load testing statements.

WebSetReferrer, page 589

WebSetUserAgent Overrides the browser user agentsent by the client with a customuser agent.

WebSetUserAgent, page 590

338

Page 363: QA Wizard Pro User Guide v2017 - Perforce

Loop statements

Loop statementsLoop statements repeat a block of script steps a specific number of times or while a condition is true or false.

Statement Description Moreinformation

Do...LoopUntil

Repeats a block of statements as long as a condition is False or until an ExitDo statement runs.

Do...LoopUntil, page388

Do...LoopWhile

Repeats a block of statements as long as a condition is True or until an ExitDo statement runs. The condition is evaluated at the end of the loop.

Do...LoopWhile, page389

ForEach...Next

Repeats a block of statements once for each element in a group, such as anarray. Not available in the Add Statement dialog box.

ForEach...Next,page 418

For...Next Repeats a block of statements a specified number of times or until an ExitFor statement runs.

For...Next,page 419

While Repeats a block of statements as long as a condition is True or until an ExitWhile statement runs. The condition is evaluated at the beginning of theloop.

While, page592

Math statementsMath statements convert values, return different representations of values, and generate random numbers.

Statement Description Moreinformation

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

Page 364: QA Wizard Pro User Guide v2017 - Perforce

Mouse action statements

Statement Description Moreinformation

SRand Sets the random number generator seed, or starting point, for randomintegers.

SRand, page 554

Sin Returns the sine of a number. Sin, page 553

Mouse action statementsMouse action statements perform actions using the computer's mouse. Most of these actions can beperformed on a specified window or control or at the application level.

Statement Description More information

Click Clicks a control or themouse atthe pointer's current location.

Click, page 367

DoubleClick Double-clicks a control or themouse at the pointer's currentlocation.

DoubleClick, page 390

Hover Moves themouse pointer to acontrol and holds it.

Hover, page 449

LMouseClick Clicks the left mouse button in alocation.

LMouseClick, page 473

LMouseDoubleClick Double-clicks the left mousebutton in a location.

LMouseDoubleClick, page 474

LMouseDown Presses the left mouse button ina location.

LMouseDown, page 475

LMouseUp Releases the left mouse button ina location.

LMouseUp, page 476

MMouseClick Clicks themiddlemouse buttonin a location.

MMouseClick, page 481

MMouseDoubleClick Double-clicks themiddlemousebutton in a location.

MMouseDoubleClick, page 482

MMouseDown Presses themiddlemouse buttonin a location.

MMouseDown, page 483

MMouseUp Releases themiddlemousebutton in a location.

MMouseUp, page 484

340

Page 365: QA Wizard Pro User Guide v2017 - Perforce

Object action statements

Statement Description More information

MouseMove Moves themouse pointer to alocation.

MouseMove, page 486

MouseMoveFromCurrentPosition Moves themouse pointer anumber of pixels from the currentlocation.

MouseMoveFromCurrentPosition,page 487

RMouseClick Clicks the right mouse button in alocation.

RMouseClick, page 521

RMouseDoubleClick Double-clicks the right mousebutton in a location.

RMouseDoubleClick, page 522

RMouseDown Presses the right mouse button ina location.

RMouseDown, page 523

RMouseUp Releases the right mouse buttonin a location.

RMouseUp, page 523

Object action statementsObject 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

Page 366: QA Wizard Pro User Guide v2017 - Perforce

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 statementsOptical character recognition (OCR) statements read graphical text in applications and convert it to textstrings, adjust settings to improve the accuracy of the returned text, and return information about the settingsused during playback.

Statement Description More information

OCRCheckpoint Verifies graphical textagainst an expected valueusing OCR comparison.

OCRCheckpoint, page 491

OCRCheckpointPreviousStatement Verifies graphical text in thescreenshot captured for theaction performed in theprevious statement againstan expected value usingOCR comparison.

OCRCheckpointPreviousStatement,page 493

OCRConvertToGrayscale Converts an image tograyscale before reading itusing OCR.

OCRConvertToGrayscale, page 493

OCRGetContrast Returns the amount of colorcontrast used for OCR.

OCRGetContrast, page 494

OCRGetLanguageFilePath Returns the path to thelanguage file used for OCR.

OCRGetLanguageFilePath, page495

OCRGetScale Returns the image scaleused for OCR.

OCRGetScale, page 496

OCRGetText Returns the text foundusing OCR in a specifiedregion, window, or control.

OCRGetText, page 497

OCRGetTextFromFile Returns the text foundusing OCR in an image file.

OCRGetTextFromFile, page 498

342

Page 367: QA Wizard Pro User Guide v2017 - Perforce

Programming statements

Statement Description More information

OCRGetTextPreviousStatement Returns the text foundusing OCR in thescreenshot captured for theaction performed in theprevious statement.

OCRGetTextPreviousStatement,page 499

OCRIsConvertingToGrayscale Returns True or False toindicate if images areconverted to grayscalebefore reading them usingOCR.

OCRIsConvertingToGrayscale,page 500

OCRSetContrast Sets the amount of colorcontrast in an image beforereading it using OCR

OCRSetContrast, page 501

OCRSetLanguageFilePath Sets the path to thelanguage file to use whenreading an image usingOCR.

OCRSetLanguageFilePath, page502

OCRSetScale Sets the scale of an imagebefore reading itusing OCR.

OCRSetScale, page 503

Programming statementsProgramming 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 usedlater.

Assignment, page 358

Boolean Returns the Boolean representation of a value. Boolean, page 359

CreateGUID Creates and returns a globally unique identifier(GUID) string.

CreateGUID, page 374

CreateObject Creates and returns a COM object instance. CreateObject, page 375

343

Page 368: QA Wizard Pro User Guide v2017 - Perforce

PropertyMap statements

Statement Description More information

EvaluateRegExpression Evaluates a regular expression and returns True orFalse to indicate if it matches a value.

EvaluateRegExpression,page 402

ExternalAssemblyCall Loads a .NET assembly, creates an instance of theclass, and calls the requestedmethod.

ExternalAssemblyCall,page 404

ExternalCall Invokes a public method on an instance of a classloaded by the LoadExternalAssembly statementand returns the value of themethod.

ExternalCall, page 406

GetScriptVariable Returns the value of a variable defined in a calledscript.

GetScriptVariable, page442

IsArray Returns True or False to indicate if an expression isan array.

IsArray, page 457

IsJSONArray Returns True or False to indicate if an expression isa JSONArray type.

IsJSONArray, page 459

IsJSONObject Returns True or False to indicate if an expression isa JSONObject type.

IsJSONObject, page 460

IsJSONType Returns True or False to indicate if an expression isa JSONObject or JSONArray type.

IsJSONType, page 460

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 isnumeric.

IsNumeric, page 462

IsObject Returns True or False to indicate if an expression isa dynamic COM object.

IsObject, page 463

LoadExternalAssembly Returns an instance of a class loaded from a .NETassembly.

LoadExternalAssembly,page 476

ScriptName Returns the name of the running script. ScriptName, page 535

SetScriptVariable Sets the value of a variable defined in a calledscript.

SetScriptVariable, page547

PropertyMap statementsPropertyMap statements return information about PropertyMap object properties.

Statement Description More information

HasProperty Returns True or False to indicate if a property name exists in aPropertyMap.

HasProperty -PropertyMap, page 448

344

Page 369: QA Wizard Pro User Guide v2017 - Perforce

QA Wizard Pro statements

Statement Description More information

Property Returns the value of a property in a PropertyMap or a defaultvalue if the property is not found.

Property - PropertyMap,page 510

Size Returns the number of properties in a PropertyMap. Size, page 554

QA Wizard Pro statementsQAWizard Pro statements control actions performed by QAWizard Pro.

Statement Description More information

Alert Displays amessage in an alert dialog box. Alert, page 355

Beep Plays a beep sound. Beep, page 359

ClearOutput Clears any messages displayed in the Outputpane.

ClearOutput, page 367

General Used to add any statement or function to ascript from the Add Statement dialog box,including advanced statements only availablein Text View.

General, page 422

GetPlaybackSessionName Returns the name set for the playbacksession sent to the QAWizard Pro Server.

GetPlaybackSessionName,page 437

Print Displays amessage in the Output pane. Print, page 508

PrintLn Displays amessage on a new line in theOutput pane.

PrintLn, page 509

SetPlaybackSessionName Sets the name for the playback session sentto the QAWizard Pro Server.

SetPlaybackSessionName,page 546

Script control statementsScript control statements control how QAWizard Pro interacts with applications and runs scripts.

Statement Description More information

Exit Exits the Do, While, For, Select, Function, and Substatements.

Exit, page 403

GetDiagnostics Returns True or False to indicate if playback diagnosticinformation logging is enabled.

GetDiagnostics, page427

RunScriptRemote Runs a script on a remote computer. RunScriptRemote,page 526

345

Page 370: QA Wizard Pro User Guide v2017 - Perforce

Stress statements

Statement Description More information

Script.CallScript Runs another script in the workspace and then returnsto the current script.

Script.CallScript, page528

Script.GetLineNumber Returns the current line number for the script. Script.GetLineNumber,page 531

SetDiagnostics Enables or disables playback diagnostic informationlogging to help with troubleshooting if QA Wizard Procannot identify a control.

SetDiagnostics, page542

Stress statementsStress statements simulate stress conditions in the target application.

Statement Description More information

DisableNetworking Disables all networkadapters and returns thenumber of adapterssuccessfully disabled.

DisableNetworking, page 387

EnableNetworking Enables all network adaptersdisabled by theDisableNetworkingstatement and returns thenumber of adapterssuccessfully enabled.

EnableNetworking, page 393

SimulateDriveReadOnly Simulates a read-only drive. SimulateDriveReadOnly, page 551

SimulateDriveRemainingSpace Simulates a drive withremaining free space.

SimulateDriveRemainingSpace,page 551

SimulateMemoryPerAllocationLimit Simulates themaximumamount of memory availableto the application for eachallocation attempt.

SimulateMemoryPerAllocationLimit,page 552

SimulateMemoryRemainingSpace Simulates memory with anamount of remaining freespace.

SimulateMemoryRemainingSpace,page 552

String statementsString statements convert and query strings and return values.

346

Page 371: QA Wizard Pro User Guide v2017 - Perforce

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 asubstring.

ContainsSubStr,page 372

DecimalSeparator Returns the decimal separator based on regional settings. DecimalSeparator,page 384

DecryptString Decrypts an encrypted text string and returns it in plaintext.

DecryptString, page384

EncryptString Encrypts a text string. EncryptString, page394

EndsWithSubStr Returns True or False to indicate if a string ends with asubstring.

EndsWithSubStr,page 394

FindSubStr Returns the index of the first occurrence of a substring in astring.

FindSubStr, page 417

Format Returns a formatted string using values from an array. Format, page 420

Left Returns a number of characters from the beginning of astring.

Left, page 472

Length Returns the number of characters in a string. Length, page 473

Lower Converts characters in a string to lowercase and returnsthe string.

Lower, page 477

MakeRegExpression Returns a regular expression built from a string. MakeRegExpression,page 477

MakeURL Returns a full URL constructed by combining a root URLand a component.

MakeURL, page 478

Mid Returns a number of characters starting with a position ina string.

Mid, page 479

ParseString Returns an array of substrings from an original delimitedstring.

ParseString, page506

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 asubstring.

StartsWithSubStr,page 555

Str Converts a value and returns it as a string. Str, page 557

347

Page 372: QA Wizard Pro User Guide v2017 - Perforce

System statements

Statement Description More information

StrCompare Returns an integer to indicate if two strings match or thestring sorted first based on alphabetical order comparison.

StrCompare, page557

StrEquals Returns True or False to indicate if two strings match. StrEquals, page 558

Trim Returns a string with the leading and trailing spacesremoved.

Trim, page 564

Upper Converts characters to uppercase and returns the string. Upper, page 566

System statementsSystem statements return values from the test computer operating system or browsers.

Statement Description More information

ComputerName Returns the name of the computer running thescript.

ComputerName, page 372

GetBrowserVersion Returns the browser version running the script. GetBrowserVersion, page423

GetEnv Returns the value of an environment variablefrom Windows or QAWizard Pro.

GetEnv, page 431

GetMouseXCoordinate Returns the X coordinate of themouse pointerrelative to the screen or a window or control.

GetMouseXCoordinate,page 435

GetMouseYCoordinate Returns the Y coordinate of themouse pointerrelative to the screen or a window or control.

GetMouseYCoordinate,page 435

GetScreenHeight Returns the test computer's screen height. GetScreenHeight, page441

GetScreenWidth Returns the test computer's screen width. GetScreenWidth, page 441

GetWindowsVersion Returns the concatenated string representationof theWindows version and installed servicepack.

GetWindowsVersion, page446

Is64BitWindows Returns True or False to indicate if theWindows version is 64-bit.

Is64BitWindows, page 457

ReadRegistryEntry Returns the value associated with a name in aregistry key.

ReadRegistryEntry, page512

RunBackgroundCommand Runs a command from theWindows commandprompt on the test computer as playbackcontinues.

RunBackgroundCommand,page 524

348

Page 373: QA Wizard Pro User Guide v2017 - Perforce

Timing statements

Statement Description More information

RunCommand Runs a command from theWindows commandprompt on the test computer and returns theexit code when it finishes.

RunCommand, page 525

UserName Returns the username of the current userlogged in toWindows on the computer runningthe script.

UserName, page 567

WriteRegistryEntry Sets a registry key value on the test computer. WriteRegistryEntry, page592

Timing statementsTiming statements control the stopwatch and return elapsed time values.

Statement Description More information

Delay Pauses script playback for anumber of millisecondsbefore continuing.

Delay, page 385

GetStopwatchElapsedMilliseconds Returns the elapsedstopwatch time inmilliseconds.

GetStopwatchElapsedMilliseconds,page 443

GetStopwatchElapsedTime Returns the elapsedstopwatch time inHH:MM:SS:mm format.

GetStopwatchElapsedTime, page443

ResetStopwatch Resets the elapsedstopwatch time to zero.

ResetStopwatch, page 520

StartStopwatch Starts or restarts thestopwatch tomeasureelapsed time.

StartStopwatch, page 555

StopStopwatch Stops the stopwatch withoutresetting it.

StopStopwatch, page 556

Touch action statementsTouch action statements perform tap, swipe, and pinch zoom actions in scripts that test Windows 8applications or any applications that can interpret touch actions.

Statement Description More information

TouchDown Performs a touch action in a location. TouchDown, page 562

349

Page 374: QA Wizard Pro User Guide v2017 - Perforce

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 statementsWeb statements perform actions on and return values from HTML elements.

Statement Description More information

ExtractHTML Captures HTML in a web page and saves itto a text file.

ExtractHTML, page 407

ExtractHTMLToString Returns HTML from a browser window asa string.

ExtractHTMLToString, page407

FindColumnByRowIndex Returns a column index for a table celllocated using the row index andproperty/expected value pairs.

FindColumnByRowIndex,page 415

FindRowByColumnIndex Returns a row index for a table cell locatedusing the column index andproperty/expected value pairs.

FindRowByColumnIndex,page 416

GetControlFromTable Returns a control from anHTML table. Notavailable in the Add Statement dialog box.

GetControlFromTable, page424

GetControlFromXPathQuery Returns the first HTML element thatmatches an XPath query.

GetControlFromXPathQuery,page 425

HTMLFindByID Returns a string that contains the inner textof the tag with an HTML element ID.

HTMLFindByID, page 450

HTMLFindByTag Returns an array of strings that contain theinner text from anHTML element tag.

HTMLFindByTag, page 451

PerformXPathQuery Returns an array of results that match anXPath query.

PerformXPathQuery, page506

Web browser action statementsWeb 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

Page 375: QA Wizard Pro User Guide v2017 - Perforce

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 statementsWindow action statements perform actions on application windows.

Statement Description Moreinformation

Close Closes a window. Close, page 368

Drag Drags a window to a location based on X and Y coordinates relative to theparent window.

Drag, page 391

Help Displays help for a window. Help, page 448

Maximize Maximizes a window. Maximize, page479

Minimize Minimizes a window to a button on theWindows taskbar. Minimize, page481

Resize Resizes a window. Resize, page520

Restore Restores a window to its default size and location. Restore, page520

# (Outline Block)

Note: This statement is namedOutline Block in the Add Statement dialog box.

Organizes script lines in collapsible groups.

Outline blocks helpmake longer scripts easier to read and can be expanded or collapsed in Text View andKeyword View. When collapsed, only the first line is displayed. Optionally include a comment in the first lineof the block to summarize the grouped steps. See Cleaning up scripts, page 150.

351

Page 376: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxAbs(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.

Examplenumber = Abs(-42.5)

PrintLn number

AddFileAttachmentAttaches a file to a Helix ALM issue.

Note: This statement cannot be used in load test scripts.

352

Page 377: QA Wizard Pro User Guide v2017 - Perforce

AddIssue

SyntaxAddFileAttachment(Issue, "FilePath")

Arguments

Argument Description

Issue Issue object to attach the file to. Use the NewIssue, page 490 statement to create the issueobject.

FilePath Full path to the file to attach.

Exampleissue = 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 issueSummary, Description, Steps to Reproduce, andOther Hardware and Software fields.

This statement is commonly used with an If statement to add issues to Helix ALM if a condition that causesthe script to fail is not met. Use the INDEBUGMODE variable if you are running scripts in debugmode and donot 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 createmore detailed issues and work with specific issuefield values. See AddFileAttachment, page 352, AddToHelixALM, page 354, GetFieldValue, page 431,RemoveField, page 517, and SetFieldValue, page 542.

SyntaxAddIssue("Summary", "Description", "StepsToReproduce", "OtherHardwareAndSoftware")

353

Page 378: QA Wizard Pro User Guide v2017 - Perforce

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 issueOther Hardware and Software field.

ExamplenumProducts = Window("BugReporter").ComboBox("comboboxProduct").Property("Number ofItems")

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 theworkspace 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, andOther Hardware and Software fields and add it to the Helix ALM projectat the same time.

Note: This statement cannot be used in load test scripts.

SyntaxAddToHelixALM(Issue)

Arguments

Argument Description

Issue Issue object to add to the Helix ALM project. Use the NewIssue, page 490 statement tocreate the issue object.

Exampleissue = NewIssue()

' Adds the issue to Helix ALM

AddToHelixALM(issue)

354

Page 379: QA Wizard Pro User Guide v2017 - Perforce

Alert

You can also call this statement directly on a Helix ALM issue object.issue = NewIssue()

issue.AddToHelixALM()

AlertDisplays amessage in an alert dialog box. The tester must click the OK button to close the dialog box andcontinue running the script.

Note: Do not use this statement in scripts that run unattended becausemanual intervention is required.

SyntaxAlert("Message")

Arguments

Argument Description

Message Message to display.

ExampleAlert("The Go button is disabled.")

AppendToFileAppends 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 anotherapplication to use it for other purposes.

Note: Issues may occur when using this statement in load test scripts.

SyntaxAppendToFile("FilePath", "Text", Encoding)

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation 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, page600.

355

Page 380: QA Wizard Pro User Guide v2017 - Perforce

ArrayClear

ExampleAppendToFile("C:\\Testing\\Output.txt", "Value added to Product table",EncodingAutoDetect)

ArrayClearClears an array.

SyntaxArrayClear(Array)

Arguments

Argument Description

Array Array name.

ExampleArrayClear(listValues)

ArraySizeReturns the size of an array in a dimension (1, 2, or 3).

SyntaxArraySize(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.

ExampleitemList = Window("BugReporter").ComboBox("comboboxType").Property("ListItems")

count = ArraySize(itemList, 1)

For x = 1 To count

curItemText = itemList(x)

356

Page 381: QA Wizard Pro User Guide v2017 - Perforce

ArrayToJSONArray

Window("BugReporter").ComboBox("comboboxType").Item(curItemText).Select()

Next

ArrayToJSONArrayConverts an array to a JSONArray and returns it.

SyntaxArrayToJSONArray(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.

Exampledim 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)

ASCIIReturns the ASCII value of a character.

SyntaxAscii("Character")

Arguments

Argument Description

Character Character to return the ASCII value for.

357

Page 382: QA Wizard Pro User Guide v2017 - Perforce

Assignment

Return value

Value Description

Value ASCII value of the character.

ExampleasciiValue = Ascii("*")

PrintLn asciiValue

AssignmentDeclares a variable and a value that can be used later. Variables store a value that can be used throughout ascript. Using variables can help you createmore flexible scripts because the data can change as theapplication changes. See Declaring variables in Text View, page 29 for information.

SyntaxVariable = Value

Arguments

Argument Description

Variable Variable name.

Value Numeric or string literal, expression, function, variable, or datasheet value.

ExampleloginName = ("Administrator")

Window("WysiCRM").EditBox("textBoxUser").SetText(loginName)

BackNavigates back to the previous page in a browser.

SyntaxBack()

Supported objects

Browser

ExampleBrowser("WysiCorp Report a Bug").Back()

358

Page 383: QA Wizard Pro User Guide v2017 - Perforce

Beep

BeepPlays a beep sound.

SyntaxBeep(Frequency, Duration)

Arguments

Argument Description

Frequency Beep tone frequency in hertz.

Duration Length of beep inmilliseconds.

ExampleBeep(100, 5000)

BooleanReturns 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, QAWizard Pro tries to convert the value to a number.

Object Converts to strings before evaluated.

Null Converts to 0 and returns False.

SyntaxBoolean(Value)

Arguments

Argument Description

Value Value to represent as a Boolean.

359

Page 384: QA Wizard Pro User Guide v2017 - Perforce

BoundaryChecks

Return value

Value Description

True Valuematches True for the data type.

False Valuematches 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)

BoundaryChecksActivates or inactivates boundary checking for mouse coordinates. Boundary checking prevents usingcoordinates outside a control's boundary. If boundary checking is on, mouse actions that attempt to gooutside the control's boundary cause the script to fail.

SyntaxBoundaryChecks(True/False)

Arguments

Argument Description

True/False True activates boundary checking and False deactivates it.

ExampleBoundaryChecks(False)

CaptureScreenshotCaptures a screenshot after a statement runs and saves it as a PNG file.

360

Page 385: QA Wizard Pro User Guide v2017 - Perforce

Case

Note: Scripts fail if you do not create the directory to save screenshots in before they are saved duringplayback.

SyntaxCaptureScreenshot(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 screenshotis saved in the <WORKSPACEDIR>\Screenshots directory by default. If this argument isnot used, the screenshot is saved in the workspace directory as <ScriptName_CurrentTimeStamp>.png.

ExampleCaptureScreenshot(False, "C:\\Testing\\Failures\\LoginWindow.png")

CaseContains a value that is compared to the resulting value of an expression in a Select...Case, page 536statement. If the values match, statements in the Case block run.

Note: Case statements cannot havemultiple delimited values. Only define one value per Casestatement.

SyntaxSelect 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.

ExampleSRand()

random = Rand(1, 3)

Select Case random

361

Page 386: QA Wizard Pro User Guide v2017 - Perforce

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

CellReturns 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, usethe 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.

Examplecomponent = Cell("component")

Window("BugReporter").Editbox("editboxComponent").SetText(component)

CheckExistsVerifies a window or control exists in the application. If the window or control is not found, the script fails orcontinues and displays amessage in the Errors pane.

SyntaxCheckExists(FailureBehavior, "Warning")

362

Page 387: QA Wizard Pro User Guide v2017 - Perforce

Checkpoint

Arguments

Argument Description

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays awarning 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

ExampleWindow("BugReporter").Label("labelProduct").CheckExists(True, "Product label notdisplayed")

CheckpointVerifies the value of a window or control property matches an expected value. If the values do not match, thescript fails or continues and displays amessage in the Errors pane.

Checkpoints can validate both visual and non-visual properties. For example, you can check that a windowincludes specific title bar buttons. See Using Checkpoints, page 165.

Note: Use theOCRCheckpoint, page 491 statement to verify graphical text against an expected value.

SyntaxCheckpoint("PropertyName", ExpectedValue, FailureBehavior, "Warning")

Arguments

Argument Description

PropertyName Name of the property to check. You can view a list of all properties captured for thewindow or control when it was added to the application repository in the Properties dialogbox. SeeModifying window and control properties, page 122.

ExpectedValue Value to check.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays awarning 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

Page 388: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleWindow("WysiCorp Login").Button("buttonLogin").Checkpoint("Text", "Login", True, "Buttontext is incorrect")

CheckpointExpressionVerifies if the value returned by an expression is True. Use to verify expressions that return True/False ornumeric values.

SyntaxCheckpointExpression(Expression, FailureBehavior, "Warning")

Arguments

Argument Description

Expression Expression to check.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displays awarning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpoints fail.

ExampleCheckpointExpression(FileSize("Output.txt") > 1000, False, "File is too big")

CheckpointImageVerifies an image in an applicationmatches an expected image.

This statement compares the screenshot captured for the action performed in the previous statement with anexpected image. If it does not match the expected image to a specified accuracy percentage, the script failsor continues and displays amessage in the Errors pane. For example, if the accuracy percentage is 84% andthe accuracy calculated during playback is 80%, the checkpoint fails. See Creating image checkpoints, page173.

364

Page 389: QA Wizard Pro User Guide v2017 - Perforce

CheckpointStringExists

SyntaxCheckpointImage(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. Falsedisplays a warning and continues playback. If not specified, True is used.

Warning Optional message to display in the Errors pane and run report when checkpointsfail.

ExampleCheckpointImage(90, "C:\\Testing\\Images\\logo.png", 2, 0, 318, 205, False, "Image isincorrect")

CheckpointStringExistsVerifies that a substring exists in a text string. If the substring is not found, the script fails and displays amessage in the Errors pane.

This statement can be used to verify data returned from theWebGet, page 574 andWebPost, page 581statements in load test scripts.

SyntaxCheckpointStringExists("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

Page 390: QA Wizard Pro User Guide v2017 - Perforce

CheckpointStringNotExists

Exampleresult = WebGet("/loginpage.php", "user", "Guest")

CheckpointStringExists(result, "success")

CheckpointStringNotExistsVerifies that a substring does not exist in a text string. If the substring is found, the script fails and displays amessage in the Errors pane.

This statement can be used to verify data returned from theWebGet, page 574 andWebPost, page 581statements in load test scripts.

SyntaxCheckpointStringNotExists("TextToSearch", "TextToSearchFor")

Arguments

Argument Description

TextToSearch String to search in.

TextToSearchFor Substring to search for in the TextToSearch string. The search is case sensitive.

Exampleresult = WebGet("/loginpage.php", "user", "Guest")

CheckpointStringNotExists(result, "Server error")

Chr

Note: This statement is namedCharacter in the Add Statement dialog box.

Returns the character representation of a Unicode value.

SyntaxChr(UnicodeValue)

Arguments

Argument Description

UnicodeValue Unicode value to convert.

Return value

Value Description

Value Converted Unicode character.

366

Page 391: QA Wizard Pro User Guide v2017 - Perforce

Clear

Examplechar = Chr(37)

PrintLn char

Clear

Note: This statement is namedClear Check Box in the Add Statement dialog box.

Clears a check box control.

SyntaxClear()

Supported objects

CheckBox

ExampleWindow("AutoComplete Passwords").CheckBox("checkboxRemember").Clear()

ClearOutputClears any messages displayed in the Output pane.

SyntaxClearOutput()

ExampleAlert("Start the server")

PrintLn("Server is started")

Delay(10000)

ClearOutput()

ClickClicks a control or themouse at the pointer's current location.

SyntaxClick()

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

Page 392: QA Wizard Pro User Guide v2017 - Perforce

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()

CloseCloses a window. Performs the same action as clicking the Close button in the application title bar.

SyntaxClose()

Supported objects

Browser, Window

ExampleWindow("AddItem").Close()

CloseTabCloses the active tab or a specified tab in a browser.

SyntaxCloseTab("TabText")

Arguments

Argument Description

TabText Tab name. If not specified, the tab last used during playback is closed.

Supported objects

Browser

ExampleBrowser("Report a Bug").CloseTab("Bug Report")

CollapseCollapses an expanded node, or item, in a tree control.

368

Page 393: QA Wizard Pro User Guide v2017 - Perforce

CombinePaths

Note: This statement is not added to recorded scripts. You can use this statement in scripts, but it isgenerally not needed.

SyntaxCollapse("Item")

Arguments

Argument Description

Item Node to collapse.

Keyword View notes

The node to collapse is displayed in the Information column.

Supported objects

Tree

ExampleWindow("WysiCorp CRM").Tree("treeViewProducts").Collapse("ALM Solutions/Solution Design")

CombinePathsCombines two directory paths into one and returns the combined path. Adds a backslash between the baseand relative directories.

SyntaxCombinePaths("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 thesecond path argument is an absolute path, the absolute path is returned.

ExampleFullPath = CombinePaths("C:\\Testing", "TestData")

369

Page 394: QA Wizard Pro User Guide v2017 - Perforce

CommitRecordsetRow

CommitRecordsetRowAdds a data row to the current recordset. The recordset must be opened with OpenRecordset, page 504 orOpenRecordsetQuery, page 505.

To change one field in a recordset, use the SetRowValue, page 547 statement.

Note: To add or update a row in aMicrosoft Access, Oracle, or SQL Server datasheet, a primary key mustbe defined. To add or update a row in aMicrosoft Excel datasheet, Excel must be installed on thecomputer running the script. If a primary key is not defined or Excel is not installed, QAWizard Pro opensthe recordset as read-only.

SyntaxCommitRecordsetRow(DataRow)

Arguments

Argument Description

DataRow New row to add to the recordset or datasheet.

Examplebugs = OpenRecordset("WysiCorp Bugs")

row = CreateRecordsetRow(bugs)

SetRowValue(row, "Summary", "Performance is slow")

SetRowValue(row, "Severity", "No Workaround")

CommitRecordsetRow(row)

CompareFileContentsReturns True or False to indicate if two files are identical.

SyntaxCompareFileContents("FirstFile", "SecondFile")

Arguments

Argument Description

FirstFile Full path to the first file. See Identifying files and directories in statements, page 156 forinformation 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 forinformation about configuring full paths relative to the workspace or script directory.

370

Page 395: QA Wizard Pro User Guide v2017 - Perforce

CompareImage

Return value

Value Description

True File contents are identical.

False File contents are different.

ExampleIf (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

CompareImageReturns True or False to indicate if an application image captured during playback matches an expectedimage within an accuracy percentage.

SyntaxCompareImage(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 areamatch within the accuracy percentage.

False Contents of image area do not match within the accuracy percentage.

371

Page 396: QA Wizard Pro User Guide v2017 - Perforce

ComputerName

ExampleimageResult = CompareImage(100, "C:\\Testing\\Images\\logo.png", 0, 0, 797, 578)

ComputerNameReturns the name of the computer running the script.

SyntaxComputerName()

Return value

Value Description

Value Computer name.

ExamplePrintLn ComputerName

ContainsSubStr

Note: This statement is namedContains Substring in the Add Statement dialog box.

Returns True or False to indicate if a string contains a substring.

SyntaxContainsSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

IsCaseSensitive Case sensitive search. Truematches the substring case. False ignores the case. If notspecified, True is used.

Return value

Value Description

True String contains the substring.

False String does not contain the substring.

372

Page 397: QA Wizard Pro User Guide v2017 - Perforce

CopyFile

ExampleproductName = Window("Bug Reporter").HTMLElement("elementProductName").Property("InnerText")

CheckpointExpression(ContainsSubStr(productName, "Report", True), True, "Product namedoes not contain Report")

CopyFileCopies a file to a new location.

SyntaxCopyFile("SourcePath", "DestinationPath", Overwrite)

Arguments

Argument Description

SourcePath Full path to the file to copy. See Identifying files and directories in statements, page 156for 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 differentfilename than the source, the file is copied and renamed in the new location. If thefilename is not included, the source filename is used. See Identifying files anddirectories in statements, page 156 for information about configuring full paths relative tothe workspace or script directory.

Overwrite Overwrite behavior. True overwrites existing files in the destination directory. Falsedoes not overwrite files. If is not specified, False is used.

ExampleCopyFile("C:\\Testing\\Output.txt", "C:\\TestDocuments\\DataSource\\", False)

Cos

Note: This statement is namedCosine in the Add Statement dialog box.

Returns the cosine of a number.

SyntaxCos(Number)

Arguments

Argument Description

Number Number to return the cosine for. To convert degrees to radians, multiply by pi/180. To convertradians to degrees, multiply by 180/pi.

373

Page 398: QA Wizard Pro User Guide v2017 - Perforce

CreateDirectory

Return value

Value Description

Value Cosine of the number.

Examplecosine = Cos(345)

PrintLn cosine

CreateDirectoryCreates a directory and subdirectories in a path.

SyntaxCreateDirectory("DirectoryPath")

Arguments

Argument Description

DirectoryPath Full path to the directory to create. All directories in the specified path are created if theydo not exist. See Identifying files and directories in statements, page 156 for informationabout configuring full paths relative to the workspace or script directory.

ExampleCreateDirectory("C:\\Testing\\WysiCorp\\Tests\\Output")

CreateGUIDCreates and returns a globally unique identifier (GUID) string.

SyntaxCreateGUID()

Return value

Value Description

Value GUID string.

ExampleTry

Script.CallScript("ComplicatedScript")

Catch

374

Page 399: QA Wizard Pro User Guide v2017 - Perforce

CreateObject

fileName = CreateGUID() + ".log"

AppendToFile(fileName, Err.Description, EncodingAutoDetect)

PrintLn("Created log file: " + fileName)

End Try

CreateObjectCreates and returns a COM object instance.

SyntaxCreateObject("COM ProgID", "ServerName")

Arguments

Argument Description

COMProgID 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.

Exampleapp = CreateObject("Excel.Application")

PrintLn app.Version

CreateRecordsetRowReturns 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 notdefined, QAWizard Pro opens the table as read-only.

SyntaxCreateRecordsetRow(Recordset)

Arguments

Argument Description

Recordset Recordset name to add the row to. Must be opened with OpenRecordset, page 504 orOpenRecordsetQuery, page 505.

375

Page 400: QA Wizard Pro User Guide v2017 - Perforce

CreateTempFile

Return value

Value Description

Value Empty data row.

Examplebugs = OpenRecordset("WysiCorp Bugs")

row = CreateRecordsetRow(bugs)

SetRowValue(row, "Summary", "Performance is slow")

SetRowValue(row, "Severity", "No Workaround")

CommitRecordsetRow(row)

CreateTempFileCreates an empty temporary file and returns the full path. The file is stored in the temp folder on the testcomputer hard drive and is not automatically deleted.

SyntaxCreateTempFile()

Return value

Value Description

Value Full path to the empty temporary file.

ExampletempFile = 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

DateReturns the date in MM/DD/YYYY format based on integers that represent the year, month, and day.

376

Page 401: QA Wizard Pro User Guide v2017 - Perforce

DateAdd

SyntaxDate(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.

ExampledateCreated = Date(2016, 5, 14)

Window("BugReporter").Editbox("editboxCreatedDate").SetText(dateCreated)

DateAddAdds a time to a date/time value and returns the resulting value in the short date and time format used on thetest computer. Formatting depends on the operating system's regional settings.

SyntaxDateAdd("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

Page 402: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleNewDate = DateAdd("m", 1, "3-July-2016")

DateDiffReturns the difference between two date/time values based on an interval type.

SyntaxDateDiff("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

Page 403: QA Wizard Pro User Guide v2017 - Perforce

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

QAWizard Pro counts interval types using the followingmethods:

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 onlycounted if it is a Sunday.

n q counts the number of quarter starts. For example, January 1, April 1, July 1, andOctober 1.

n Parts of years, quarters, andmonths more specific than the interval type are excluded before thecalculation is performed. For example, the difference between December 31, 2015 11:59:59 PM andJanuary 1, 2016 12:00:00 AMmeasured in years, quarters, or months all return 1, even though the actualelapsed time is one second.

Return value

Value Description

Value Difference between two date/time values based on the interval.

ExamplenumDays = DateDiff("d", "3 Feb 1962", Now())

DatePartReturns a part from a date/time value as an integer.

379

Page 404: QA Wizard Pro User Guide v2017 - Perforce

DateTime

SyntaxDatePart("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.

ExampleDayOfYear = DatePart("y", Now())

DateTimeReturns the date and time inMM/DD/YYYY hh:mm:ss format based on integers that represent the year,month, day, hour, minute, and second.

380

Page 405: QA Wizard Pro User Guide v2017 - Perforce

DateTimeFormat

SyntaxDateTime(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 inMM/DD/YYYY hh:mm:ss format.

ExampledateCreated = DateTime(2016, 5, 14, 2, 30, 00)

Window("BugReporter").Editbox("editboxCreatedDate").SetText(dateCreated)

DateTimeFormatReturns the date or time in a specified format.

SyntaxDateTimeFormat("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

Page 406: QA Wizard Pro User Guide v2017 - Perforce

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 Yearmonth 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

Page 407: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleDim arrayValues(1)

arrayValues(1) = Now()

var = DateTimeFormat("{0:h:mm:ss tt}", arrayValues(1))

PrintLn(var)

DayReturns the day from a date/time value.

SyntaxDay("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

Page 408: QA Wizard Pro User Guide v2017 - Perforce

DecimalSeparator

ExampledayMonth = Day("October 25, 2016")

PrintLn("Day of the month is: " + dayMonth)

DecimalSeparatorReturns the decimal separator based on regional settings. The separator is the symbol that marks theboundary between the integer and fraction parts of a decimal number.

SyntaxDecimalSeparator()

Return value

Value Description

Value Decimal separator.

ExampleretValue = DecimalSeparator()

PrintLn retValue

DecryptStringDecrypts an encrypted text string and returns it in plain text. Passwords are automatically encrypted duringrecording, but some text may have beenmanually encrypted using the Text Encryption dialog box or theEncryptString statement to make it unreadable. See Encrypting text, page 162.

Note: Literal encrypted text strings are automatically decrypted when scripts run.

SyntaxDecryptString("EncryptedString")

Arguments

Argument Description

EncryptedString Text string to decrypt.

Return value

Value Description

Value Decrypted string in plain text.

384

Page 409: QA Wizard Pro User Guide v2017 - Perforce

Delay

Examplepasswords = OpenRecordset("Passwords")

encryptedPassword = GetRowValue(passwords, "Password")

Window("Login").EditBox("editboxPassword").SetText(DecryptString(encryptedPassword))

DelayPauses script playback for a number of milliseconds before continuing. For example, you can use thisstatement if you are testing a client/server application that requires the server to be running before the clientand the server takes a few seconds to start.

SyntaxDelay(Time)

Arguments

Argument Description

Time Number of milliseconds to pause playback before it continues.

ExampleDelay(5000)

DeleteDirectoryDeletes a directory.

SyntaxDeleteDirectory("DirectoryPath", Recursive)

Arguments

Argument Description

DirectoryPath Full path to the directory to delete. See Identifying files and directories in statements, page156 for information about configuring full paths relative to the workspace or scriptdirectory.

Recursive Recursive deletion. True deletes all subdirectories and files. False deletes only thespecified directory, whichmust be empty. If not specified, False is used.

ExampleDeleteDirectory("C:\\Testing\\TestData", True)

385

Page 410: QA Wizard Pro User Guide v2017 - Perforce

DeleteFile

DeleteFileDeletes a file. For example, use this statement at the beginning of a script to delete a file created the last timethe 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.

SyntaxDeleteFile("FilePath")

Arguments

Argument Description

FilePath Full path to the file to delete. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

ExampleDeleteFile("C:\\Testing\\results.txt")

DeleteRecordsetRowDeletes the current row from a recordset. When a row is deleted, the rows after it move up to fill the emptyindex. If the last row is deleted, the active row is at RecordsetEOF.

Note: To delete a row from aMicrosoft Access, Oracle, or SQL Server datasheet, a primary key must bedefined. To delete a row from aMicrosoft Excel datasheet, Excel must be installed on the computerrunning the script. If a primary key is not defined or Excel is not installed, QAWizard Pro opens therecordset as read-only.

SyntaxDeleteRecordsetRow(Recordset)

Arguments

Argument Description

Recordset Recordset name to delete the row from. Must be opened with OpenRecordset, page 504 orOpenRecordsetQuery, page 505.

Examplebugs = OpenRecordset("WysiCorp Bugs")

NextRow(bugs)

DeleteRecordsetRow(bugs)

386

Page 411: QA Wizard Pro User Guide v2017 - Perforce

DirectoryExists

DirectoryExistsReturns True or False to indicate if a directory exists.

SyntaxDirectoryExists("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 scriptdirectory.

Return value

Value Description

True Directory exists.

False Directory does not exist.

ExampleIf (DirectoryExists("C:\\Testing\\TestDocuments") = True) Then

PrintLn("Directory exists")

Else

PrintLn("Directory does not exist")

End If

DisableNetworkingDisables 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 anetwork 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 theEnableNetworking, page 393 statement is called.

Note: If a script disables networking, email notifications are still sent when network communication isrestored. See Setting email notification options, page 44.

SyntaxDisableNetworking()

387

Page 412: QA Wizard Pro User Guide v2017 - Perforce

Do...Loop Until

Return value

Value Description

Value Number of network adapters disabled.

ExampleDisableNetworking()

Window("Setup Connection").Button("Test Connection").Click()

Window("Error").Button("OK").Click()

Do...Loop UntilRepeats 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 isevaluated. If the condition is False, statements in the loop repeat. If the condition is True, statements in theloop do not repeat and playback continues.

Tip: Use the Do...LoopWhile, page 389 statement to repeat a block of statements while a condition isTrue.

SyntaxDo

[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

Page 413: QA Wizard Pro User Guide v2017 - Perforce

Do...Loop While

Note: Use the Exit, page 403 statement to exit the loop and continue playback with the first statementoutside of the loop.

Keyword View notes

The condition to evaluate is displayed in the Information column.

ExampleproductCount = 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 WhileRepeats 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 isevaluated. If the condition is True, statements in the loop repeat. If the condition is False, statements in theloop do not repeat and playback continues.

Tip: Use the Do...Loop Until, page 388 statement to repeat a block of statements while a condition isFalse.

SyntaxDo

[Statements]

[Exit Do]

[Statements]

Loop While [Condition]

You can also use this syntax:Do While [Condition]

[Statements]

[Exit Do]

[Statements]

Loop

389

Page 414: QA Wizard Pro User Guide v2017 - Perforce

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 statementoutside of the loop.

Keyword View notes

The condition to evaluate is displayed in the Information column.

ExampleproductCount = 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()

DoubleClickDouble-clicks a control or themouse at the pointer's current location.

SyntaxDoubleClick()

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

Page 415: QA Wizard Pro User Guide v2017 - Perforce

Drag

MouseMoveFromCurrentPosition(50, 10)

DoubleClick()

DragDrags a window to a location based on X and Y coordinates relative to the parent window.

SyntaxDrag(xCoordinate, yCoordinate)

Arguments

Argument Description

xCoordinate X coordinate for the horizontal pixel location tomove the window to relative to the parentwindow.

yCoordinate Y coordinate for the vertical pixel location tomove the window to relative to the parentwindow.

Supported objects

Browser, Window

ExampleWindow("WysiCorp CRM").Drag(20, 30)

DragToDrags an HTML link or element to a location.

SyntaxDragTo(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

ExampleWindow("Feedback Acknowledgment").HTMLLink("linkCompany").DragTo(20, 30)

391

Page 416: QA Wizard Pro User Guide v2017 - Perforce

Else

ElseRuns 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.

SyntaxIf 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.

ExamplecurrentHour = 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

ElseIfA combination of If, page 451 and Else, page 392 statements. ElseIf behaves like an If statement in another Ifstatement.

When an If statement evaluates to False, the ElseIf statement can evaluate an alternate condition and run adifferent block of statements if the alternate condition is True. An If statement can include several ElseIfstatements.

Tip: The Select...Case, page 536 statement is similar to the ElseIf statement andmay be easier to usewhen evaluating a condition with several possible results.

SyntaxIf Condition Then

392

Page 417: QA Wizard Pro User Guide v2017 - Perforce

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.

ExamplecurrentHour = 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

EnableNetworkingEnables all network adapters disabled by the DisableNetworking, page 387 statement and returns the numberof adapters successfully enabled.

SyntaxEnableNetworking()

Return value

Value Description

Value Number of network adapters enabled.

393

Page 418: QA Wizard Pro User Guide v2017 - Perforce

EncryptString

ExampleEnableNetworking()

Window("Setup Connection").Button("Test Connection").Click()

Window("Succeeded").Label("succeededLabel").CheckExists()

Window("Succeeded").Button("OK").Click()

EncryptStringEncrypts a text string. Use to conceal sensitive text entered in fields, such as passwords.

To decrypt encrypted text, use the DecryptString statement.

SyntaxEncryptString("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.

SyntaxEndsWithSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

IsCaseSensitive Case sensitive search. Truematches the substring case. False ignores the case. If notspecified, True is used.

394

Page 419: QA Wizard Pro User Guide v2017 - Perforce

Err.CallStack

Return value

Value Description

True String ends with the substring.

False String does not end with the substring.

ExampleproductName = Window("Bug Reporter").HTMLElement("elementProductName").Property("InnerText")

CheckpointExpression(EndsWithSubStr(productName, "Reporter", True), True, "Product namedoes 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 erroroccurred. Use to generate output that is helpful when debugging scripts.

SyntaxCallStack()

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

Page 420: QA Wizard Pro User Guide v2017 - Perforce

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 namedClear Error in the Add Statement dialog box.

Clears error information from the Err object.

SyntaxClear()

Supported objects

Err

ExampleIf 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 togenerate output that is helpful when debugging scripts.

SyntaxDescription()

Supported objects

Err

396

Page 421: QA Wizard Pro User Guide v2017 - Perforce

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 debuggingscripts.

SyntaxLineNumber()

Supported objects

Err

Return value

Value Description

Value Script line number where the error occurred.

Example'Captures errors from regression test suite

Try

397

Page 422: QA Wizard Pro User Guide v2017 - Perforce

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 whendebugging scripts.

SyntaxLineText()

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

Page 423: QA Wizard Pro User Guide v2017 - Perforce

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. Useto generate output that is helpful when debugging scripts.

SyntaxNumber()

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

Page 424: QA Wizard Pro User Guide v2017 - Perforce

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 namedRaise 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.

SyntaxRaise(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

ExampleFunction 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

Page 425: QA Wizard Pro User Guide v2017 - Perforce

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 debuggingscripts.

SyntaxScriptName()

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.

SyntaxSource()

401

Page 426: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxEvaluateRegExpression("RegularExpression", "Value")

402

Page 427: QA Wizard Pro User Guide v2017 - Perforce

Exit

Arguments

Argument Description

RegularExpression Regular expression to evaluate. QAWizard 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 Expressionmatches the value.

False Expression does not match the value.

ExamplecharAccepted = "^[+]?[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

ExitExits the Do, While, For, Select, Function, and Sub statements. After exiting the statement, playbackcontinues with the next statement.

SyntaxExit Do

Exit While

Exit For

Exit Select

Exit Function

Exit Sub

403

Page 428: QA Wizard Pro User Guide v2017 - Perforce

Expand

ExampleFor counter = 1 To 100

If counter >= 20 Then

PrintLn("Counter reached 20 and will exit")

Exit For

End If

PrintLn("Counter is: " + counter)

Next

ExpandExpands 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 Expandstatement to expand a tree node with items that are not loaded until the node is expanded.

SyntaxExpand("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

ExampleWindow("WysiCorp CRM").Tree("treeViewProducts").Expand("ALM Solutions/Solution Design")

ExternalAssemblyCallLoads a .NET assembly, creates an instance of the class, and calls the requestedmethod. You can pass anynumber of parameters to themethod call. Any public, non-static method is supported.

Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

SyntaxExternalAssemblyCall("AssemblyPath", "ClassName", "MethodName", Parameters...)

404

Page 429: QA Wizard Pro User Guide v2017 - Perforce

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 themethod 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 calledmethod 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 datafrom the objects in a formatted string. To access the object data in scripts, parse the string value returnedby the ExternalAssemblyCall statement to retrieve the data items.

405

Page 430: QA Wizard Pro User Guide v2017 - Perforce

ExternalCall

ExampleExternalAssemblyCall("%SCRIPTS%\\QAWProPixels.dll", "QAWProPixels.QAWProPixels","GetPixelColor", 100, 150, 0)

ExternalCallInvokes a public method on an instance of a class loaded by the LoadExternalAssembly, page 476 statementand returns the value of themethod. You can pass any number of parameters to themethod call.

Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

SyntaxExternalCall(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 themethod 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 calledmethod 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

Page 431: QA Wizard Pro User Guide v2017 - Perforce

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 datafrom the objects in a formatted string. To access the object data in scripts, parse the string value returnedby the ExternalCall statement to retrieve the data items.

ExampleasmPixels = LoadExternalAssembly("%SCRIPTS%\\QAWProPixels.dll","QAWProPixels.QAWProPixels")

pixelValue = ExternalCall(asmPixels, "GetRGBValueAt", 100, 150)

ExtractHTMLCaptures 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.

SyntaxExtractHTML("FullFilePath")

Arguments

Argument Description

FullFilePath Full path to the file to save the extracted HTML in.

Supported objects

Browser, Window

ExampleBrowser("Report a Bug").ExtractHTML("C:\\WebTesting\\ReportBug.txt")

ExtractHTMLToStringReturns HTML from a browser window as a string.

SyntaxExtractHTMLToString()

Supported objects

Browser, Window

407

Page 432: QA Wizard Pro User Guide v2017 - Perforce

Fail

Return value

Value Description

Value HTML string.

Examplehtml = Browser("Report a Bug").ExtractHTMLToString()

FailStops script playback, displays amessage in the Errors pane, and adds themessage to the run report. Forexample, you can use this statement if a script checks text against an expected value before it continues andthe text does not match.

Fail statements are often used in conditional statement blocks. See Conditional statements, page 325. Theycan also be used in a Try block. See Try...Catch...Finally, page 565.

Note: TheWarning, page 570 statement can perform the same actions as the Fail statement withoutstopping playback.

SyntaxFail("Message")

Arguments

Argument Description

Message Failuremessage to display in the Errors pane and run report.

ExampleregValue = 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

FileBaseNameReturns a filenamewithout the extension or directory.

SyntaxFileBaseName("FilePath")

408

Page 433: QA Wizard Pro User Guide v2017 - Perforce

FileDateCreated

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File base name.

ExampleFileBaseName("C:\\Testing\\Output.txt")

FileDateCreatedReturns the date and time a file or directory was created.

SyntaxFileDateCreated("FilePath")

Arguments

Argument Description

FilePath Full path to the file or directory. See Identifying files and directories in statements, page 156for 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.

ExampleFileDateCreated("C:\\Testing\\Output.txt")

FileDateLastModifiedReturns the date and time a file or directory was last modified.

SyntaxFileDateLastModified("FilePath")

409

Page 434: QA Wizard Pro User Guide v2017 - Perforce

FileDirectoryName

Arguments

Argument Description

FilePath Full path to the file or directory. See Identifying files and directories in statements, page 156for 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.

ExampleFileDateLastModified("C:\\Testing\\Output.txt")

FileDirectoryNameReturns the directory path from a file path or the parent directory path from a subdirectory path.

SyntaxFileDirectoryName("FilePath")

Arguments

Argument Description

FilePath Full path to the file or subdirectory. See Identifying files and directories in statements, page156 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.

ExampleFileDirectoryName("C:\\Testing\\Output.txt")

FileExistsReturns True or False to indicate if a file exists.

SyntaxFileExists("FilePath")

410

Page 435: QA Wizard Pro User Guide v2017 - Perforce

FileExtension

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

Return value

Value Description

True File exists.

False File does not exist.

ExampleIf (FileExists("C:\\Testing\\Output.txt") = True) Then

PrintLn("File exists.")

Else

PrintLn("File does not exist.")

End If

FileExtensionReturns the file extension, including the period, from a file path. For example, '.txt' is returned from the path toa text file.

SyntaxFileExtension("FilePath")

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File extension from the path, including the period.

ExampleFileExtension("C:\\Testing\\Output.txt")

411

Page 436: QA Wizard Pro User Guide v2017 - Perforce

FileFullPath

FileFullPathReturns a full path to a file in a relative path.

TheQAWizard Pro workspace directory is used as the default base directory for relative paths. SeeIdentifying files and directories in statements, page 156 for information about configuring full paths relative tothe script directory.

SyntaxFileFullPath("FilePath")

Arguments

Argument Description

FilePath Relative path to the file.

Return value

Value Description

Value Full file path.

ExampleFileFullPath("TestScripts\\Script001.qawscript")

FileNameReturns the filename and extension from a path.

SyntaxFileName("FilePath")

Arguments

Argument Description

FilePath Full or relative path to the file.

Return value

Value Description

Value Filename and extension from the path.

ExampleFileName("C:\\Testing\\Output.txt")

412

Page 437: QA Wizard Pro User Guide v2017 - Perforce

FileReadOnly

FileReadOnlyReturns True or False to indicate if a file is read-only.

SyntaxFileReadOnly("FilePath")

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation 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.

ExampleIf (FileReadOnly("C:\\Testing\\Output.txt") = True) Then

PrintLn("File is read-only.")

Else

PrintLn("File is not read-only.")

End If

FileRootDirectoryNameReturns 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\.

SyntaxFileRootDirectoryName("FilePath")

Arguments

Argument Description

FilePath Full path to the file or directory.

413

Page 438: QA Wizard Pro User Guide v2017 - Perforce

FileSize

Return value

Value Description

Value Root directory from the path.

\\ Root directory from the UNC network directory.

<Empty string> Path does not include a root directory.

ExampleFileRootDirectoryName("C:\\Testing\\Output.txt")

FileSizeReturns the size of a file in bytes.

SyntaxFileSize("FilePath")

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

Return value

Value Description

Value File size in bytes.

ExampleFileSize("C:\\Testing\\Output.txt")

FileTypeReturns 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 adirectory is 'File Folder'.

If a file extension is not defined in the registry, the extension is returned as the file type. For example, the filetype for test.abc is returned as 'ABC File'.

414

Page 439: QA Wizard Pro User Guide v2017 - Perforce

FindColumnByRowIndex

SyntaxFileType("FilePath")

Arguments

Argument Description

FilePath Full path to the file or directory. See Identifying files and directories in statements, page 156for 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.

<Extension> File File extension is not associated with a file type in the registry.

ExampleFileType("C:\\Testing\\Output.txt")

FindColumnByRowIndexReturns 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 theexpected values.

SyntaxFindColumnByRowIndex(SearchRowIndex, "PropertyName", "ExpectedValue", ...)

Note: You can enter multiple property/expected value pairs to better identify a control. Separate eachproperty 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

Page 440: QA Wizard Pro User Guide v2017 - Perforce

FindRowByColumnIndex

Return value

Value Description

Value Column index of the table cell.

-1 Table cell not found.

ExampleID = Cell("D")

colIndex = Window("Documents").HTMLTable("List").FindColumnByRowIndex(1, "Inner Text",ID)

Window("Documents").HTMLLink(Window("Documents").HTMLTable("List").GetControlFromTable("HTMLLink", colIndex, 2)).Click()

FindRowByColumnIndexReturns 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 theexpected values.

SyntaxFindRowByColumnIndex(SearchColIndex, "PropertyName", "ExpectedValue", ...)

Note: You can enter multiple property/expected value pairs to better identify a control. Separate eachproperty 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

Page 441: QA Wizard Pro User Guide v2017 - Perforce

FindSubStr

ExampleID = 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.

SyntaxFindSubStr("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.

ExamplefullString = "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.

SyntaxFirstRow(Recordset)

417

Page 442: QA Wizard Pro User Guide v2017 - Perforce

Float

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery,page 505.

Examplers = OpenRecordset("WysiCorp Bugs (Excel)")

FirstRow(rs)

While Not RecordsetEOF(rs)

PrintLn(GetRowValue(rs, "First Name"))

NextRow(rs)

WEnd

FloatReturns the floating point representation of a value.

SyntaxFloat(Value)

Arguments

Argument Description

Value Value to convert.

Return value

Value Description

Value Floating point number.

ExamplenumFloat = 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. Afterstatements in the loop run for each element, the script continues with the first statement outside of the block.

418

Page 443: QA Wizard Pro User Guide v2017 - Perforce

For...Next

To use a counter and loop through a block of statements a specific number of times, use the For...Next, page419 statement.

SyntaxFor 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.

ExampleitemList = Window("BugReporter Dialog").ComboBox("comboboxType").Property("ListItems")

For Each item In itemList

PrintLn (item)

Next

Window("BugReporter Dialog").Close()

For...NextRepeats a block of statements a specified number of times or until an Exit For statement runs. Uses avariable 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. Afterstatements in the loop run, the counter increments and the current value is compared to the final countervalue. If the current value is less than or equal to the final value, statements in the loop repeat. If the currentvalue 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 418statement.

SyntaxFor Counter = Start To End [Step Increment]

[Statements]

Next

419

Page 444: QA Wizard Pro User Guide v2017 - Perforce

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. Forexample, if the counter starts at 1 and increments by 2, the value is 3 the next time the looprepeats.

Statements One or more statements that repeat.

Keyword View notes

The counter variable and start and end values are displayed in the Information column.

ExampleitemList = 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

FormatReturns a formatted string using values from an array.

SyntaxFormat("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 curlybraces ({}). Separate the index and specifier with a colon. Indexes are zero based.

420

Page 445: QA Wizard Pro User Guide v2017 - Perforce

Format

Specifier Type Format Output (Passed Double1.42)

Output (Passed Int -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 forthousands

{0:n} 1.42 -12,400

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 Double1500.42)

Notes

0 Zero placeholder {0:00.0000} 1500.4200 Pads with zeroes

# Digit placeholder {0:(#).##} (1500).42

. Decimal point {0:0.0} 1500.4

, Thousandseparator

{0:0,0} 1,500 Must be between twozeroes

% Percent {0:0%} 150042% Multiplies by 100, adds%sign

e Exponentplaceholder

{0:00e+0} 15e+2 Many exponent formatsavailable

Return value

Value Description

Value Formatted string of values from the array.

ExampleDim arrayValues(2)

arrayValues(1) = "WysiWrite"

421

Page 446: QA Wizard Pro User Guide v2017 - Perforce

Forward

arrayValues(2) = 24.99

var = Format("{0} subscription license: {1:c} per month", arrayValues)

PrintLn(var)

ForwardNavigates forward one page in a browser.

SyntaxForward()

Supported objects

Browser

ExampleBrowser("Report a Bug").Forward()

GeneralUsed to add any statement or function to a script from the Add Statement dialog box, including advancedstatements 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.

SyntaxGetAllValues()

Supported objects

JSONArray

Return value

Value Description

Value User array with values from a JSONArray.

422

Page 447: QA Wizard Pro User Guide v2017 - Perforce

GetBrowserVersion

ExamplejsonArray = 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))

GetBrowserVersionReturns the browser version running the script.

SyntaxGetBrowserVersion()

Return value

Value Description

Value Browser version running the script. If the script does not include browser actions, the installedversion of the default browser selected in QAWizard Pro is returned.

Exampleversion = GetBrowserVersion()

PrintLn("Browser version: " + version)

GetCallStackReturns the complete stack of function, subroutine, script, and Try calls up to the current script line. Use totrace the calls completed before an error occurred when debugging scripts.

SyntaxGetCallStack()

423

Page 448: QA Wizard Pro User Guide v2017 - Perforce

GetControlFromTable

Return value

Value Description

Value Current call stack. Each call stack line is returned in three parts, separated with tabs: statementname and arguments, full path to the script file, and line number.

Examplestack = GetCallStack()

PrintLn("Stack info: " + stack)

GetControlFromTable

Note: This statement is not available in the Add Statement dialog box.

Returns a control from anHTML table. See Using the GetControlFromTable statement, page 243 for moreinformation.

SyntaxGetControlFromTable("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 multipleProperty/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

Page 449: QA Wizard Pro User Guide v2017 - Perforce

GetControlFromXPathQuery

ExampleWindow("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 2, "Inner Text","Details")

GetControlFromXPathQueryReturns the first HTML element that matches an XPath query. Use the return value anywhere a control isused.

Note: Only use this statement if you are familiar with XPath and understand how changing QAWizard Prosearch options can impact scripts. See About XPath queries, page 223.

SyntaxGetControlFromXPathQuery("XPathQuery")

Arguments

Argument Description

XPathQuery XPath query.

Supported objects

Browser, Window

Return value

Value Description

Value First HTML element that matches the XPath query.

ExamplemyControl = 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")

GetControlSearchTimeoutReturns themaximum time set to find a window or control in the application. Themaximum time is set in theQAWizard Pro playback options or by a SetControlSearchTimeout, page 540 statement. If the time limit isreached, playback stops and an error is displayed in the Errors pane and run report.

SyntaxGetControlSearchTimeout()

425

Page 450: QA Wizard Pro User Guide v2017 - Perforce

GetCurDir

Return value

Value Description

Value Number of milliseconds set to wait before the search times out.

Exampletimeout = GetControlSearchTimeout()

PrintLn("Time out if control not found in " + timeout + " milliseconds")

GetCurDir

Note: This statement is namedGet Current Directory in the Add Statement dialog box.

Returns the current working directory for QAWizard Pro.

The working directory is where the QAWizard Pro component used to run the script starts from. For example,if QA Wizard Pro runs the script, the QAWizard Pro application directory is the working directory. IfQAWRunScript runs the script, the working directory is the current directory in the command prompt.

SyntaxGetCurDir()

Return value

Value Description

Value QAWizard Pro working directory.

Exampledirectory = GetCurDir()

DeleteFile(directory + "\\Results.txt")

GetCurrentBrowserTypeReturns an integer that indicates the browser running the script. You can compare the returned integersagainst the BrowserTypeIE, BrowserTypeFirefox, and BrowserTypeChrome constants. See Constants, page600.

SyntaxGetCurrentBrowserType()

426

Page 451: QA Wizard Pro User Guide v2017 - Perforce

GetDataSourceColumnNames

Return value

Value Description

0 Browser is Microsoft Internet Explorer.

1 Browser is Mozilla Firefox.

2 Browser is Google Chrome.

ExampleIf GetCurrentBrowserType = BrowserTypeIE Then

PrintLn("Browser is IE")

Else

PrintLn("Browser is Firefox")

End If

GetDataSourceColumnNamesReturns an array of column names from the data source associated with the script.

SyntaxGetDataSourceColumnNames()

Return value

Value Description

Value Array of column names from the data source.

ExamplecolNames = GetDataSourceColumnNames()

For Each name in colNames

PrintLn(name)

Next

GetDiagnosticsReturns True or False to indicate if playback diagnostic information logging is enabled.

SyntaxGetDiagnostics()

427

Page 452: QA Wizard Pro User Guide v2017 - Perforce

GetDirectory

Return value

Value Description

True Diagnostic logging is enabled.

False Diagnostic logging is not enabled.

ExampleIf GetDiagnostics = True Then

PrintLn("Playback diagnostic info logged")

Else

PrintLn("Playback diagnostic info not logged")

End If

GetDirectoryReturns the path to a system or QAWizard Pro directory.

SyntaxGetDirectory(DirectoryId)

Arguments

Argument Description

DirectoryId Directory constant. See Constants, page 600.

Return value

Value Description

Value Path to the system or QAWizard Pro directory.

Examplefavorites = GetDirectory(WinFavorites)

PrintLn("Favorite applications are stored in " + favorites)

GetDirectoryNamesReturns an array of all subdirectory names from a directory or only the subdirectory names that match asearch pattern.

SyntaxGetDirectoryNames("DirectoryPath", "SearchPattern")

428

Page 453: QA Wizard Pro User Guide v2017 - Perforce

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 scriptdirectory.

SearchPattern Optional text pattern to search for. Can use a combination of literal and wildcardcharacters. Use an asterisk (*) to match zero or more characters. Use a questionmark (?)to match zero or one character. Regular expressions are not supported.

Return value

Value Description

Value Array of subdirectory names from the directory.

ExampleGetDirectoryNames("C:\\Testing\\", "Data*")

GetDotNETProperty

Note: This statement is namedGet .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.

SyntaxGetDotNETProperty("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

Page 454: QA Wizard Pro User Guide v2017 - Perforce

GetDotNETPropertyWithArgs

Return value

Value Description

Value .NET property value.

ExamplegridName = Window("WysiCorp CRM").Grid("accountsDataGridView").GetDotNETProperty("Name")

PrintLn gridName

GetDotNETPropertyWithArgs

Note: This statement is namedGet .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.

SyntaxGetDotNETPropertyWithArgs("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.

Exampleitems = Window("Form5").ListBox("listBox1").GetDotNETProperty("Items")

Dim params(1)

params(1) = 1

PrintLn items.GetDotNETPropertyWithArgs("Items", params)

430

Page 455: QA Wizard Pro User Guide v2017 - Perforce

GetEnv

GetEnv

Note: This statement is namedGet Environment in the Add Statement dialog box.

Returns the value of an environment variable fromWindows or QAWizard Pro. See theWindows help forinformation about system variables. SeeQAWizard Pro environment variables, page 605 for informationabout QAWizard Pro variables.

SyntaxGetEnv("EnvironmentVariableName")

Arguments

Argument Description

EnvironmentVariableName Windows or QAWizard Pro environment variable name.

Return value

Value Description

Value Environment variable value.

ExamplehomeDir = GetEnv("HOMEPATH")

PrintLn homeDir

GetFieldValueReturns 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 addingissues to Helix ALM. For example, get the Type value from an issue and use it to report on the types of issuescreated from QAWizard 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.

SyntaxGetFieldValue(Issue, FieldIdentifier)

Arguments

Argument Description

Issue Issue object that contains the field. Use the NewIssue, page 490 statement to create theissue object.

431

Page 456: QA Wizard Pro User Guide v2017 - Perforce

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 databasetable. Youmay want to use the ID if issue fields are frequently renamed in the Helix ALMproject. 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.

Exampleissue = 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)

GetFileNamesReturns an array of all filenames from a directory or only the filenames that match a search pattern.

SyntaxGetFileNames("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 scriptdirectory.

432

Page 457: QA Wizard Pro User Guide v2017 - Perforce

GetFilePath

Argument Description

SearchPattern Optional text pattern to search for. Can use a combination of literal and wildcardcharacters. Use an asterisk (*) to match zero or more characters. Use a questionmark (?)to match zero or one character. Regular expressions are not supported.

Return value

Value Description

Value Array of filenames from the directory.

ExampleGetFileNames("C:\\Testing\\", "*.txt")

GetFilePathReturns the file path to a QAWizard Pro script or running application.

SyntaxGetFilePath(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.

Examplescript = 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.

SyntaxGetLength()

433

Page 458: QA Wizard Pro User Guide v2017 - Perforce

GetLowLevelSpeed

Supported objects

JSONArray

Return value

Value Description

Value Number of values in the JSONArray.

ExamplejsonArray = 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)

GetLowLevelSpeedReturns the playback speed set for low-level actions. The speed is set in the QAWizard Pro playback optionsor in a SetLowLevelSpeed, page 545 statement.

SyntaxGetLowLevelSpeed()

Return value

Value Description

1 Default speed. Same speed used during recording.

0 Maximum speed.

Examplellspeed = GetLowLevelSpeed()

PrintLn("Low-level actions playback speed: " + llspeed)

434

Page 459: QA Wizard Pro User Guide v2017 - Perforce

GetMouseXCoordinate

GetMouseXCoordinateReturns the X coordinate (horizontal pixel location) of themouse pointer relative to the screen or a window orcontrol.

Note: Only used at the application level when a window or control is not specified.

SyntaxGetMouseXCoordinate()

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 thetotal width of all screens.

Example'Returns X coordinate on screen where button is clicked

Window("Report a Bug").Button("Login").Click()

x = GetMouseXCoordinate()

GetMouseYCoordinateReturns the Y coordinate (vertical pixel location) of themouse pointer relative to the screen or a window orcontrol.

Note: Only used at the application level when a window or control is not specified.

SyntaxGetMouseYCoordinate()

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

Page 460: QA Wizard Pro User Guide v2017 - Perforce

GetNumItems

Return value

Value Description

Value Mouse pointer Y coordinate. When testing on a computer with multiple screens, the value is thetotal 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 namedGet Number of Items in the Add Statement dialog box.

Returns the number of items in a control.

SyntaxGetNumItems()

Supported objects

ComboBox, Grid, Item, ListBox, ListView, Menu, PopupMenu, Row, TabBar, ToolBar, Tree

Return value

Value Description

Value Number of items in the control.

ExamplemyItems = Window("Feedback").TabBar("Menu").GetNumItems()

For itemIndex = 1 to myItems

Window("Feedback").TabBar("Menu").Item("Send")Select()

Next itemIndex

GetPlaybackDelayReturns the delay set between each statement.

To set the delay, use the SetPlaybackDelay, page 546 statement.

SyntaxGetPlaybackDelay()

436

Page 461: QA Wizard Pro User Guide v2017 - Perforce

GetPlaybackSessionName

Return value

Value Description

Value Delay between statements.

Exampledelay = GetPlaybackDelay()

PrintLn("Delay between statements: " + delay)

GetPlaybackSessionNameReturns the name set for the playback session sent to the QAWizard Pro Server.

To set the session name, use the SetPlaybackSessionName, page 546 statement. You can also entersession names before playback starts if prompting for session names is enabled in the QAWizard Pro Serveroptions. See Setting server connection options, page 43.

SyntaxGetPlaybackSessionName()

Return value

Value Description

Value Playback session name.

ExamplesessionName = GetPlaybackSessionName()

PrintLn("Playback session: " + sessionName)

GetPropertyMapReturns amap of all property names and values from awindow or control.

You can work with values in the PropertyMap object without calling the target application again. Use thefollowing statements to return additional information about the values in the PropertyMap: Property -PropertyMap, page 510, HasProperty - PropertyMap, page 448, and Size, page 554.

SyntaxGetPropertyMap()

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

Page 462: QA Wizard Pro User Guide v2017 - Perforce

GetPropertyNames

Return value

Value Description

Value Map of all property names and values from the window or control.

ExamplepropertyMap = Window("Window").Control("control1").GetPropertyMap()

textVal = propertyMap.Property("Text")

valToCheck = propertyMap.Property("PropertyNameMayNotExist", "Value to return ifspecified value not found.")

GetPropertyNamesReturns an array of all property names from awindow or control.

Names are returned as strings that can be passed to the Property, page 509 statement to retrieve the value ofeach 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 439statement.

SyntaxGetPropertyNames()

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.

ExampleTry

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

Page 463: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxGetPropertyNames()

Supported objects

JSONObject

Return value

Value Description

Value JSONObject property names.

ExamplejsonObject = 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))

GetRecordsetColumnNamesReturns an array of column names from a recordset or data row.

SyntaxGetRecordsetColumnNames(Recordset/DataRow)

439

Page 464: QA Wizard Pro User Guide v2017 - Perforce

GetRowValue

Arguments

Argument Description

Recordset/DataRow Recordset or data row name. Must be opened with OpenRecordset, page 504 orOpenRecordsetQuery, page 505.

Return value

Value Description

Value Array of column names from the recordset or data row.

Examplebugs = OpenRecordset("WysiCorp Bugs (Excel)")

colNames = GetRecordsetColumnNames(bugs)

For Each name in colNames

PrintLn(name)

Next

GetRowValueReturns the column value in the current row of a recordset.

SyntaxGetRowValue(Recordset, "ColumnName")

Arguments

Argument Description

Recordset Recordset object that contains the row to retrieve the value from. Must be opened withOpenRecordset, 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.

Examplebugs = OpenRecordset("WysiCorp Bugs")

NextRow(bugs)

If Not RecordsetEOF(bugs) Then

440

Page 465: QA Wizard Pro User Guide v2017 - Perforce

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

GetScreenHeightReturns the test computer's screen height.

SyntaxGetScreenHeight()

Return value

Value Description

Value Screen height. When testing on a computer with multiple screens, the value is the total height ofall screens.

Exampleheight = GetScreenHeight()

x = GetMouseXCoordinate()

'Moves mouse to bottom of screen

MouseMove(x, height, 5000)

GetScreenWidthReturns the test computer's screen width.

SyntaxGetScreenWidth()

Return value

Value Description

Value Screen width. When testing on a computer with multiple screens, the value is the total width of allscreens.

Examplewidth = GetScreenWidth()

y = GetMouseYCoordinate()

'Moves mouse to right on screen

MouseMove(width, y, 5000)

441

Page 466: QA Wizard Pro User Guide v2017 - Perforce

GetScriptVariable

GetScriptVariableReturns the value of a variable defined in a called script.

SyntaxGetScriptVariable("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.

ExampleScript.CallScript("WysiCorp Login")

loginName = GetScriptVariable("WysiCorp Login", "loginUser")

Window("Feedback Page").Editbox("editboxUsername").SetText(loginName)

GetSQLScalarReturns a value from a data source linked to an external datasheet based on a SQL scalar query.

SyntaxGetSQLScalar("DatasheetName", "SQLScalarQuery", FailureBehavior)

Arguments

Argument Description

DatasheetName External datasheet to open. Must be in the current workspace and linked to a datasource.

SQLScalarQuery SQL scalar query to run.

FailureBehavior Failure behavior. True stops the script if the query fails. False displays a warning andcontinues playback.

442

Page 467: QA Wizard Pro User Guide v2017 - Perforce

GetStopwatchElapsedMilliseconds

Return value

Value Description

Value Value in the first column of the first row from the resulting data set.

Null Query failed.

ExamplenumCustomers = GetSQLScalar("Clients", "SELECT COUNT(*) FROM Customers", True)

GetStopwatchElapsedMilliseconds

Note: This statement is namedGet StopwatchMilliseconds in the Add Statement dialog box.

Returns the elapsed stopwatch time inmilliseconds. The return value is useful for comparisons and inDo...LoopWhile, page 389 statements. For example, you can report on how long a web page takes to loadfrom a server.

To control the stopwatch, use the StartStopwatch, page 555 and StopStopwatch, page 556 statements.

SyntaxGetStopwatchElapsedMilliseconds()

Return value

Value Description

Value Elapsed stopwatch time inmilliseconds.

ExampleStartStopwatch()

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 namedGet 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 elapsedtime in text output. For example, you can print how long it took to complete a web page form and include theoutput text in the run report.

443

Page 468: QA Wizard Pro User Guide v2017 - Perforce

GetValue - JSONArray

To control the stopwatch, use the StartStopwatch, page 555 and StopStopwatch, page 556 statements.

SyntaxGetStopwatchElapsedTime()

Return value

Value Description

Value Elapsed stopwatch time in HH:MM:SS.mm format.

ExampleStartStopwatch()

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.

SyntaxGetValue(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

Page 469: QA Wizard Pro User Guide v2017 - Perforce

GetValue - JSONObject

ExamplejsonArray = 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.

SyntaxGetValue("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 isnull.

Supported objects

JSONObject

Return value

Value Description

Value JSONObject property value. The DefaultReturnValue is returned if the property name is not found.

ExamplejsonObject = JSONNewObject()

' Adds values to JSONObject

jsonObject.SetValue("PropertyName1", 1)

jsonObject.SetValue("PropertyName2", 2)

' Returns 2

445

Page 470: QA Wizard Pro User Guide v2017 - Perforce

GetVariableValues

intVal = jsonObject.GetValue("PropertyName2")

PrintLn("Should be 2: " & intVal)

GetVariableValuesReturns all script and repository variables and the current values as a string. If a data source is associatedwith the script, the current row value is also returned.

SyntaxGetVariableValues()

Return value

Value Description

Value String that includes all script and repository variables and current values. Includes the current rowvalue if the script has an associated data source.

Examplevars = 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.

SyntaxGetVirtualUserID()

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)

GetWindowsVersionReturns the concatenated string representation of theWindows version and installed service pack.

446

Page 471: QA Wizard Pro User Guide v2017 - Perforce

HasProperty - JSONObject

SyntaxGetWindowsVersion()

Return value

Value Description

Value Windows version information in a concatenated string.

ExampleosVersion = 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.

SyntaxHasProperty("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.

ExamplejsonObject = JSONNewObject()

' Adds values to JSONObject

jsonObject.SetValue("PropertyName1", 1)

jsonObject.SetValue("PropertyName2", 2)

' Returns True

447

Page 472: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxHasProperty("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.

ExamplepropertyMap = Window("Window").Control("control1").GetPropertyMap()

textVal = ""

If propertyMap.HasProperty("Text") Then

textVal = propertyMap.Property("Text")

End If

HelpDisplays help for a window.

This statement performs the same action as clicking the Help button in the application title bar. Use it to openhelp in a window or to activate themouse cursor to access 'What's This?', or pop-up, help on individualcontrols.

SyntaxHelp()

448

Page 473: QA Wizard Pro User Guide v2017 - Perforce

Home

Supported objects

Browser, Window

ExampleWindow("BugReporter Dialog").Help()

HomeNavigates to the home page in a browser.

SyntaxHome()

Supported objects

Browser

ExampleBrowser("Report a Bug").Home()

HourReturns the hour from a date/time value.

SyntaxHour("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.

ExampletimeHour = Hour("3:45PM")

PrintLn("Hour: " + timeHour)

HoverMoves themouse pointer to a control and holds it.

449

Page 474: QA Wizard Pro User Guide v2017 - Perforce

HTMLFindByID

This statement is not used when recording scripts, but you canmanually add it to scripts to test controlshidden until themouse hovers over them, such as menus on a web page.

SyntaxHover()

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

ExampleWindow("Report a Bug").HTMLElement("HTMLSupportLink").Hover()

HTMLFindByIDReturns 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.

SyntaxHTMLFindByID("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.

ExamplehtmlText = Window("Thank You").ExtractHTMLToString()

ticketNum = HTMLFindByID(htmlText, "ticket")

If ticketNum = "" Then

Fail("Cannot find ticket number")

Else

PrintLn("Ticket number: " & ticketNum)

End If

450

Page 475: QA Wizard Pro User Guide v2017 - Perforce

HTMLFindByTag

HTMLFindByTagReturns an array of strings that contain the inner text from anHTML element tag.

SyntaxHTMLFindByTag("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.

ExamplehtmlText = Browser("Thank You").ExtractHTMLToString()

metaInnerTextUserArray = HTMLFindByTag(htmlText, "meta")

arraySize = ArraySize(metaInnerTextUserArray, 1)

PrintLn("Count of META tags in document: " & arraySize)

IfConditionally runs a block of statements based on the value of an expression (True or False). If the conditionis True, statements in the If block run. If the condition is False, statements in the If block are skipped and thescript 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 statementswhen the If condition is False.

SyntaxIf 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

Page 476: QA Wizard Pro User Guide v2017 - Perforce

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.

ExamplecurrentHour = 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

IgnoreAutocompleteDropDownsIgnores autocomplete drop-down lists in web applications.

By default, QA Wizard Pro attempts to dismiss autocomplete drop-down lists during playback by pressingEsc after entering text in fields, whichmay cause scripts to fail. Use this statement to ignore drop-down listsso QAWizard Pro does not interact with them.

SyntaxIgnoreAutocompleteDropDowns(True/False)

Arguments

Argument Description

True/False True ignores autocomplete drop-down lists during playback and False allows drop-downs todisplay.

ExampleIgnoreAutocompleteDropDowns(True)

452

Page 477: QA Wizard Pro User Guide v2017 - Perforce

IgnoreErrors

IgnoreErrorsStops displaying errors in the Errors pane during playback and in run reports.

Use this statement with error handling blocks to prevent displaying known errors, whichmakes it easier tofocus on errors that need to be addressed. If a script error occurs while errors are ignored, the script line ismarked as Failed, but additional error information is not provided.

SyntaxIgnoreErrors(True/False)

Arguments

Argument Description

True/False True stops displaying errors and False displays errors.

ExampleIgnoreErrors(True)

IgnoreWarningsStops displaying warnings in the Errors pane during playback and in run reports.

SyntaxIgnoreWarnings(True/False)

Arguments

Argument Description

True/False True stops displaying warnings and False displays warnings.

ExampleIgnoreWarnings(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.

SyntaxInsertAt(Index, "Value")

453

Page 478: QA Wizard Pro User Guide v2017 - Perforce

Integer

Arguments

Argument Description

Index Index in the JSONArray. Indexes are zero based.

Value Value to insert.

Supported objects

JSONArray

ExamplejsonArray = JSONNewArray()

' Inserts "First" at beginning of array

jsonArray.InsertAt(0, "First")

IntegerReturns the integer representation of a value.

SyntaxInteger(Value)

Arguments

Argument Description

Value Value to convert to an integer.

Return value

Value Description

Value Converted integer value.

Exampleint = Integer(123.5678)

InvokeDotNETMethod

Note: This statement is named Invoke .NETMethod in the Add Statement dialog box.

Invokes a .NET method and returns themethod value.

Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

454

Page 479: QA Wizard Pro User Guide v2017 - Perforce

InvokeDotNETMethodWithArgs

SyntaxInvokeDotNETMethod("MethodName", ParametersList)

Arguments

Argument Description

MethodName .NETmethod name to invoke.

ParametersList Parameters to use when invoking themethod.

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.

ExampleWindow("Form").EditBox("editboxRegister").InvokeDotNETMethod("Clear", 2)

InvokeDotNETMethodWithArgs

Note: This statement is named Invoke .NETMethod with Arguments in the Add Statement dialog box.

Invokes a .NETmethod with parameters in an array and returns themethod value.

Only use this statement if you have Visual C# .NET or Visual Basic .NET experience.

SyntaxInvokeDotNETMethodWithArgs("MethodName", ArrayOfParameters)

Arguments

Argument Description

MethodName .NETmethod name to invoke.

ArrayOfParameters Array that holds parameters to pass to the .NETmethod.

455

Page 480: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleDim array(2)

array(1) = "parameter"

array(2) = 2

returnValue = Window("Form").EditBox("editboxRegister").InvokeDotNETMethodWithArgs("Clear", array)

InvokeJavaScriptReturns the result of JavaScript evaluated in a window.

SyntaxInvokeJavaScript("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.

ExampledocumentLocation = Window("MyWebPage").InvokeJavaScript("document.location.href;")

456

Page 481: QA Wizard Pro User Guide v2017 - Perforce

Is64BitWindows

Is64BitWindowsReturns True or False to indicate if theWindows version is 64-bit.

SyntaxIs64BitWindows()

Return value

Value Description

True Windows version is 64-bit.

False Windows version is 32-bit.

ExampleIf Is64BitWindows() Then

PrintLn("64-bit Windows")

Else

PrintLn("32-bit Windows")

End if

IsArrayReturns True or False to indicate if an expression is an array.

SyntaxIsArray(Value)

Arguments

Argument Description

Value Expression to evaluate.

Return value

Value Description

True Expression is an array.

False Expression is not an array.

ExampleretVal = myFunction()

myVal = ""

457

Page 482: QA Wizard Pro User Guide v2017 - Perforce

IsIgnoringAutocompleteDropDowns

If (IsArray(retVal)) Then

myVal = retVal(1)

Else

myVal = retval

End If

IsIgnoringAutocompleteDropDownsReturns True or False to indicate if autocomplete drop-down lists are ignored.

SyntaxIsIgnoringAutocompleteDropDowns()

Return value

Value Description

True Autocomplete drop-down lists are ignored.

False Autocomplete drop-down lists are not ignored.

ExampleIf IsIgnoringAutoCompleteDropDowns = True Then

PrintLn("Ignoring autocomplete drop-down lists")

Else

PrintLn("Not ignoring autocomplete drop-down lists")

End If

IsIgnoringErrorsReturns True or False to indicate if errors are displayed in the Errors pane during playback and in run reports.

SyntaxIsIgnoringErrors()

Return value

Value Description

True Errors are ignored.

False Errors are not ignored.

ExampleIf IsIgnoringErrors = True Then

PrintLn("Ignoring errors")

458

Page 483: QA Wizard Pro User Guide v2017 - Perforce

IsIgnoringWarnings

Else

PrintLn("Not ignoring errors")

End If

IsIgnoringWarningsReturns True or False to indicate if warnings are displayed in the Errors pane during playback and in runreports.

SyntaxIsIgnoringWarnings()

Return value

Value Description

True Warnings are ignored.

False Warning are not ignored.

ExampleIf IsIgnoringWarnings = True Then

PrintLn("Ignoring warnings")

Else

PrintLn("Not ignoring warnings")

End If

IsJSONArrayReturns True or False to indicate if an expression is a JSONArray type.

SyntaxIsJSONArray(Value)

Arguments

Argument Description

Value Expression to evaluate.

Return value

Value Description

True Expression is a JSONArray.

False Expression is not a JSONArray.

459

Page 484: QA Wizard Pro User Guide v2017 - Perforce

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)

IsJSONObjectReturns True or False to indicate if an expression is a JSONObject type.

SyntaxIsJSONObject(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)

IsJSONTypeReturns True or False to indicate if an expression is a JSONObject or JSONArray type.

SyntaxIsJSONType(Value)

460

Page 485: QA Wizard Pro User Guide v2017 - Perforce

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)

IsDateReturns True or False to indicate if a date/time string is valid.

SyntaxIsDate("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.

ExampleValidDate = IsDate("12-December-2016")

461

Page 486: QA Wizard Pro User Guide v2017 - Perforce

IsNull

IsNullReturns True or False to indicate if a value is null.

SyntaxIsNull("Value")

Arguments

Argument Description

Value Value to evaluate.

Return value

Value Description

True Value is null.

False Value is not null.

Examplex = Window("WysiCorp CRM").Grid("accountsDataGridView").GetDotNETProperty("Selection")

If IsNull(x) Then

PrintLn("No selection")

Else

x.SetDotNETProperty("Value", 10)

End If

IsNumericReturns True or False to indicate if an expression is numeric.

SyntaxIsNumeric(Expression)

Arguments

Argument Description

Expression Expression to evaluate.

462

Page 487: QA Wizard Pro User Guide v2017 - Perforce

IsObject

Return value

Value Description

True Expression is numeric.

False Expression is not numeric.

ExampleIsNumeric(42)

IsObjectReturns True or False to indicate if an expression is a dynamic COM object.

SyntaxIsObject(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")

JSONArrayGetValueReturns the value of an index from a JSONArray or a default value if the index is out of range.

SyntaxJSONArrayGetValue("JSON", Index, DefaultReturnValue)

463

Page 488: QA Wizard Pro User Guide v2017 - Perforce

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 isreturned.

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)

JSONArraySetValueSets or adds the value to an index in a JSONArray and returns themodified array.

SyntaxJSONArraySetValue("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 aJSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

464

Page 489: QA Wizard Pro User Guide v2017 - Perforce

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)

JSONCanParseAsArrayReturns True or False to indicate if an expression contains a JSONArray.

SyntaxJSONCanParseAsArray("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)

JSONCanParseAsObjectReturns True or False to indicate if an expression contains a JSONObject.

SyntaxJSONCanParseAsObject("JSON")

465

Page 490: QA Wizard Pro User Guide v2017 - Perforce

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)

JSONIsValidReturns True or False to indicate if an expression is valid JSON.

SyntaxJSONIsValid("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 quotationmarks (\"). 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

Page 491: QA Wizard Pro User Guide v2017 - Perforce

JSONNewArray

Example' Returns True

boolVal = JSONIsValid("{\"propName\":\"propValue\"}")

PrintLn("Should be True: " & boolVal)

' Returns False

boolVal = JSONIsValid("unquoted string")

PrintLn("Should be False: " & boolVal)

JSONNewArrayCreates and returns an empty JSONArray.

SyntaxJSONNewArray()

Return value

Value Description

Value Empty JSONArray.

ExamplejsonArray = JSONNewArray()

JSONNewObjectCreates and returns an empty JSONObject.

SyntaxJSONNewObject()

Return value

Value Description

Value Empty JSONObject.

ExamplejsonObject = JSONNewObject()

JSONObjectGetValueReturns the value of a property from a JSONObject or a default value if the property name is not found.

467

Page 492: QA Wizard Pro User Guide v2017 - Perforce

JSONObjectSetValue

SyntaxJSONObjectGetValue("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 isnull.

Return value

Value Description

Value Property value from the JSONObject.

Null Property namewas not found.

ExamplestrVal = JSONObjectGetValue("{\"propName\":\"propValue\"}", "propName")

PrintLn("Should be \"propValue\": " & strVal)

JSONObjectSetValueSets or adds a value to a property name in a JSONObject and returns themodified object.

SyntaxJSONObjectSetValue("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. Ifa JSONObject or JSONArray is used, a copy is created and inserted into theJSONObject.

468

Page 493: QA Wizard Pro User Guide v2017 - Perforce

JSONParse

Return value

Value Description

Value Modified JSONObject.

ExamplestrVal = JSONObjectSetValue("{\"propertyName\": \"propertyValue\"}", "propertyName", "newPropertyValue")

PrintLn("Should be \"{\"propertyName\":\"new PropertyValue\"}\": " & strVal)

JSONParseReturns 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 theArrayToJSONArray, page 357 statement.

SyntaxJSONParse("JSON")

Arguments

Argument Description

JSON Object to parse. Can be a number, Boolean, null, string, JSONArray, JSONObject, or otherdata type.

If a string is used, a string, JSONObject, JSONArray, integer, float, Boolean, or null may bereturned. Strings must be wrapped in backslashes and double quotationmarks (\") to beparsed 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 isused, the object is converted to a string before parsing.

Return value

Value Description

Value Value from the parsed object.

ExamplejsonObject = JSONParse("{\"propertyName\": \"propertyValue\"}")

PrintLn("Should be \"{\"propertyName\":\"propertyValue\"}\": " & jsonObject)

469

Page 494: QA Wizard Pro User Guide v2017 - Perforce

KeyDown

KeyDownPresses and holds one or more keyboard keys on a window or control, or at the application level. Thisstatement is followed by KeyUp, page 471.

SyntaxKeyDown("KeyName", WaitTime)

Arguments

Argument Description

KeyName Key to release. Valid key codes are available onMicrosoft'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 primarykey followed by themodifier key. For example, D1, Shift releases the Shift and 1 keys. D1 isthe primary key and Shift is themodifier key.

WaitTime Number of milliseconds to wait after the previous statement before pressing the key.

Tip: To determine the correct key code andmodifier order, enter the key combination for this statement inthe 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

ExampleKeyDown("Z, Control", 5000)

KeyUp("Z, Control", 5000)

KeyPressPresses and releases one or more keyboard keys on a window or control, or at the application level.

SyntaxKeyPress("KeyName")

470

Page 495: QA Wizard Pro User Guide v2017 - Perforce

KeyUp

Arguments

Argument Description

KeyName Key to release. Valid key codes are available onMicrosoft'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 primarykey followed by themodifier key. For example, D1, Shift releases the Shift and 1 keys. D1 isthe primary key and Shift is themodifier key.

Tip: To determine the correct key code andmodifier order, enter the key combination for this statement inthe 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

ExampleWindow("Report a Bug").EditBox("editboxUsername").KeyPress("C, Control")

KeyPress("Menu, Alt")

KeyUpReleases a one or more keyboard keys on a window or control, or at the application level. This statement ispreceded by KeyDown, page 470.

SyntaxKeyUp("KeyName", WaitTime)

Arguments

Argument Description

KeyName Key to release. Valid key codes are available onMicrosoft'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 primarykey followed by themodifier key. For example, D1, Shift releases the Shift and 1 keys. D1 isthe primary key and Shift is themodifier key.

WaitTime Number of milliseconds to wait after the previous statement before releasing the key.

471

Page 496: QA Wizard Pro User Guide v2017 - Perforce

LastRow

Tip: To determine the correct key code andmodifier order, enter the key combination for this statement inthe 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

ExampleKeyDown("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.

SyntaxLastRow(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery,page 505.

Examplers = OpenRecordset("WysiCorp Bugs (Excel)")

LastRow(rs)

While Not RecordsetBOF(rs)

PrintLn(GetRowValue(rs, "First Name"))

PrevRow(rs)

WEnd

LeftReturns a number of characters from the beginning of a string.

SyntaxLeft("String", NumberOfCharacters)

472

Page 497: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleLeftString = Left("QAWPString", 4)

LengthReturns the number of characters in a string.

SyntaxLength("String")

Arguments

Argument Description

String String to return the number of characters from.

Return value

Value Description

Value Number of characters in the string.

ExamplestrLength = 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

Page 498: QA Wizard Pro User Guide v2017 - Perforce

LMouseDoubleClick

SyntaxLMouseClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleWindow("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.

SyntaxLMouseDoubleClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

474

Page 499: QA Wizard Pro User Guide v2017 - Perforce

LMouseDown

Argument Description

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleBrowser("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.

SyntaxLMouseDown(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

Page 500: QA Wizard Pro User Guide v2017 - Perforce

LMouseUp

ExampleBrowser("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.

SyntaxLMouseUp(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleBrowser("Report a Bug").Button("Back").LMouseUp(15, 15, 100)

LoadExternalAssemblyReturns 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.

SyntaxLoadExternalAssembly("AssemblyPath", "ClassName")

476

Page 501: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleasmPixels = LoadExternalAssembly("%SCRIPTS%\\QAWProPixels.dll","QAWProPixels.QAWProPixels")

pixelValue = ExternalCall(asmPixels, "GetRGBValueAt", 100, 150)

LowerConverts characters in a string to lowercase and returns the string.

SyntaxLower("String")

Arguments

Argument Description

String String to convert.

Return value

Value Description

Value Converted lowercase string.

ExamplelowercaseString = Lower("QA Wizard Pro")

MakeRegExpression

Note: This statement is namedMake Regular Expression in the Add Statement dialog box.

477

Page 502: QA Wizard Pro User Guide v2017 - Perforce

MakeURL

Returns a regular expression built from a string. This statement is useful for converting string values withspecial characters that are stored in variables. Special characters are escaped for literal interpretation in thereturned regular expression.

SyntaxMakeRegExpression("RegularExpressionString")

Arguments

Argument Description

RegularExpressionString String to build the regular expression from.

Return value

Value Description

Value Regular expression built from the string.

ExampleregExString = MakeRegExpression("$25.00")

MakeURLReturns the full URL constructed by combining a root URL and a component, such as a web server directorypath, filename and extension, anchor tag, or other parameter.

SyntaxMakeURL("RootURL", "Component")

Arguments

Argument Description

RootURL Root URL.

Component Component to combine with the root URL.

Return value

Value Description

Value Full URL.

Exampleurl = MakeURL("http://www.wysicorp.com", "login.php")

478

Page 503: QA Wizard Pro User Guide v2017 - Perforce

Max

Max

Note: This statement is namedMaximum in the Add Statement dialog box.

Returns the larger of two numbers.

SyntaxMax(FirstNumber, SecondNumber)

Arguments

Argument Description

FirstNumber First number to evaluate.

SecondNumber Second number to evaluate.

Return value

Value Description

Value Larger number.

ExamplemaximumValue = Max(50, 45)

MaximizeMaximizes a window. Performs the same action as clicking theMaximize button in the application title bar.

Tip: If you are running scripts onmultiple computers with different screen resolutions, youmay want toadd aMaximize statement to scripts to make sure QAWizard Pro can locate all objects during playback.

SyntaxMaximize()

Supported objects

Browser, Window

ExampleWindow("Feedback Acknowledgment").Maximize()

MidReturns a number of characters starting with a position in the string.

479

Page 504: QA Wizard Pro User Guide v2017 - Perforce

Min

SyntaxMid("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 numberof string characters, a zero-length string is returned.

NumberOfCharacters Number of characters to return.

Return value

Value Description

Value Characters from themiddle of the string based on the starting position.

ExamplemidChars = Mid("QA Wizard Pro", 2, 5)

Min

Note: This statement is namedMinimum in the Add Statement dialog box.

Returns the smaller of two values.

SyntaxMin(FirstNumber, SecondNumber)

Arguments

Argument Description

FirstNumber First number to evaluate.

SecondNumber Second number to evaluate.

Return value

Value Description

Value Smaller value.

480

Page 505: QA Wizard Pro User Guide v2017 - Perforce

Minimize

ExampleminimumValue = Min(85, 90)

MinimizeMinimizes a window to a button on theWindows taskbar. Performs the same action as clicking theMinimizebutton in the application title bar.

SyntaxMinimize()

Supported objects

Browser, Window

ExampleWindow("Feedback Acknowledgment").Minimize()

MinuteReturns theminute from a date/time value.

SyntaxMinute("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.

ExampleminuteValue = Minute("2016-05-01 14:57:32.8")

MMouseClick

Note: This statement is namedMiddleMouse Click in the Add Statement dialog box.

Clicks themiddlemouse button in a location.

481

Page 506: QA Wizard Pro User Guide v2017 - Perforce

MMouseDoubleClick

SyntaxMMouseClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleWindow("Feedback Acknowledgment").MMouseClick(400, 315, 5000)

MMouseDoubleClick

Note: This statement is namedMiddleMouse Double-Click in the Add Statement dialog box.

Double-clicks themiddlemouse button in a location.

SyntaxMMouseDoubleClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

482

Page 507: QA Wizard Pro User Guide v2017 - Perforce

MMouseDown

Argument Description

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleWindow("Feedback Acknowledgment").MMouseDoubleClick(435, 550, 10000)

MMouseDown

Note: This statement is namedMiddleMouse Down in the Add Statement dialog box.

Presses themiddlemouse button in a location. This statement is followed by MMouseUp, page 484.

SyntaxMMouseDown(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

Page 508: QA Wizard Pro User Guide v2017 - Perforce

MMouseUp

ExampleWindow("Feedback Acknowledgment").MMouseDown(223, 127, 1000)

MMouseUp

Note: This statement is namedMiddleMouse Up in the Add Statement dialog box.

Releases themiddlemouse button in a location. This statement is preceded by MMouseDown, page 483.

SyntaxMMouseUp(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleWindow("Feedback Acknowledgment").MMouseUp(223, 127, 0)

MonthReturns themonth from a date/time value as an integer.

SyntaxMonth("DateTime")

484

Page 509: QA Wizard Pro User Guide v2017 - Perforce

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 themonth from the date/time value. 1 is January, 2 is February, etc.

ExamplemonthValue = Month("1 May 2016 2:57:32.8 PM")

MonthNameReturns amonth name based on amonth integer. 1 is January, 2 is February, etc.

SyntaxMonthName(MonthInteger)

Arguments

Argument Description

MonthInteger Month integer.

Return value

Value Description

Value Month name that corresponds with the integer.

ExamplemonthNameValue = MonthName(9)

MonthNum

Note: This statement is namedMonth Numeric in the Add Statement dialog box.

Returns amonth integer based on themonth name. January is 1, February is 2, etc.

SyntaxMonthNum("MonthName")

485

Page 510: QA Wizard Pro User Guide v2017 - Perforce

MouseMove

Arguments

Argument Description

MonthName Month name.

Return value

Value Description

Value Integer that corresponds with themonth name.

ExamplemonthNumericValue = MonthNum("September")

MouseMoveMoves themouse pointer to a location. QAWizard Promay recordmousemove statements tomove from oneunknown control to another so the controls can be located during playback. You can also use this statement tomove themouse anywhere on the screen.

SyntaxMouseMove(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location tomove themouse to, relative to thewindow or control. If a window or control is not specified, the coordinate is relative to thescreen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location tomove themouse to, relative to thewindow or control. If a window or control is not specified, the coordinate is relative to thescreen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement beforemoving themousepointer 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

ExampleWindow("Report a Bug").MouseMove(325, 225, 5000)

486

Page 511: QA Wizard Pro User Guide v2017 - Perforce

MouseMoveFromCurrentPosition

MouseMoveFromCurrentPositionMoves themouse pointer a number of pixels from the current location.

SyntaxMouseMoveFromCurrentPosition(xPixels, yPixels, WaitTime)

Arguments

Argument Description

xPixels Number of pixels to move themouse horizontally. Must be within the available pixels on thetest computer's screen.

yPixels Number of pixels to move themouse vertically. Must be within the available pixels on the testcomputer's screen.

WaitTime Number of milliseconds to wait after the previous statement beforemoving themouse.

Example'Moves mouse right 25 pixels and down 15 pixels 5000 milliseconds after previousstatement runs

MouseMoveFromCurrentPosition(25, 15, 5000)

MoveDirectoryMoves or renames a directory.

SyntaxMoveDirectory("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 scriptdirectory.

DestinationPath Full path tomove the directory to. To rename the directory, enter the new name in thedestination path. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

ExampleMoveDirectory("C:\\Testing\\TestDocuments", "C:\\Testing\\Data")

487

Page 512: QA Wizard Pro User Guide v2017 - Perforce

MoveFile

MoveFileMoves or renames a file.

SyntaxMoveFile("SourcePath", "DestinationPath")

Arguments

Argument Description

SourcePath Full path to the file to move. See Identifying files and directories in statements, page 156for 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 inthe destination path. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

ExampleMoveFile("C:\\Testing\\Output.txt", "C:\\TestDocuments\\DataSource")

MSAADoDefaultActionUses Active Accessibility to perform a control's default action.

SyntaxMSAADoDefaultAction()

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

ExampleWindow("Report a Bug").HTMLLink("SoloSubmitLogo").MSAADoDefaultAction()

MSAASetNameUses Active Accessibility to set the name of a control.

SyntaxMSAASetName("Name")

488

Page 513: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleWindow("Report a Bug").HTMLLink("SoloSubmitLogo").MSAASetName("Link to SoloSubmit")

MSAASetValueUses Active Accessibility to set the value of a control.

SyntaxMSAASetValue("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

ExampleWindow("Report a Bug").HTMLLink("Products").MSAASetValue("Products Footer Link")

NavigateNavigates to a URL in a browser.

SyntaxNavigate("URL")

489

Page 514: QA Wizard Pro User Guide v2017 - Perforce

NewIssue

Arguments

Argument Description

URL URL to navigate to.

Supported objects

Browser, HTMLLink, Window

ExampleBrowser("Out of Bounds").Navigate("http://www.wysicorp.com")

NewIssueCreate an empty Helix ALM issue.

After the issue object is created, you can use the following statements to set, get, or remove issue fieldvalues, 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, page517, and SetFieldValue, page 542.

Note: This statement cannot be used in load test scripts.

SyntaxNewIssue()

Return value

Value Description

Value Empty Helix ALM issue.

Exampleissue = NewIssue()

NewTabOpens a new tab in a browser.

SyntaxNewTab()

Supported objects

Browser

490

Page 515: QA Wizard Pro User Guide v2017 - Perforce

NextRow

ExampleBrowser().NewTab()

NextRow

Note: This statement is namedNext 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 doesnot change.

SyntaxNextRow(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery,page 505.

Examplebugs = OpenRecordset("WysiCorp Bugs")

NextRow(bugs)

NowReturns the current date and time in the format used on the test computer. Formatting depends on theoperating system's regional settings.

SyntaxNow()

Return value

Value Description

Value Current date and time.

ExamplecurrentDateAndTime = Now()

OCRCheckpointVerifies graphical text against an expected value throughOCR comparison. Use to verify text in images,control types QAWizard Pro cannot recognize, or a specified region in a window or control. See CreatingOCR checkpoints, page 183.

491

Page 516: QA Wizard Pro User Guide v2017 - Perforce

OCRCheckpoint

If the expected text does not match the application during playback, the script fails or continues and displaysamessage in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculatedduring playback is 80%, the checkpoint fails.

SyntaxOCRCheckpoint(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 toverify. If not specified, text in the entire window or control is used. Required if theTopEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the text toverify. If not specified, text in the entire window or control is used. Required if theLeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

RectangleWidth Optional integer pixel value of the width of the rectangle that contains the text toverify. If not specified, text in the entire window or control is used. Required if theLeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified.

RectangleHeight Optional integer pixel value of the height of the rectangle that contains the text toverify. If not specified, text in the entire window or control is used. Required if theLeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified.

FailureBehavior Optional failure behavior. True stops the script if the checkpoint fails. False displaysa 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

ExampleWindow("WysiCorp Home").HTMLElement("elementLoginTester").OCRCheckpoint(92, "solobug",74, -35, 60, 18)

492

Page 517: QA Wizard Pro User Guide v2017 - Perforce

OCRCheckpointPreviousStatement

OCRCheckpointPreviousStatement

Note: This statement was previously namedCheckpointOCR and is deprecated. UseOCRCheckpointinstead. SeeOCRCheckpoint, page 491.

Verifies graphical text in the screenshot captured for the action performed in the previous statement againstan expect value using OCR comparison.

If the expected text value in the specified rectangle from the screenshot does not match the application duringplayback, the script fails or continues and displays amessage in the Errors pane. For example, if theaccuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails.

SyntaxOCRCheckpointPreviousStatement(Region, MinimumAccuracy, "ExpectedText", LeftEdgePixel,TopEdgePixel, RectangleWidth, RectangleHeight, FailureBehavior, "Warning")

Arguments

Argument Description

Region OCR region to check. OCRWindowRelative uses the pixel locations relative to thewindow that last had an action performed in it. OCRControlRelative uses the pixellocations 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 displaysa 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.

ExampleOCRCheckpointPreviousStatement(OCRControlRelative, 92, "PRODUCTS", 45, 163, 50, 50, True,"Products text is incorrect")

OCRConvertToGrayscaleConverts an image to grayscale before reading it using OCR. Use to override the default OCR grayscaleconversion set in the playback options, whichmay help improve the accuracy of returned text. SeeTroubleshooting OCR issues, page 186.

493

Page 518: QA Wizard Pro User Guide v2017 - Perforce

OCRGetContrast

SyntaxOCRConvertToGrayscale(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

OCRGetContrastReturns the amount of color contrast used for OCR. Use when debugging OCR statements to see thecontrast used and determine if changes are needed to improve the accuracy of returned text. The contrast isset in the playback options or by the OCRSetContrast statement. See Troubleshooting OCR issues, page186.

SyntaxOCRGetContrast()

494

Page 519: QA Wizard Pro User Guide v2017 - Perforce

OCRGetLanguageFilePath

Return value

Value Description

Valuebetween 0and 100

Amount of color contrast applied to images before they are read using OCR. 0 indicates nocontrast is applied and 100 indicates images are solid black.

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

OCRGetLanguageFilePathReturns the path to the language file used for OCR. Use when debugging OCR statements to see thelanguage file used and determine if changes are needed to improve the accuracy of returned text. Thelanguage file is set in the playback options or by the OCRSetLanguageFilePath statement. SeeTroubleshooting OCR issues, page 186.

SyntaxOCRGetLanguageFilePath()

495

Page 520: QA Wizard Pro User Guide v2017 - Perforce

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

OCRGetScaleReturns the image scale used for OCR. Use when debugging OCR statements to see the scale used anddetermine if changes are needed to improve the accuracy of returned text. The scale is set in the playbackoptions or by the OCRSetScale statement. See Troubleshooting OCR issues, page 186.

SyntaxOCRGetScale()

Return value

Value Description

Valuebetween1 and 15

Number of times larger than the original size images are scaled before they are read using OCR.For example, 1 indicates images are scaled to original size (100%) and 15 indicates images arescaled 15 times the original size (1500%).

496

Page 521: QA Wizard Pro User Guide v2017 - Perforce

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

OCRGetTextReturns text found using OCR in a specified region, window, or control. Use to convert graphical text in anapplication to text strings for use in other statements. See Using OCR toWork with Graphical Text, page 181.

SyntaxOCRGetText(LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight)

Arguments

Argument Description

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the text toreturn. If not specified, all text in the window or control is returned. Required if theTopEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the text toreturn. If not specified, all text in the window or control is returned. Required if theLeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified.

497

Page 522: QA Wizard Pro User Guide v2017 - Perforce

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 theLeftEdgePixel, 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 theLeftEdgePixel, 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)

OCRGetTextFromFileReturns 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 anapplication is read using OCR, you can use this statement to check the text returned from the saved imageand determine if changes are needed in the OCR playback options. See Troubleshooting OCR issues, page186.

SyntaxOCRGetTextFromFile("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

Page 523: QA Wizard Pro User Guide v2017 - Perforce

OCRGetTextPreviousStatement

Argument Description

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the text toreturn. 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 toreturn. 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.

ExampleocrText = OCRGetTextFromFile("C:\\OCRTests\\Images\\DebugPassword.png")

PrintLn("Text in screenshot: " + ocrText)

OCRGetTextPreviousStatement

Note: This statement is deprecated. UseOCRGetText instead. SeeOCRGetText, page 497.

Returns the text found using OCR in the screenshot captured for the action performed in the previousstatement.

SyntaxOCRGetTextPreviousStatement(Region, LeftEdgePixel, TopEdgePixel, RectangleWidth,RectangleHeight)

Arguments

Argument Description

Region OCR region to check. OCRWindowRelative uses the pixel locations relative to thewindow that last had an action performed in it. OCRControlRelative uses the pixellocations relative to the control that last had an action performed on it.

499

Page 524: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleocrText = OCRGetTextPreviousStatement(OCRWindowRelative, 123, 175, 100, 100)

PrintLn(ocrText)

OCRIsConvertingToGrayscaleReturns True or False to indicate if images are converted to grayscale before they are read using OCR. Usewhen debugging OCR statements to see if grayscale conversion is used and determine if changes are neededto improve the accuracy of returned text. Grayscale conversion is set in the playback options or by theOCRConvertToGrayscale statement. See Troubleshooting OCR issues, page 186.

SyntaxOCRIsConvertingToGrayscale()

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

Page 525: QA Wizard Pro User Guide v2017 - Perforce

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

OCRSetContrastSets the amount of color contrast in an image before reading it using OCR. Use to override the default OCRcontrast set in the playback options, which can help improve the accuracy of returned text. SeeTroubleshooting OCR issues, page 186.

SyntaxOCRSetContrast(ContrastAmount)

Arguments

Argument Description

ContrastAmount Amount of color contrast to apply. Enter a value between 0 and 100. For example, 0does not change the image contrast and 100makes the image solid black.

Example'Saves default OCR settings

lang = OCRGetLanguageFilePath()

contrast = OCRGetContrast()

imgScale = OCRGetScale()

grayConversion = OCRIsConvertingToGrayscale()

Try

501

Page 526: QA Wizard Pro User Guide v2017 - Perforce

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

OCRSetLanguageFilePathSets the path to the language file to use when reading an image using OCR. Use to override the default OCRlanguage setting in the playback options, whichmay help improve the accuracy of returned text. SeeTroubleshooting OCR issues, page 186.

Note: QAWizard Pro uses the Tesseract OCR engine. QAWizard 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.

SyntaxOCRSetLanguageFilePath("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

Page 527: QA Wizard Pro User Guide v2017 - Perforce

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

OCRSetScaleSets the scale of an image before reading it using OCR. Use to override the default OCR scale set in theplayback options, whichmay help improve the accuracy of returned text. See Troubleshooting OCR issues,page 186.

SyntaxOCRSetScale(Scale)

Arguments

Argument Description

Scale Number of times larger than the original image size to increase the scale. Enter a valuebetween 1 and 15. For example, 1 scales to original size (100%), 2 scales two times theoriginal 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

Page 528: QA Wizard Pro User Guide v2017 - Perforce

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 ErrorSets the error handling behavior for a script, function, or subroutine.

n OnError ResumeNext continues playback even when an error occurs. The error is displayed in the Errorspane, run report, and status tool.

n OnError Goto 0 stops playback when an error occurs, which is QAWizard Pro's default error behavior.

n OnError ResumeNext can be added to scripts before an error occurs to set the error handling scope. EachOn Error statement overrides the behavior specified by previous On Error statements in the same scope.

SyntaxOn Error Resume Next

orOn Error Goto 0

ExampleFunction FunctionThatFails()

On Error Resume Next

Fail("ScriptFail")

PrintLn("Playback continued")

End Function

FunctionThatFails()

PrintLn("Script did not fail")

OpenRecordsetReturns a recordset object opened from a datasheet. The value is generally assigned to a variable for use withdatabase statements, such as GetRowValue, page 440.

504

Page 529: QA Wizard Pro User Guide v2017 - Perforce

OpenRecordsetQuery

Note: A primary key must be defined in the table if you want to add or update rows. If a primary key is notdefined, QAWizard Pro opens the table as read-only.

SyntaxOpenRecordset("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.

Examplebugs = OpenRecordset("WysiCorp Bugs")

product = GetRowValue(bugs, "Product")

OpenRecordsetQueryReturns 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 generallyassigned to a variable for use with database statements, such as GetRowValue, page 440.

SyntaxOpenRecordsetQuery("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

Page 530: QA Wizard Pro User Guide v2017 - Perforce

ParseString

ExamplecustomerSet = OpenRecordsetQuery("Customers", "SELECT * FROM Email")

count = RecordsetRowCount(customerSet)

PrintLn(count)

ParseStringReturns an array of substrings from an original delimited string.

SyntaxParseString("OriginalString", "DelimiterCharacter")

Arguments

Argument Description

OriginalString Original text string to parse.

DelimiterCharacter Delimiter character that indicates where to parse the original string. A comma orsemicolon is typically used, but any character is supported.

Return value

Value Description

Value Array of substrings from the parsed text string.

ExampleparsedString = ParseString("May 20, 2008", ",")

PerformXPathQueryReturns an array of results that matches an XPath query. You can use this statement to determine how manydescendants a control has.

Note: Only use this advanced statement if you are familiar with XPath and understand how changing QAWizard Pro search options can impact scripts. See About XPath queries, page 223.

SyntaxPerformXPathQuery("XPathQuery")

Arguments

Argument Description

XPathQuery XPath query to perform.

506

Page 531: QA Wizard Pro User Guide v2017 - Perforce

Pop

Supported objects

Browser, Window

Return value

Value Description

Value Array of results that match the XPath query.

ExampleWindow("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.

SyntaxPop()

Supported objects

JSONArray

Return value

Value Description

Value Last value in the JSONArray.

ExamplejsonArray = 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

Page 532: QA Wizard Pro User Guide v2017 - Perforce

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 notchange.

SyntaxPrevRow(Recordset)

Arguments

Argument Description

Recordset Recordset name. Must be opened with OpenRecordset, page 504 or OpenRecordsetQuery,page 505.

Examplers = OpenRecordset("WysiCorp Bugs (Excel)")

LastRow(rs)

While Not RecordsetBOF(rs)

PrintLn(GetRowValue(rs, "First Name"))

PrevRow(rs)

WEnd

PrintDisplays amessage in the Output pane. This statement can help youmonitor a script during playback. Forexample, use this statement to display values returned from functions. Messages displayed using thisstatement 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.

SyntaxPrint("Text")

Arguments

Argument Description

Text Text to print.

ExamplePrint("QA Wizard Pro")

508

Page 533: QA Wizard Pro User Guide v2017 - Perforce

PrintLn

PrintLn

Note: This statement is named Print Line in the Add Statement dialog box.

Displays amessage on a new line in the Output pane. For example, use this statement to display messagesthroughout script playback to view the actions that are performed on the application or return values capturedfrom 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.

SyntaxPrintLn("Text")

Arguments

Argument Description

Text Text to print.

ExamplePrintLn("New Line")

PropertyReturns a window or control property value.

Use this statement instead of checkpoints when you want to continue running a script if the property valuedoes not match an expected value or when you do not know the expected value until the script runs. You canalso 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, page510 statement.

SyntaxProperty("PropertyName")

Arguments

Argument Description

PropertyName Name of the property to return the value from. You can view a list of all propertiescaptured for the window or control when it was added to the application repository in theProperties dialog box. SeeModifying window and control properties, page 122.

509

Page 534: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleloginBtnProp = 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.

SyntaxProperty("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.

ExamplepropertyMap = Window("Window").Control("control1").GetPropertyMap()

textVal = propertyMap.Property("Text")

510

Page 535: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxPush(Value)

Arguments

Argument Description

Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If aJSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

Supported objects

JSONArray

ExamplejsonArray = JSONNewArray()

' Appends 1 and 2 to end of array

jsonArray.Push(1)

jsonArray.Push(2)

Rand

Note: This statement is namedRandom in the Add Statement dialog box.

Returns a random number between two integers.

SyntaxRand(MinInteger, MaxInteger)

Arguments

Argument Description

MinInteger Inclusive lower bound of the random number returned. Must be between -2,147,483,648 and2,147,483,647.

MaxInteger Exclusive upper bound of the random number returned. Must be between -2,147,483,648 and2,147,483,647. Must be greater than or equal to theMinInteger value.

511

Page 536: QA Wizard Pro User Guide v2017 - Perforce

Range

Return value

Value Description

Value Random number between the two integers.

ExamplerandomNumber = 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 themoon', toselect 'The cow', 1 is the starting number because it is the cursor position before the 'T' and 8 is the endingnumber because it is the cursor position after the 'w'.

SyntaxRange(StartIndex, EndIndex)

Arguments

Argument Description

StartIndex Index of first character to select.

EndIndex Index of last character to select.

Supported objects

ComboBox, EditBox, SpinBox

ExampleWindow("CRMContact").EditBox("textBoxEmail").Range(1, 5)

ReadRegistryEntryReturns the value associated with a name in a registry key.

SyntaxReadRegistryEntry("FullKeyName", "ValueName")

512

Page 537: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleregistryKeyValue = ReadRegistryEntry("HKEY_LOCAL_MACHINE", "Name")

ReadTextFileReads a text file and returns the contents to a variable.

SyntaxReadTextFile("FilePath", Encoding)

Arguments

Argument Description

FilePath Full path to the file to read. See Identifying files and directories in statements, page 156 forinformation about configuring full paths relative to the workspace or script directory.

Encoding File encoding constant. If not specified, EncodingAutoDetect is used. See Constants, page600.

Return value

Value Description

Value File contents.

Exampleoutput = ReadTextFile("C:\\Testing\\Output.txt", EncodingAutoDetect)

PrintLn("File content: " + output)

RecordsetBOFReturns True or False to indicate if the current recordset row index is before the beginning of the data.

513

Page 538: QA Wizard Pro User Guide v2017 - Perforce

RecordsetEOF

SyntaxRecordsetBOF(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.

Examplers = OpenRecordset("WysiCorp Bugs (Excel)")

LastRow(rs)

While Not RecordsetBOF(rs)

PrintLn(GetRowValue(rs, "First Name"))

PrevRow(rs)

WEnd

RecordsetEOFReturns True or False to indicate if the current recordset row index is past the end of the data.

SyntaxRecordsetEOF(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

Page 539: QA Wizard Pro User Guide v2017 - Perforce

RecordsetRowCount

Value Description

False Current row is before the end of the data.

Examplebugs = 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

RecordsetRowCountReturns the total number of records in a recordset.

SyntaxRecordsetRowCount(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.

ExamplecustomerSet = OpenRecordsetQuery("Customers", "SELECT * FROM Email")

count = RecordsetRowCount(customerSet)

PrintLn(count)

RefreshRefreshes the current page in a browser.

SyntaxRefresh()

515

Page 540: QA Wizard Pro User Guide v2017 - Perforce

Rem

Supported objects

Browser

ExampleBrowser("Report a Bug").Refresh()

Rem

Note: This statement is namedComment 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.

SyntaxRem comment

or'comment

ExampleRem 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 successfullyremoved. The remaining values in the JSONArray move up one index.

SyntaxRemoveAt(Index)

Arguments

Argument Description

Index Index to remove in the JSONArray. JSONArray indexes are zero based.

Supported objects

JSONArray

516

Page 541: QA Wizard Pro User Guide v2017 - Perforce

RemoveField

Return value

Value Description

True Index was removed.

False Index was not removed.

ExamplejsonArray = 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)

RemoveFieldRemoves a field value from aHelix ALM issue.

You can use this statement to clear default field values set in an issue if the value does not apply to a specificcondition that occurs when the script runs or if the field is no longer used. For example, if a custom field is setin the issue but the field is temporarily removed from Helix ALM, you can remove the field value when addingissues from scripts without changing the scripts in case the field is used again later.

Note: This statement cannot be used in load test scripts.

SyntaxRemoveField(Issue, FieldIdentifier)

Arguments

Argument Description

Issue Issue object that contains the field. Use the NewIssue, page 490 statement to create theissue object.

517

Page 542: QA Wizard Pro User Guide v2017 - Perforce

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 databasetable. Youmay want to use the ID if issue fields are frequently renamed in the Helix ALMproject. Ask your Helix ALM administrator for help.

Exampleissue = 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.

SyntaxRemoveProperty("PropertyName")

Arguments

Argument Description

PropertyName Property to remove.

Supported objects

JSONObject

518

Page 543: QA Wizard Pro User Guide v2017 - Perforce

Replace

Return value

Value Description

True Property was removed.

False Property was not removed.

ExamplejsonObject = 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)

ReplaceReplaces text in a string and returns the resulting string.

SyntaxReplace("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.

ExampletextReplace = Replace("WysiWrite updates are now available.", "Write", "Draw")

519

Page 544: QA Wizard Pro User Guide v2017 - Perforce

ResetStopwatch

ResetStopwatchResets the elapsed stopwatch time to zero.

To restart the stopwatch, use the StartStopwatch, page 555 statement. To stop the stopwatch, use theStopStopwatch, page 556.

SyntaxResetStopwatch()

ExampleStartStopwatch()

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()

ResizeResizes a window.

SyntaxResize(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

ExampleBrowser().Resize(800, 600)

RestoreRestores a window to its default size and location. Performs the same action as clicking the Restore button inthe application title bar.

520

Page 545: QA Wizard Pro User Guide v2017 - Perforce

Right

SyntaxRestore()

Supported objects

Browser, Window

ExampleBrowser().Restore()

RightReturns a number of characters from the end of a string.

SyntaxRight("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.

ExamplerightString = Right("QAWPString", 6)

RMouseClick

Note: This statement is namedRight Mouse Click in the Add Statement dialog box.

Clicks the right mouse button in a location.

SyntaxRMouseClick(xCoordinate, yCoordinate, WaitTime)

521

Page 546: QA Wizard Pro User Guide v2017 - Perforce

RMouseDoubleClick

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleWindow("Report a Bug").HTMLLink("SoloSubmitLogo").RMouseClick(250, 200, 5000)

RMouseDoubleClick

Note: This statement is namedRight Mouse Double-Click in the Add Statement dialog box.

Double-clicks the right mouse button in a location.

SyntaxRMouseDoubleClick(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

522

Page 547: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleBrowser("Report a Bug").Button("Cancel").RMouseDoubleClick(250, 225, 15000)

RMouseDown

Note: This statement is namedRight Mouse Down in the Add Statement dialog box.

Presses the right mouse button in a location. This statement is followed by RMouseUp, page 523.

SyntaxRMouseDown(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleBrowser("Report a Bug").Button("Back").RMouseDown(15, 15, 0)

RMouseUp

Note: This statement is namedRight Mouse Up in the Add Statement dialog box.

523

Page 548: QA Wizard Pro User Guide v2017 - Perforce

RunBackgroundCommand

Releases the right mouse button in a location. This statement is preceded by RMouseDown, page 523.

SyntaxRMouseUp(xCoordinate, yCoordinate, WaitTime)

Arguments

Argument Description

xCoordinate X coordinate to indicate the horizontal pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

yCoordinate Y coordinate to indicate the vertical pixel location where themouse button is pressedrelative to the window or control. If a window or control is not specified, the coordinate isrelative to the screen andmust be within the available pixels on the test computer's screen.

WaitTime Number of milliseconds to wait after the previous statement before pressing themousebutton.

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

ExampleBrowser("Report a Bug").Button("Back").RMouseUp(15, 15, 100)

RunBackgroundCommandRuns a command from theWindows command prompt on the test computer as playback continues. Forexample, 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.

SyntaxRunBackgroundCommand("ExecutablePath", "WorkingDirectory", "CommandLineArguments")

Arguments

Argument Description

ExecutablePath Full path to the executable, batch file, or command file to run in thebackground.

524

Page 549: QA Wizard Pro User Guide v2017 - Perforce

RunCommand

Argument Description

WorkingDirectory Full path to the executable working directory.

CommandLineArguments Arguments to include in the command line call.

ExampleRunBackgroundCommand("C:\\Program Dir\\SQL Server\\SQLServer.exe", "C:\\Program Dir\\SQLServer\\", "-c -f")

RunCommandRuns a command from theWindows command prompt on the test computer and returns the exit code when itfinishes. The command finishes before playback continues. For example, use this statement to run a batchfile 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.

SyntaxRunCommand("ExecutablePath", "WorkingDirectory", "CommandLineArguments")

Arguments

Argument Description

ExecutablePath Full path to the executable, batch file, or command file to run in thebackground.

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.

ExampleexitCode = RunCommand("C:\\Windows\\regedit.exe", "C:\\Windows", "/s"",C:\\RegistryUtils\\ExportedKey.reg")

PrintLn("Registry utility exit code: " + exitCode)

525

Page 550: QA Wizard Pro User Guide v2017 - Perforce

RunScriptRemote

RunScriptRemoteRuns a script on a remote computer. QA Wizard Pro must be installed andQAWRemote.exemust be runningon the remote computer. See Configuring remote computers, page 249 and Starting QAWRemote.exe, page250.

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 inthe datasheet.

Note: Issues may occur when using this statement in load test scripts.

SyntaxRunScriptRemote("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.

ExampleRunScriptRemote("remote.wysicorp.com", 6001, "WysiCorp Login", "TestUsernames")

RunSQLCommandRuns a SQL command on a data source linked to an external datasheet and returns the number of rows thecommand is performed on. You can use the return value with other statements to validate the number ofrecords affected by the command.

SyntaxRunSQLCommand("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

Page 551: QA Wizard Pro User Guide v2017 - Perforce

SaveRegionToImageFile

Argument Description

FailureBehavior Failure behavior. True stops the script if the command fails. False displays a warningand 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 filedata source.

-1 Command other than UPDATE, INSERT, or DELETE ran against an Oracle or SQL Server datasource.

Null Command failed.

ExamplerowsAffected = RunSQLCommand("CustomerRecordsDatasheet", "UPDATE CustomerRecords SETPurchased=True WHERE FirstName='John' AND LastName='Smith'", True)

PrintLn("Rows updated: " + rowsAffected)

SaveRegionToImageFileSaves a region relative to a window, control, or the test computer screen as a PNG file. Use when debuggingOCR statements.

For example, if you use the OCRGetText statement to get text from aweb page and then set the returned textin the Username editbox, you can use this statement to save an image of the specified area the text wasreturned from. If log in fails, you can use the saved image to help determine if the correct Username value wasentered. See Using OCR toWork with Graphical Text, page 181.

SyntaxSaveRegionToImageFile("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 .pngextension, it is added when saving the image. See Identifying files and directories instatements, page 156 for information about configuring full paths relative to theworkspace or script directory.

527

Page 552: QA Wizard Pro User Guide v2017 - Perforce

Script.CallScript

Argument Description

LeftEdgePixel Optional integer pixel value of the left side of the rectangle that contains the region tosave. If not specified, an image of the entire window, control, or test computer screen issaved. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argumentis specified.

TopEdgePixel Optional integer pixel value of the top side of the rectangle that contains the region tosave. If not specified, an image of the entire window, control, or test computer screen issaved. Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argumentis specified.

RectangleWidth Optional integer pixel value of the width of the rectangle that contains the region tosave. If not specified, an image of the entire window, control, or test computer screen issaved. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument isspecified.

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 issaved. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument isspecified.

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

ExampleIf (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.CallScriptRuns another script in the workspace and optionally sets the data source for the called script. After the calledscript runs, playback continues in the calling script. See Calling scripts from other scripts, page 151.

SyntaxCallScript("ScriptName", "DatasheetName")

528

Page 553: QA Wizard Pro User Guide v2017 - Perforce

Script.ClearContext

Arguments

Argument Description

ScriptName Script name to call. Must be in the sameworkspace.

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 thisstatement. If a datasheet is specified, the called script runs once for each row in it. If adatasheet is not specified, the called script only runs once, but has access to thevariables and data source associated with the calling script and any statementsdeclared before the Script.CallScript statement.

Supported objects

Script

ExampleScript.CallScript("MenuChecks")

Script.ClearContextTerminates the existing connection to an application in the application repository so a new connection can beestablished by the Script.SetContext, page 534 statement. Use when a script needs to access more than oneapplication or running process during playback.

To terminate a connection in a load test script, use the Script.ClearLoadTestContext, page 529 statement.

SyntaxClearContext()

Supported objects

Script

ExampleScript.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.

SyntaxClearLoadTestContext()

529

Page 554: QA Wizard Pro User Guide v2017 - Perforce

Script.CloseApp

Supported objects

Script

ExampleScript.ClearLoadTestContext()

Script.CloseApp

Note: This statement is named Script Close Application in the Add Statement dialog box.

Closes all applications QAWizard Pro is currently connected to.

SyntaxCloseApp()

Supported objects

Script

ExampleWindow("Feedback Acknowledgment").Button("buttonSend").Click()

Script.CloseApp()

Script.ConnectToProcessConnects to an application running on the test computer. Use this statement to connect to an applicationwithout starting it from the script or for testing applications that run in the background, such as aWindowsservice.

Note:When the script runs, the process identified in the ConnectToProcess statement must be runningon the test computer or the script will fail.

This statement must be preceded by the Script.SetContext, page 534 statement so QAWizard Pro knowswhich version in the application repository the process is related to. If you record additional steps in anexisting 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 afterthe SetContext statement. You can alsomanually add it.

Note: This statement is not supported in scripts that test Windows 8 applications. Use theScript.RunApp, page 532 statement to start aWindows 8 application or make it the active window.

SyntaxConnectToProcess("ProcessName")

530

Page 555: QA Wizard Pro User Guide v2017 - Perforce

Script.GetContext

Arguments

Argument Description

ProcessName Executable process to connect to. If you do not know the process name, add thisstatement from the Add Statement dialog box to select the running process. You can alsoview running process names and descriptions on the Processes tab inWindowsTask Manager. See theWindows help for information.

Supported objects

Script

ExampleScript.SetContext("Notepad/5.1")

Script.ConnectToProcess("notepad.exe")

Script.GetContextReturns the application name and version number the script is running against. The information is retrievedfrom the application repository.

To return the application and version a load test script is running against, use the Script.GetLoadTestContext,page 532 statement.

SyntaxScript.GetContext()

Supported objects

Script

Return value

Value Description

Value Application name and version number the script is running against.

Examplecontext = Script.GetContext()

PrintLn("Application/version: " + context)

Script.GetLineNumberReturns the current line number from the script.

SyntaxGetLineNumber()

531

Page 556: QA Wizard Pro User Guide v2017 - Perforce

Script.GetLoadTestContext

Supported objects

Script

Return value

Value Description

Value Current script line number.

ExamplescriptLine = 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 retrievedfrom the application repository.

SyntaxScript.GetContext()

Supported objects

Script

Return value

Value Description

Value Application name and version number the load test is running against.

Examplecontext = 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 canalsomanually add it. Must be preceded by the Script.SetContext, page 534 statement, which specifies theversion to use in the application repository.

532

Page 557: QA Wizard Pro User Guide v2017 - Perforce

Script.SetBrowser

To close and restart the same application and version during playback, use the Script.CloseApp statementand then another Script.RunApp statement.

Note: If a script needs to runmore than one application, youmust use the Script.ClearContext, page 529statement to clear the existing repository connection and then add Script.SetContext, page 534 andScript.RunApp statements to run the new application.

SyntaxRunApp()

Supported objects

Script

ExampleScript.SetContext("WysiCorp Login/1.0")

Script.RunApp()

Script.SetBrowserSets the browser used to run the script. Use this statement to specify a browser for a script without changingthe default browser setting.

This statement must be preceded by the Script.SetContext, page 534 statement and followed by theScript.RunApp, page 532 statement.

Note: After a browser type is set, the script always uses that browser. To change the browser in the samescript, use another SetBrowser statement.

SyntaxSetBrowser(BrowserType)

Arguments

Argument Description

BrowserType Browser type to use to run the script: BrowserTypeChrome, BrowserTypeFirefox, orBrowserTypeIE.

Supported objects

Script

ExampleScript.SetContext("WysiCorp Login/1.0")

Script.SetBrowser(BrowserTypeFirefox)

Script.RunApp()

533

Page 558: QA Wizard Pro User Guide v2017 - Perforce

Script.SetContext

Script.SetContextEstablishes 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 commandline arguments.

n Version in the repository to use when comparing controls to the application and performing actions duringplayback.

The statement is typically followed by a Script.RunApp, page 532 or Script.ConnectToProcess, page 530statement 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 runmore than one application or connect to additional running processes, youmust use the Script.ClearContext, page 529 statement to terminate the existing connection. You alsoneed 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.

SyntaxSetContext("Application/Version")

Arguments

Argument Description

Application/Version Application name and version number to use in the application repository, separatedwith a forward slash.

Note: If the application has the same name in the local and global repository, QA Wizard Pro uses theapplication in the local repository by default. To change the repository used during playback, add 'Global:'before the application name.

Supported objects

Script

ExampleScript.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 loadtests:

534

Page 559: QA Wizard Pro User Guide v2017 - Perforce

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 valueare assigned the default value. Use the Assignment, page 358 statement to assign a different value to thesevariables.

SyntaxSetLoadTestContext("Application/Version")

Arguments

Argument Description

Application/Version Application name and version number to use in the application repository, separatedwith a forward slash.

Note: If the application has the same name in the local and global repository, QA Wizard Pro uses theapplication in the local repository by default. To change the repository used during playback, add 'Global:'before the application name.

Supported objects

Script

ExampleScript.SetLoadTestContext("WysiCorp/1.0")

ScriptNameReturns the name of the running script.

SyntaxScriptName()

Return value

Value Description

Value Script name.

ExamplePrintLn("Script name: " + ScriptName())

SecondReturns the seconds from a date/time value.

535

Page 560: QA Wizard Pro User Guide v2017 - Perforce

Select...Case

SyntaxSecond("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.

ExamplesecValue = Second("05/01/2016 14:57:32.8")

Select...CasePerforms one of several blocks of statements for a condition with more than two outcomes. Compares theresult of an expression against values in one or more Case statements. Statements in a Case block are onlyperformed if the result of the expressionmatches the result of the expression in the Select...Case statement.If there is not amatch, you can use a Case Else statement to run alternate statements. See Case, page 361.

Note: Case statements cannot havemultiple delimited values. Define only one value per Casestatement.

SyntaxSelect 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 ormore statements to run if TestExpressionmatches any part of Expression.

536

Page 561: QA Wizard Pro User Guide v2017 - Perforce

Select

Argument Description

ElseStatements-n

One ormore statements to run if TestExpression does not match any of the Casestatements.

Note: The Case statement is separate from Select...Case in the Add Statement dialog box.

ExampleSRand()

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.

SyntaxSelect("Item")

Argument

Argument Description

Item Item to select.

Supported objects

Cell, ComboBox, Grid, Item, ListBox, ListView, Menu, PopupMenu, Row, Tab, TabBar, ToolBar, Tree

ExampleWindow("WysiCorp CRM").Menu("MenuBar").Item("File/Switch Project...").Select()

537

Page 562: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxSelectRow(RowIndex)

Arguments

Argument Description

RowIndex Table row index number. To select more than one row, enter multiple row indexes separatedwith commas.

Supported objects

Grid

ExampleWindow("WysiCorp CRM").Grid("accountsDataGridView").SelectRow(3, 4, 5)

SelectTabSelects a tab in a browser.

SyntaxSelectTab("TabText")

Arguments

Argument Description

TabText Tab name.

Supported objects

Browser

ExampleBrowser().SelectTab("Contact")

Set

Note: This statement is named Set Check Box in the Add Statement dialog box.

538

Page 563: QA Wizard Pro User Guide v2017 - Perforce

SetAllFilesReadOnly

Selects a check box control.

SyntaxSet()

Supported objects

CheckBox

ExampleWindow("WysiCorp CRM").CheckBox("checkBoxMac").Set()

SetAllFilesReadOnlySets or clears the read-only attribute on all files in a directory. Use to allow or prevent scripts frommodifyingfiles in the specified directory.

SyntaxSetAllFilesReadOnly("DirectoryPath", True/False, Recursive)

Arguments

Argument Description

DirectoryPath Full path to the directory. See Identifying files and directories in statements, page 156 forinformation 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-onlyattribute tomake files writable.

Recursive Recursive attribute change. True changes the read-only attribute on all files in allsubdirectories. False changes only the read-only attribute on files in the specifieddirectory. 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 andsubdirectories writable

DeleteDirectory(dirPath, True)

End Sub

SafeDelete("C:\\Testing")

SafeDelete("C:\\TempOutput")

SetCellSets the column value in the current row of the script data source.

539

Page 564: QA Wizard Pro User Guide v2017 - Perforce

SetControlSearchTimeout

SyntaxSetCell("ColumnName", NewValue)

Arguments

Argument Description

ColumnName Column name to set the value in.

NewValue Value to set in the cell.

ExampleSetCell("First Name", "John")

SetControlSearchTimeoutSets themaximum time to wait for QAWizard Pro to find a window or control in the application. If the time isreached, playback stops and an error is displayed.

The default value is 15,000milliseconds.

Note: This statement overrides the default control search timeout set in the Options dialog box. SeeSetting playback options, page 76.

SyntaxSetControlSearchTimeout(Timeout)

Arguments

Argument Description

Timeout Number of milliseconds before the window or control search times out.

ExampleSetControlSearchTimeout(90000)

SetDateSets 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/timestatements, page 327.

SyntaxSetDate("Date")

540

Page 565: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleWindow("CRMAdd Note").DateTimePicker("dateOfEventPicker").SetDate("5/19/2016")

SetDateRangeSets 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/timestatements, page 327.

SyntaxSetDateRange("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

ExampleWindow("WysiCorp CRM").Calendar("monthCalendar").SetDateRange("5/20/2016", "5/27/2016")

SetDateTimeSets 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/timestatements, page 327.

541

Page 566: QA Wizard Pro User Guide v2017 - Perforce

SetDiagnostics

SyntaxSetDateTime("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

ExampleWindow("Add Note").DateTimePicker("dateEventPicker").SetDateTime("5/18/2016 4:42:35 PM")

SetDiagnosticsEnables or disables playback diagnostic information logging to help with troubleshooting if QA Wizard Procannot identify a control. Diagnostics provide insight into how controls are identified by displaying window andcontrol property values.

Information is logged in a temporary file in the Temp\QAWizard Pro Playback directory.

Note: Logging playback diagnostic information slows playback. Only use this statement whentroubleshooting scripts.

SyntaxSetDiagnostics(True/False)

Arguments

Argument Description

True/False True enables diagnostic logging and False disables it.

ExampleSetDiagnostics(True)

Script.SetContext("WysiCorp Login/1.0")

Script.RunApp()

SetFieldValueSets the value of a Helix ALM issue field.

Note: This statement cannot be used in load test scripts.

542

Page 567: QA Wizard Pro User Guide v2017 - Perforce

SetFileReadOnly

SyntaxSetFieldValue(Issue, FieldIdentifier, FieldValue)

Arguments

Argument Description

Issue Issue object that contains the field. Use the NewIssue, page 490 statement to create theissue object.

FieldIdentifier Field name to set the value for.

You can also use the field ID, which is available in the Helix ALM FLDDFNTN databasetable. Youmay want to use the ID if issue fields are frequently renamed in the Helix ALMproject. 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 correspondingvalue list, the field is set to <not set> when the issue is added.

Exampleissue = 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 stoppedresponding.")

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 stoppedresponding.")

SetFileReadOnlySets or clears the read-only attribute on a file. Use to allow or prevent scripts frommodifying a file.

SyntaxSetFileReadOnly("FilePath", True/False)

543

Page 568: QA Wizard Pro User Guide v2017 - Perforce

SetDotNETProperty

Arguments

Argument Description

FilePath Full path to the file. See Identifying files and directories in statements, page 156 forinformation 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 tomake thefile 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.

SyntaxSetDotNETProperty("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

Page 569: QA Wizard Pro User Guide v2017 - Perforce

SetDotNETPropertyWithArgs

ExampleWindow("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.

SyntaxSetDotNETPropertyWithArgs("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

ExampleDim array(2)

array(1) = "ColumnName"

array(2) = 10 'row index

Window(".NET Window").Grid("CustomGrid").SetDotNETPropertyWithArgs("CellValue", array)

SetLowLevelSpeedSets the playback speed of low-level mouse actions. During playback, ow-level actions, which are recordedwhenQAWizard Pro does not recognize a control, can run at the recording speed or maximum speed (nodelay between steps).

For example, you can run low-level actions at themaximum speed if the script has several mousemovestatements and the playback speed set for other actions is too slow to perform the low-level actions.

545

Page 570: QA Wizard Pro User Guide v2017 - Perforce

SetPlaybackDelay

Note: This statement overrides the default low-level action playback speed set in the Options dialog box.See Setting playback options, page 76.

SyntaxSetLowLevelSpeed(Speed)

Arguments

Argument Description

Speed Playback speed inmilliseconds. Use defaultspeed to run low-level actions at the recordingspeed or maximumspeed to run actions at themaximum speed.

ExampleSetLowLevelSpeed(maximumspeed)

SetPlaybackDelaySets the number of milliseconds to wait between statements during playback. Use this statement to adjustthe playback speed if the default speed is too fast or slow.

SyntaxSetPlaybackDelay(Delay)

Arguments

Argument Description

Delay Number of milliseconds to wait between each statement.

ExampleSetPlaybackDelay(10000)

SetPlaybackSessionNameSets the name for the playback session sent to the QAWizard Pro Server. Overwrites the previously setname if usedmultiple times during a session.

Note: Youmust enable sending playback data to store sessions on the server. See Setting serverconnection options, page 43.

SyntaxSetPlaybackSessionName(Name)

546

Page 571: QA Wizard Pro User Guide v2017 - Perforce

SetRowValue

Arguments

Argument Description

Name Playback session name.

ExampleSetPlaybackSessionName("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.

SyntaxSetRowValue(Recordset/DataRow, "ColumnName", "Value")

Arguments

Argument Description

Recordset/DataRow Recordset or data row name. Must be opened with OpenRecordset, page 504 orOpenRecordsetQuery, page 505.

ColumnName Column name to add the value to.

Value Value to set.

Examplebugs = OpenRecordset("WysiCorp Bugs")

lastName = SetRowValue(bugs, "Last Name", "Jones")

SetScriptVariableSets the value of a variable defined in a called script.

SyntaxSetScriptVariable("ScriptName", "VariableName", NewValue)

547

Page 572: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleSetScriptVariable("WysiCorp Login", "LoginPswd", "qapswd")

SetTextEnters a value in a control and replaces existing text.

To enter text at the current cursor position, use the TypeText, page 566 statement.

SyntaxSetText("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

ExampleWindow("CRMLogin").EditBox("textBoxPassword").SetText("sales")

SetTimeSets 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/timestatements, page 327.

SyntaxSetTime("Time")

548

Page 573: QA Wizard Pro User Guide v2017 - Perforce

SetValue

Arguments

Argument Description

Time Time to set. Use the format defined in system regional settings (e.g., HH:MM:SS).

Supported objects

DateTimePicker

ExampleWindow("Add Note").DateTimePicker("dateEventPicker").SetTime("2:31:32 PM")

SetValueSets a value on a slider or spin box control.

Note: To set values in JSONArrays and JSONObjects, see SetValue - JSONArray, page 549 andSetValue - JSONObject, page 550.

SyntaxSetValue("Value")

Arguments

Argument Description

Value Value to set. Null values must be converted to empty strings before used.

Supported objects

Slider, SpinBox

ExampleWindow("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.

SyntaxSetValue(Index, "Value")

549

Page 574: QA Wizard Pro User Guide v2017 - Perforce

SetValue - JSONObject

Arguments

Argument Description

Index Index in the JSONArray. Indexes are zero based. If the index is greater than the size of thearray, 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 aJSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

Supported objects

JSONArray

ExamplejsonArray = 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.

SyntaxSetValue("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. Ifa JSONObject or JSONArray is used, a copy is created and inserted into theJSONObject.

Supported objects

JSONObject

ExamplejsonObject = JSONNewObject()

jsonObject.SetValue("PropertyName1", 1)

550

Page 575: QA Wizard Pro User Guide v2017 - Perforce

SimulateDriveReadOnly

SimulateDriveReadOnlySimulates a read-only drive.

Note: This statement cannot be used tomake read-only drives writable, such as CD-ROM drives.

SyntaxSimulateDriveReadOnly(DriveLetter, DriveModeReadOnlyOn)

Arguments

Argument Description

DriveLetter Drive letter for the read-only drive.

DriveModeReadOnlyOn True enables read-only drive simulation and False disables it.

ExampleSimulateDriveReadOnly("C", True)

Window("WysiCorp CRM").Menu("MenuBar").Select("File/Save")

Window("Error").CheckExists()

SimulateDriveReadOnly("C", False)

SimulateDriveRemainingSpaceSimulates a drive with remaining free space. The amount of remaining space cannot bemore than theavailable drive space.

For example, if you are testing an application that deletes temporary files to free up space, you can simulate adrive that does not have enough free space to save files. When the application deletes the files, more space isavailable 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.

SyntaxSimulateDriveRemainingSpace(DriveLetter, MegabytesRemaining)

Arguments

Argument Description

DriveLetter Drive letter for the simulated drive.

MegabytesRemaining Number of available megabytes on the drive. Use floating point values forfractions or SimulationOff to turn off the simulation.

551

Page 576: QA Wizard Pro User Guide v2017 - Perforce

SimulateMemoryPerAllocationLimit

ExampleSimulateDriveRemainingSpace("C", 0)

Window("WysiCorp CRM").Menu("MenuBar").Select("File/Save")

Window("Error").Button("OK").Click()

SimulateDriveReadOnly("C", SimulationOff)

SimulateMemoryPerAllocationLimitSimulates themaximum amount of memory available to the application for each allocation attempt.

Note: This statement simulates physical memory at the operating system level andmay cause runtimeenvironments, such as .NET Framework, to behave unexpectedly.

SyntaxSimulateMemoryPerAllocationLimit(MaxMegabytesPerAllocation)

Arguments

Argument Description

MaxMegabytesPerAllocation Maximum number of megabytes allowed per allocation. Use floating pointvalues for fractions or SimulationOff to turn off the simulation.

ExampleSimulateMemoryPerAllocationLimit(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)

SimulateMemoryRemainingSpaceSimulates memory with an amount of remaining free space.

Note: This statement simulates physical memory at the operating system level andmay cause runtimeenvironments, such as .NET Framework, to behave unexpectedly.

SyntaxSimulateMemoryRemainingSpace(MegabytesRemaining)

552

Page 577: QA Wizard Pro User Guide v2017 - Perforce

Sin

Arguments

Argument Description

MegabytesRemaining Number of megabytes allocated in physical memory by the application. Usefloating point values for fractions or SimulationOff to turn off the simulation.

ExampleWindow("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.

SyntaxSin(Number)

Arguments

Argument Description

Number Number to return the sine for. To convert degrees to radians, multiply by pi/180. To convertradians to degrees, multiply by 180/pi.

Return value

Value Description

Value Sine of the number.

Examplesine = Sin(45)

553

Page 578: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxSize()

Supported objects

PropertyMap

Return value

Value Description

Value Number of properties in the PropertyMap.

ExamplepropertyMap = 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.

SyntaxSRand()

ExampleSRand()

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

Page 579: QA Wizard Pro User Guide v2017 - Perforce

StartStopwatch

Case Else

PrintLn("Number 5 was chosen")

End Select

StartStopwatchStarts or restarts the stopwatch tomeasure elapsed time.

To stop the stopwatch, use the StopStopwatch, page 556 statement. To reset the stopwatch to zero, use theResetStopwatch, page 520 statement.

SyntaxStartStopwatch()

ExampleStartStopwatch()

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.

SyntaxStartsWithSubStr("FullString", "Substring", IsCaseSensitive)

Arguments

Argument Description

FullString Full string to search.

Substring Substring to search for in the full string.

IsCaseSensitive Case sensitive search. Truematches the substring case. False ignores the case. If notspecified, True is used.

555

Page 580: QA Wizard Pro User Guide v2017 - Perforce

Stop

Return value

Value Description

True String starts with the substring.

False String does not start with the substring.

ExampleproductName = Window("Bug Reporter").HTMLElement("elementProductName").Property("InnerText")

CheckpointExpression(StartsWithSubStr(productName, "WysiCorp", True), True, "Product namedoes not start with WysiCorp")

StopStops loading the current page in a browser.

SyntaxStop()

Supported objects

Browser

ExampleBrowser("Feedback Acknowledgment").Stop()

StopStopwatchStops the stopwatch without resetting it.

To restart the stopwatch, use the StartStopwatch, page 555 statement. To reset the stopwatch to zero, usethe ResetStopwatch, page 520 statement.

SyntaxStopStopwatch()

ExampleStartStopwatch()

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

Page 581: QA Wizard Pro User Guide v2017 - Perforce

Str

Str

Note: This statement is named String in the Add Statement dialog box.

Converts a value and returns it as a string.

SyntaxStr(Value)

Arguments

Argument Description

Value Value to convert.

Return value

Value Description

Value Converted string.

ExampletestString = 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 ordercomparison. The comparison uses the test computer's cultural settings for culture-specific sortinginformation, such as casing rules and the order of individual characters.

SyntaxStrCompare("FirstString", "SecondString", IsCaseSensitive)

Arguments

Argument Description

FirstString First string.

SecondString Second string.

IsCaseSensitive Case sensitive comparison. Truematches the string case. False ignores the case. Ifnot specified, True is used.

557

Page 582: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampleproductA = "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.

SyntaxStrEquals("FirstString", "SecondString", IsCaseSensitive)

Arguments

Argument Description

FirstString First string.

SecondString Second string.

IsCaseSensitive Case sensitive comparison. Truematches the string case. False ignores the case. Ifnot specified, True is used.

Return value

Value Description

True Strings match.

False Strings do not match.

ExamplemyStr1 = "WysiCorp"

myStr2 = "wysicorp"

558

Page 583: QA Wizard Pro User Guide v2017 - Perforce

TestCaseStep

If (StrEquals(myStr1, myStr2, True)) Then

PrintLn("Strings match")

Else

PrintLn("Strings do not match")

End If

TestCaseStepIndicates the beginning of a Helix ALM test case step.

This statement is automatically created from existing steps when creating scripts from test cases. Theactions to perform the step or the expected results must follow this statement. See Creating scripts fromHelix ALM test cases, page 272.

Note: This statement cannot be used in load test scripts.

SyntaxTestCaseStep("Name", "Description")

Arguments

Argument Description

Name Step name.

Description Step description.

ExampleTestCaseStep("Step 1", "Enter username in User field.")

Window("WysiCorp CRMLogin").EditBox("textBoxUser").TypeText("sales")

TestCaseStep("Expected result 1", "Username appears in User field.")

ThrowRegenerates the error handled by the containing Catch block. Can only be used in a Catch block. SeeTry...Catch...Finally, page 565.

SyntaxThrow()

ExampleSub SubWithTryCatch

Try

Err.Raise(6, "mySource", "New Error")

PrintLn("Statement cannot run because error was thrown")

559

Page 584: QA Wizard Pro User Guide v2017 - Perforce

Time

Catch

PrintLn("Err 2: " + Err.Description())

'Throw() 'Clear the comment on this Throw statement and first PrintLn in Catchblock 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

TimeReturns time in seconds since the epoch (January 1, 1970 12:00 AM).

SyntaxTime()

Return value

Value Description

Value Time in seconds since the epoch.

ExamplesecondsSinceEpoch = Time()

TodayReturns the current date in MM/DD/YYYY format.

560

Page 585: QA Wizard Pro User Guide v2017 - Perforce

ToString - JSONArray

SyntaxToday()

Return value

Value Description

Value Current date.

ExamplecurrentDate = 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.

SyntaxToString(PrettyPrint)

Arguments

Argument Description

PrettyPrint True adds white space to the string so results are easier to read. False does not add whitespace. If not specified, False is used.

Supported objects

JSONArray

Return value

Value Description

Value Converted string.

ExamplePrintLn(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

Page 586: QA Wizard Pro User Guide v2017 - Perforce

TouchDown

SyntaxToString(PrettyPrint)

Arguments

Argument Description

PrettyPrint True adds white space to the string so results are easier to read. False does not add whitespace. If not specified, False is used.

Supported objects

JSONObject

Return value

Value Description

Value Converted string.

ExamplePrintLn(jsonObject.ToString(True))

TouchDownPerforms a touch action in a location.

Use this statement with TouchMove, page 563 and TouchUp, page 564 to perform tap, swipe, and pinchzoom actions in scripts that test Windows 8 applications and to test applications that can interpret touchactions.

Note: This statement is not recorded andmust bemanually added to scripts.

SyntaxTouchDown(X, Y, ...)

Arguments

You can specify amaximum 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

Page 587: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleWindow("LeaveAComment").EditBox("editComment").TouchDown(100, 100)

TouchMoveMoves 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 interprettouch actions.

Note: This statement is not recorded andmust bemanually added to scripts.

SyntaxTouchMove(X, Y, ...)

Arguments

You can specify amaximum of 16 locations.

Argument Description

X X coordinate to indicate the horizontal pixel location tomove the touch action, relative to thescreen or a window or control.

Y Y coordinate to indicate the vertical pixel location tomove the touch action, relative to thescreen 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

Page 588: QA Wizard Pro User Guide v2017 - Perforce

TouchUp

TouchUpRemoves a touch action in a location.

Use this statement with TouchDown, page 562 and TouchMove, page 563 to perform tap, swipe, and pinchzoom actions in scripts that test Windows 8 applications and to test applications that can interpret touchactions.

Note: This statement is not recorded andmust bemanually added to scripts.

SyntaxTouchUp(X, Y, ...)

Arguments

You can specify amaximum 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, relativeto 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)

TrimReturns a string with the leading and trailing spaces removed.

SyntaxTrim("String")

564

Page 589: QA Wizard Pro User Guide v2017 - Perforce

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.

ExampletrimmedText = Trim(" QA Wizard Pro")

Try...Catch...FinallyWraps a block of statements where errors may occur. Statements in the Try block run until an error occurs. Ifan error occurs, the Errors pane, status tool, run report, and Err object are updated with error information andplayback 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, butFinally must be used last to avoid a syntax error. Try...Catch...Finally statements can be nested in otherTry...Catch...Finally statements. If a Catch block is not included before a Finally block, the next Catch blockup the call stack runs after the Finally statements run.

SyntaxTry

[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 statementsare used.

FinallyStatements Statements to run after all other error processing occurs. Optional if Catch statementsare used.

565

Page 590: QA Wizard Pro User Guide v2017 - Perforce

TypeText

ExampleTry

If x <> y Then

Fail("x does not equal y")

End If

Catch

x = y

Finally

PrintLn("x equals y")

End Try

TypeTextEnters text in a control or at the application level.

To replace all text in an edit box, use the SetText, page 548 statement.

SyntaxTypeText("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")

UpperConverts characters to uppercase and returns the string.

SyntaxUpper("String")

566

Page 591: QA Wizard Pro User Guide v2017 - Perforce

UserName

Arguments

Argument Description

String String to convert.

Return value

Value Description

Value Converted uppercase string.

ExampleuppercaseString = Upper("qa wizard pro")

UserNameReturns the username of the current user logged in toWindows on the computer running the script. If scriptsrun remotely, the logged in username on the remote test computer is returned.

SyntaxUserName()

Return value

Value Description

Value Username of the current user.

ExamplecurrentUser = UserName()

PrintLn("Tester: " + currentUser)

WaitForExistsWaits a period of time for a window or control to exist before continuing with the next statement and returnsTrue or False to indicate if it is found.

This statement is often used with conditional statements to handle known exceptions. For example, you canuse it to determine if a window, control, or page is displayed before performing actions. See Handling knownexceptions, page 155.

SyntaxWaitForExists(WaitTime)

567

Page 592: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleWindow("Feedback").HTMLLink("linkSubmit").WaitForExists(5000)

WaitForExistsTimedWaits a period of time for a window or control to exist before continuing with the next statement and returnsthe number of milliseconds it took to find it.

This statement is often used with conditional statements to handle known exceptions. For example, you canuse 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.

SyntaxWaitForExistsTimed(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

Page 593: QA Wizard Pro User Guide v2017 - Perforce

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

ExamplefindTime = 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

WaitForPropertyWaits a period of time to find a value in a window or control property before continuing with the next statementand returns True or False to indicate if it is found.

SyntaxWaitForProperty("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

Page 594: QA Wizard Pro User Guide v2017 - Perforce

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

ExampleIf 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

WarningDisplays a warningmessage in the Errors pane and adds it to the run report. Use this statement to stayinformed 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 warningmessage and stop the script, use the Fail, page 408 statement.

SyntaxWarning("WarningMessage")

Arguments

Argument Description

WarningMessage Warningmessage to display in the Errors pane and run report.

ExampleregValue = 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

Page 595: QA Wizard Pro User Guide v2017 - Perforce

WebAddSessionVariable

To clear the network credentials cache, use theWebClearNetworkCredentials, page 572 statement.

SyntaxWebAddNetworkCredential("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.

ExampleWebAddNetworkCredential("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 theWebGet, page 574 andWebPost, page581 statements and replaces the variable value captured during recording with the value returned from the webserver. The web server response value is used to update input data inWebGet andWebPost statements thatfollow this statement.

This statement must bemanually added to load test scripts. See Adding statements, page 146.

To stop updating form variables, use theWebRemoveSessionVariable, page 587 orWebRemoveAllSessionVariables, page 586 statement.

SyntaxWebAddSessionVariable("FormVariable")

Arguments

Argument Description

FormVariable Variable to update in sessions.

ExampleWebAddSessionVariable("sessionid")

571

Page 596: QA Wizard Pro User Guide v2017 - Perforce

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 webrequests.

SyntaxWebClearAllCustomHeaders()

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 sentwith all web requests.

SyntaxWebClearNetworkCredentials()

ExampleWebAddNetworkCredential("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 andWebPost, page 581statements remain open while statements that follow them run. Web servers may close the connections atany time, but you can use this statement to ensure all connections are closed before the load test finishes.

To close an individual connection, use theWebCloseConnection, page 573 statement.

SyntaxWebCloseAllConnections()

572

Page 597: QA Wizard Pro User Guide v2017 - Perforce

WebCloseConnection

ExampleWebPost("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 andWebPost, page 581statements remain open while statements that follow them run. Web servers may close the connections atany 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 theWebCloseAllConnections, page 572 statement.

SyntaxWebCloseConnection("Server")

Arguments

Argument Description

Server URL for the web server to close the connection to. Must include the http or https protocol.

ExampleWebCloseConnection("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 aweb page. If a referrer URLwas specified bytheWebSetReferrer, page 589 statement, it is also sent with the request.

SyntaxWebDelete("URL")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

573

Page 598: QA Wizard Pro User Guide v2017 - Perforce

WebGet

Return value

Value Description

Value Data received from the web page.

Exampleresult = 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 aweb page If a referrer URLwas specified by theWebSetReferrer, page 589 statement, it is also sent with the request.

SyntaxWebGet("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

VariableName Variable name to pass to the web page. You can pass multiple variables as part of theURL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded whensent to the web server.

Return value

Value Description

Value Data received from the web page.

Exampleresult = 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

Page 599: QA Wizard Pro User Guide v2017 - Perforce

WebGetCookie

SyntaxWebGetAllCustomHeaders()

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 Tryblock

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 aWebSetCookie, page 588, WebGet, page 574, orWebPost, page 581statement.

575

Page 600: QA Wizard Pro User Guide v2017 - Perforce

WebGetCustomHeader

SyntaxWebGetCookie("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.

<Empty string> Cookie was not set.

Examplecookie = 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 aWebSetCustomHeader, page 588 statement.

SyntaxWebGetCustomHeader("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

Page 601: QA Wizard Pro User Guide v2017 - Perforce

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 Tryblock

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 aWebSetReferrer, page 589 statement.

SyntaxWebGetReferrer()

Return value

Value Description

Value Referrer URL.

<Empty string> Referrer does not exist.

Examplereferrer = WebGetReferrer()

577

Page 602: QA Wizard Pro User Guide v2017 - Perforce

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 orsettings used when running the script. See Running load tests, page 104 and Running load tests from acommand prompt, page 106.

SyntaxWebGetUserAgent()

Return value

Value Description

Value Browser user agent.

Exampleuseragent = 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 aweb page. If a referrer URLwas specified bytheWebSetReferrer, page 589 statement, it is also sent with the request.

SyntaxWebHead("URL")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

Return value

Value Description

Value Data received from the web page.

Exampleresult = WebHead("http://www.wysicorp.com/form.php")

578

Page 603: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxWebOptions("URL")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

Return value

Value Description

Value Requests accepted by the web server.

<Empty string> Web server response did not include accepted requests.

Exampleresult = 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 aweb page. If a referrer URLwas specified bytheWebSetReferrer, page 589 statement, it is also sent with the request.

This statement uses the default application/x-www-form-urlencoded content type. Use theWebPatchFromFile, page 580 statement to patch from other content types.

SyntaxWebPatch("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

579

Page 604: QA Wizard Pro User Guide v2017 - Perforce

WebPatchFromFile

Argument Description

VariableName Variable name to pass to the web page. You can pass multiple variables as part of theURL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded whensent to the web server.

Return value

Value Description

Value Data received from the web page.

Exampleresult = 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 aweb page. If a referrer URLwasspecified by theWebSetReferrer, page 589 statement, it is also sent with the request.

This statement uses a specified content type. Use theWebPatch, page 579 statement to patch from thedefault application/x-www-form-urlencoded content type.

SyntaxWebPatchFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically 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

Page 605: QA Wizard Pro User Guide v2017 - Perforce

WebPatchJSON

Exampleresult = 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 aweb page. If areferrer URLwas specified by theWebSetReferrer, page 589 statement, it is also sent with the request.

SyntaxWebPatchJSON("URL", JSON)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically 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 aweb page. If a referrer URLwas specified bytheWebSetReferrer, page 589 statement, it is also sent with the request.

This statement uses the default application/x-www-form-urlencoded content type. Use theWebPostFromFile, page 582 statement to post from other content types.

581

Page 606: QA Wizard Pro User Guide v2017 - Perforce

WebPostFromFile

SyntaxWebPost("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

VariableName Variable name to pass to the web page. You can pass multiple variables as part of theURL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded whensent to the web server.

Return value

Value Description

Value Data received from the web page.

Exampleresult = 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 aweb page. If a referrer URLwas specified by theWebSetReferrer, page 589 statement, it is also sent with the request.

This statement uses a content type. Use theWebPost, page 581 statement to post a default application/x-www-form-urlencoded content type file.

SyntaxWebPostFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

582

Page 607: QA Wizard Pro User Guide v2017 - Perforce

WebPostJSON

Argument Description

ContentType Content type of the postdata file. Valid content types depend on the web serverconfiguration.

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.

Exampleresult = 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 aweb page. If a referrerURLwas specified by theWebSetReferrer, page 589 statement, it is also sent with the request.

SyntaxWebPostJSON("URL", JSON)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically 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

Page 608: QA Wizard Pro User Guide v2017 - Perforce

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 aweb page. If a referrer URLwas specified by theWebSetReferrer, page 589 statement, it is also sent with the request.

This statement uses the default application/x-www-form-urlencoded content type. Use theWebPutFromFile,page 584 statement to put from other content types.

SyntaxWebPut("URL", "VariableName", "VariableValue", ...)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

VariableName Variable name to pass to the web page. You can pass multiple variables as part of theURL. Separate variable names and values with a comma.

VariableValue Variable value to pass to the web page. All values are automatically URL encoded whensent to the web server.

Return value

Value Description

Value Data received from the web page.

Exampleresult = 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 aweb page. If a referrer URLwasspecified by theWebSetReferrer, page 589 statement, it is also sent with the request.

This statement uses a content type. Use theWebPut, page 584 statement to put from the defaultapplication/x-www-form-urlencoded content type.

584

Page 609: QA Wizard Pro User Guide v2017 - Perforce

WebPutJSON

SyntaxWebPutFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically 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.

Exampleresult = 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 aweb page. If a referrerURLwas specified by theWebSetReferrer, page 589 statement, it is also sent with the request.

SyntaxWebPutJSON("URL", JSON)

Arguments

Argument Description

URL URL to send the request to. Only supports http and https protocols. Relative paths areautomatically prepended with the%URLROOT% repository variable.

JSON JSON to attach to the request.

585

Page 610: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxWebRemoveAllSessionVariables()

ExampleWebAddSessionVariable("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 aWebSetCustomHeader, page 588 statement from the list of headers sentwith all web requests.

SyntaxWebRemoveCustomHeader("Header")

Arguments

Argument Description

Header Header name.

Example'Gets existing custom headers and checks if AccessToken header exists

headers = WebGetAllCustomHeaders()

586

Page 611: QA Wizard Pro User Guide v2017 - Perforce

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 Tryblock

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 aWebAddSessionVariable, page 571 statement for all web requests.

SyntaxWebRemoveSessionVariable("FormVariable")

Arguments

Argument Description

FormVariable Variable to stop updating.

ExampleWebRemoveSessionVariable("sessionid")

587

Page 612: QA Wizard Pro User Guide v2017 - Perforce

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.

SyntaxWebSetCookie("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 allsubdomains. False does not send the cookie to any subdomains. If not specified, Falseis used.

ExampleWebSetCookie("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.

SyntaxWebSetCustomHeader("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

Page 613: QA Wizard Pro User Guide v2017 - Perforce

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 Tryblock

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.

SyntaxWebSetReferrer("Referrer")

Arguments

Argument Description

Referrer Referrer URL. Relative paths are automatically prepended with the%URLROOT% repositoryvariable. If the referrer is not specified, the URL is cleared.

ExampleWebSetReferrer("http://www.wysicorp.com/")

589

Page 614: QA Wizard Pro User Guide v2017 - Perforce

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.

Someweb pages may change behavior depending on the browser. The user agent string is passed to theapplication to identify the browser. You can create custom agents to simulate different browser versions orautomated web crawlers for searches.

SyntaxWebSetUserAgent("UserAgent")

Arguments

Argument Description

UserAgent User agent to send.

Tip: To view a list of user agent constants, chooseScript > Add Statement and select this statement inthe Load Testing category. To find a user agent string, chooseScript > Run Load Test and click Add inthe Browsers area. Select aBrowser in the Add Browser dialog box and copy theUser Agent string tothe statement argument.

ExampleWebSetUserAgent("USERAGENT_FIREFOX2")

WeekdayReturns a weekday integer that represents the day of the week for a date.

SyntaxWeekday("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 isMonday, etc.

590

Page 615: QA Wizard Pro User Guide v2017 - Perforce

WeekdayName

ExampleDayOfWeek = Weekday("8-June-2016")

WeekdayNameReturns a weekday name based on a weekday integer. 1 is Sunday, 2 is Monday, etc.

SyntaxWeekdayName(WeekdayInteger)

Arguments

Argument Description

WeekdayInteger Weekday integer.

Return value

Value Description

Value Weekday name that corresponds with the integer.

ExampledayOfWeek = WeekdayName(3)

WeekdayNumReturns a weekday integer based on a weekday name. Sunday is 1, Monday is 2, etc.

SyntaxWeekdayNum("WeekdayName")

Arguments

Argument Description

WeekdayName Weekday name.

Return value

Value Description

Value Integer that corresponds with the weekday name.

ExamplenumberDayOfWeek = WeekdayNum("Thursday")

591

Page 616: QA Wizard Pro User Guide v2017 - Perforce

While

WhileRuns a block of statements as long as a condition is True or until an Exit While statement runs.

During playback, theWhile statement condition is evaluated at the beginning of the loop. If the condition isTrue, statements in the loop run. If the condition is False, statements in the loop do not run and playbackcontinues with the first statement outside the block.

Note: Do...Loop Until, page 388 and Do...LoopWhile, page 389 statements provide amore structured andflexible way to perform loops.

SyntaxWhile 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.

ExampleWhile 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()

WriteRegistryEntrySets a registry key value on the test computer. For example, if an application writes to the registry after anaction 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

Page 617: QA Wizard Pro User Guide v2017 - Perforce

Year

SyntaxWriteRegistryEntry("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.

ExampleWriteRegistryEntry("HKEY_CURRENT_USER\\Software\\WysiCorp", "Name", "Developer Name")

YearReturns the year from a date/time value.

SyntaxYear("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.

ExamplecurrentDate = Now()

rtnYear = Year(currentDate)

OperatorsQAWizard Pro supports the following operators.

593

Page 618: QA Wizard Pro User Guide v2017 - Perforce

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, page596

^ Raises a number to the power Exponentiation operator, page596

= 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 thesecond

< 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 operatorAdds 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

Page 619: QA Wizard Pro User Guide v2017 - Perforce

And operator

Item Description

result Any numeric variable

expression1 Any expression

expression2 Any expression

When you use the + operator, youmay not be able to determine whether addition or string concatenation willoccur. 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 operatorPerforms 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 isfalse. 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 operatorAssigns a value to a variable or property. Name can be a simple variable or an element of an array. Value canbe a text string, expression, function, variable, or datasheet value. Uses the equal sign (=) operator.variable = value

595

Page 620: QA Wizard Pro User Guide v2017 - Perforce

Concatenation operator

Item Description

variable Any variable or writable property

value Any numeric or string literal, constant, or expression

Concatenation operatorForces string concatenation of two expressions. If an expression is not a string, it is converted to a stringsubtype. 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 operatorDivides 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 operatorRaises a number to the power of an exponent. Uses the caret (^) operator.result = number ^ exponent

596

Page 621: QA Wizard Pro User Guide v2017 - Perforce

Is operator

Item Description

result Any numeric variable

number Any numeric expression

exponent Any numeric expression

Is operatorCompares 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 isfalse.

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, theresult is true, and the CreateObject statement creates the InternetExplorer object, which is assigned as the IEvariable value. If the variable value is set, the result is false, the CreateObject statement does not run, and thescript continues with the steps outside of the If statement block.If IE Is Nothing Then

IE = CreateObject("InternetExplorer.Application")

End If

Mod operatorDivides two numbers and returns only the remainder.result = number1 Mod number2

Item Description

result Any numeric variable

number Any numeric expression

Multiplication operatorMultiplies two numbers. Uses the asterisk (*) operator.result = number1 * number2

597

Page 622: QA Wizard Pro User Guide v2017 - Perforce

Negation operator

Item Description

result Any numeric variable

number1 Any numeric expression

number2 Any numeric expression

Negation operatorIndicates the negative value of a numeric expression. Uses the hyphen (-) operator.result = -number

Item Description

result Any numeric variable

number Any numeric expression

Not operatorPerforms 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 operatorPerforms a logical disjunction on two expressions.result = expression1 Or expression2

Item Description

result Any numeric variable

expression Any Boolean expression

598

Page 623: QA Wizard Pro User Guide v2017 - Perforce

Subtraction operator

If one or both expressions evaluate to true, the result is true. The following table shows how the result isdetermined.

Expression 1 Expression 2 Result

True True True

True False True

False True True

False False False

Subtraction operatorFinds 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 operatorPerforms 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 isdetermined.

Expression 1 Expression 2 Result

True True False

True False True

False True True

599

Page 624: QA Wizard Pro User Guide v2017 - Perforce

Constants

Expression 1 Expression 2 Result

False False False

ConstantsQAWizard 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 quotationmark

Newline New line character

Singlequote Single quotationmark

Comparison

Nothing Uninitialized object value

Null No valid data

Directory

QAWApplication Directory where the application last started by the RunApp statement in anindividual script run is stored

QAWCurrent Current QAWizard 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

Page 625: QA Wizard Pro User Guide v2017 - Perforce

Constants

Constant Description

WinApplicationData Directory that stores application-specific data for the current roaming user(e.g., C:\Users\<username>\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:\ProgramFiles (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\StartMenu\Programs)

WinRecent Directory that stores themost 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

Page 626: QA Wizard Pro User Guide v2017 - Perforce

Constants

Constant Description

WinStartup Directory that stores the startup program group (e.g.,C:\Users\username\AppData\Roaming\Microsoft\Windows\StartMenu\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, orunexpected arguments.

Default Default run-time playback speed

602

Page 627: QA Wizard Pro User Guide v2017 - Perforce

Keywords

Constant Description

Defaultspeed Default low-level action playback speed

FunctionErrorNumber Playback error number 4. Assigned to errors generated by built-in functionsand statements.

InDebugMode Determines if script is running in debugmode

Maximumspeed Maximum low-level action playback speed

ObjectActionErrorNumber Playback error number 1. Assigned to errors that indicate a control was notfound 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).

KeywordsKeywords are reserved words in the QAWizard Pro scripting language that cannot be used as variables oridentifiers. 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

Page 628: QA Wizard Pro User Guide v2017 - Perforce

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 withReDim.

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

Page 629: QA Wizard Pro User Guide v2017 - Perforce

Date/time format examples

n AscB

n AscW

n Atn

n ByRef

n ByVal

n Call

n CBool

n CByte

n CDate

n CDb

n ChrBl

n ChrW

n Cint

n CLng

n CSng

n CStr

n DateSerial

n DateValue

n Eqv

n Exp

n Fix

n Hex

n Imp

n InputBox

n Instr

n InStrB

n Int

n IsArray

n LBound

n Lcase

n LeftB

n Len

n LenB

n Let

n Log

n Ltrim

n MidB

n MsgBox

n Oct

n Private

n Public

n Randomize

n RightB

n Rtrim

n Sgn

n Space

n Sqr

n StrComp

n Tan

n TimeSerial

n TimeValue

n UBound

n Ucase

n VarType

Date/time format examplesFollowing are examples of valid date/time strings that QAWizard 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 1May 2008 2:57:32.8 PM

n Fri, 15May 2009 20:10:57 GMT

n 1/3/2009

n 3:45PM

QA Wizard Pro environment variablesThe following QAWizard Pro environment variables are available. They are set when a workspace is openedin QAWizard Pro, scripts run, or batch files run.

Note: These variables are commonly used with the GetEnv statement. SeeGetEnv, page 431.

Variable Description

QAWDIR QAWizard Pro application directory path (e.g., C:\Program Files(x86)\Perforce\QA Wizard Pro)

605

Page 630: QA Wizard Pro User Guide v2017 - Perforce

QA Wizard Pro environment variables

Variable Description

ROOTSAMPLEWSDIR QAWizard ProWorkspaces directory path (e.g.,C:\Users\<username>\Documents\My Documents\QA Wizard ProWorkspaces)

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

Page 631: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies andControlsn Supported controls are recognized by QAWizard 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 aresupported. The list includes known partially-supported controls, but other controls or controls derived fromsupported 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 StudioSupported:

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: QAWizard 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

Page 632: QA Wizard Pro User Guide v2017 - Perforce

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

DevExpressSupported:

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

Page 633: QA Wizard Pro User Guide v2017 - Perforce

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

Page 634: QA Wizard Pro User Guide v2017 - Perforce

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 SWTSupported:

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

Page 635: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

HTML

Note: QAWizard Pro supports all HTML4 and earlier elements in the supported versions of GoogleChrome, Microsoft Internet Explorer, andMozilla Firefox. See theQAWizard Pro System Requirementsfor a list of supported browsers.

The following HTML5 elements are captured in browsers that support HTML5.

Supported:

n <article>

n <aside>

n <details>

n <embed>

n <figcaption>

n <figure>

n <footer>

n <header>

n <hgroup>

n <mark> (Chrome and Firefox only)

n <meter>

n <nav>

n <output>

n <progress>

n <rp> (Chrome and Firefox only)

n <rt> (Chrome and Firefox only)

n <ruby>

n <section>

Partially supported:

n <input type="email">—The popup for validating email addresses is not captured.

n <input type="search">—The 'x' icon added in Chrome is not captured.

n <input type="url">—The popup for validating URL addresses is not captured.

Infragistics .NET Windows FormsSupported:

n Infragistics.Win.CheckEditor

n Infragistics.Win.EditorWithCombo

n Infragistics.Win.EditorWithMask

611

Page 636: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n Infragistics.Win.EditorWithText

n Infragistics.Win.FontNameEditor

n Infragistics.Win.Misc.UltraButton

n Infragistics.Win.Misc.UltraGroupBox

n Infragistics.Win.Misc.UltraLabel

n Infragistics.Win.OptionSetEditor

n Infragistics.Win.Printing.UltraPrintPreviewDialog

n Infragistics.Win.UltraWinEditors.UltraCheckEditor

n Infragistics.Win.UltraWinEditors.UltraComboEditor

n Infragistics.Win.UltraWinEditors.UltraCurrencyEditor

n Infragistics.Win.UltraWinEditors.UltraDateTimeEditor

n Infragistics.Win.UltraWinEditors.UltraFontNameEditor

n Infragistics.Win.UltraWinEditors.UltraNumericEditor

n Infragistics.Win.UltraWinEditors.UltraOptionSet

n Infragistics.Win.UltraWinEditors.UltraPictureBox

n Infragistics.Win.UltraWinEditors.UltraTextEditor

n Infragistics.Win.UltraWinEditors.UltraTimeZoneEditor

n Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar

n Infragistics.Win.UltraWinGrid.UltraCombo

n Infragistics.Win.UltraWinGrid.UltraGrid

n Infragistics.Win.UltraWinListView.UltraListView

n Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit

n Infragistics.Win.UltraWinScrollBar.UltraScrollBar

n Infragistics.Win.UltraWinTabControl.UltraTabControl

n Infragistics.Win.UltraWinTabControl.UltraTabStripControl

n Infragistics.Win.UltraWinToolbars.ButtonTool

n Infragistics.Win.UltraWinToolbars.EditorToolBase

n Infragistics.Win.UltraWinToolbars.LabelToolBase

n Infragistics.Win.UltraWinToolbars.ListTool

n Infragistics.Win.UltraWinToolbars.PopupToolBase

n Infragistics.Win.UltraWinToolbars.UltraToolbarBase

n Infragistics.Win.UltraWinToolbars.Ribbon

n Infragistics.Win.UltraWinTree.UltraTree

Partially supported:

612

Page 637: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n Infragistics.Win.Misc.UltraDropDownButton

n Infragistics.Win.Misc.UltraPopupControlContainer

n Infragistics.Win.ProgressBarEditor

n Infragistics.Win.UltraWinDock.UltraDockManager

n Infragistics.Win.UltraWinGrid.UltraDropDown

n Infragistics.Win.UltraWinGrid.UltraGridColumnChooser

n Infragistics.Win.UltraWinToolbars.ToolBase

n Infragistics.Win.UltraWinToolbars.UltraToolbarsManager

Janus Systems .NET Windows FormsSupported:

n Janus.Windows.EditControls.UIButton

n Janus.Windows.EditControls.UICheckBox

n Janus.Windows.EditControls.UIComboBox

n Janus.Windows.EditControls.UIComboBoxItem

n Janus.Windows.EditControls.UIProgressBar

n Janus.Windows.EditControls.UIRadioButton

n Janus.Windows.EditControls.UITrackBar

Microsoft .NET Windows Forms/Delphi .NET Windows FormsSupported:

n BindingNavigator

n Button

n CheckBox

n CheckedListBox

n ColorDialog

n ComboBox

n ContextMenuStrip

n DataGridView

n DateTimePicker

n DomainUpDown

n FlowLayoutPanel

n FolderBrowserDialog

n FontDialog

n GroupBox

613

Page 638: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n HScrollBar

n Label

n LinkLabel

n ListBox

n ListView

n MaskedTextBox

n MenuStrip

n MonthCalendar

n NumericUpDown

n OpenFileDialog

n PageSetupDialog

n Panel

n PictureBox

n PrintDialog

n PrintPreviewDialog

n ProgressBar

n PropertyGrid

n RadioButton

n RichTextBox

n SaveFileDialog

n SplitContainer

n Splitter

n TabControl

n TableLayoutPanel

n TextBox

n ToolBar

n ToolStrip

n ToolStripContainer

n ToolTip

n TrackBar

n TreeView

n VScrollBar

n WebBrowser

Partially supported:

614

Page 639: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n PrintPreviewControl

n ReportViewer

Microsoft .NET Windows Presentation Foundation (WPF)Supported:

n System.Windows.Application

n System.Windows.Controls.Button

n System.Windows.Controls.Calendar

n System.Windows.Controls.Canvas

n System.Windows.Controls.CheckBox

n System.Windows.Controls.ComboBox

n System.Windows.Controls.ComboBoxItem

n System.Windows.Controls.ContentControl

n System.Windows.Controls.ContextMenu

n System.Windows.Controls.Control 

n System.Windows.Controls.DockPanel

n System.Windows.Controls.Expander

n System.Windows.Controls.Frame

n System.Windows.Controls.Grid

n System.Windows.Controls.GridSplitter

n System.Windows.Controls.GridView

n System.Windows.Controls.GridViewColumn

n System.Windows.Controls.GridViewColumnHeader

n System.Windows.Controls.GroupBox

n System.Windows.Controls.HeaderedContentControl

n System.Windows.Controls.HeaderedItemsControl

n System.Windows.Controls.Image

n System.Windows.Controls.InkCanvas

n System.Windows.Controls.ItemsControl

n System.Windows.Controls.Label

n System.Windows.Controls.ListBox

n System.Windows.Controls.ListBoxItem

n System.Windows.Controls.ListView

n System.Windows.Controls.ListViewItem

n System.Windows.Controls.Menu

615

Page 640: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n System.Windows.Controls.MenuItem

n System.Windows.Controls.Page

n System.Windows.Controls.Panel

n System.Windows.Controls.PasswordBox

n System.Windows.Controls.Primitives.CalendarButton

n System.Windows.Controls.Primitives.CalendarDayButton

n System.Windows.Controls.Primitives.CalendarItem

n System.Windows.Controls.Primitives.MenuBase

n System.Windows.Controls.Primitives.ScrollBar

n System.Windows.Controls.Primitives.StatusBar

n System.Windows.Controls.Primitives.StatusBarItem

n System.Windows.Controls.Primitives.TabPanel

n System.Windows.Controls.Primitives.Thumb

n System.Windows.Controls.Primitives.TickBar

n System.Windows.Controls.Primitives.ToggleButton

n System.Windows.Controls.Primitives.ToolBarOverflowPanel

n System.Windows.Controls.Primitives.ToolBarPanel

n System.Windows.Controls.Primitives.Track

n System.Windows.Controls.Primitives.UniformGrid

n System.Windows.Controls.PrintDialog

n System.Windows.Controls.ProgressBar

n System.Windows.Controls.RadioButton

n System.Windows.Controls.RichTextBox

n System.Windows.Controls.ScrollViewer

n System.Windows.Controls.Separator

n System.Windows.Controls.Slider

n System.Windows.Controls.StackPanel

n System.Windows.Controls.TabControl

n System.Windows.Controls.TabItem

n System.Windows.Controls.TextBlock

n System.Windows.Controls.TextBox

n System.Windows.Controls.ToolBar

n System.Windows.Controls.ToolBarTray

n System.Windows.Controls.ToolTip

n System.Windows.Controls.TreeView

n System.Windows.Controls.TreeViewItem 

616

Page 641: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n System.Windows.Controls.UserControl

n System.Windows.Controls.ViewBase

n System.Windows.Controls.VirtualizingPanel

n System.Windows.Controls.VirtualizingStackPanel

n System.Windows.Controls.WebBrowser

n System.Windows.Controls.WrapPanel

n System.Windows.MessageBox

n System.Windows.SplashScreen

n System.Windows.Window

n System.Windows.Window.NavigationWindow

Partially supported:

n System.Windows.Controls.DocumentViewer

n System.Windows.Controls.FlowDocumentPageViewer

n System.Windows.Controls.FlowDocumentReader

n System.Windows.Controls.FlowDocumentScrollViewer

n System.Windows.Controls.Primitives.ButtonBase

n System.Windows.Controls.Primitives.MultiSelector

n System.Windows.Controls.Primitives.Popup

n System.Windows.Controls.Primitives.RangeBase

n System.Windows.Controls.Primitives.ResizeGrip

n System.Windows.Controls.Primitives.TextBoxBase

Microsoft Active Accessibility (MSAA)MSAA accessibility information is captured and the default accessibility action can be performed. MSAAinformation can also help QAWizard Pro identify common controls.

Supported:

n ROLE_SYSTEM_APPLICATION

n ROLE_SYSTEM_BORDER

n ROLE_SYSTEM_BUTTONDROPDOWN

n ROLE_SYSTEM_BUTTONDROPDOWNGRID

n ROLE_SYSTEM_BUTTONMENU

n ROLE_SYSTEM_CHECKBUTTON

n ROLE_SYSTEM_CLIENT

n ROLE_SYSTEM_COMBOBOX

n ROLE_SYSTEM_DIALOG

617

Page 642: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n ROLE_SYSTEM_DOCUMENT

n ROLE_SYSTEM_DROPLIST

n ROLE_SYSTEM_LINK

n ROLE_SYSTEM_LIST

n ROLE_SYSTEM_LISTITEM

n ROLE_SYSTEM_MENUBAR

n ROLE_SYSTEM_MENUITEM

n ROLE_SYSTEM_MENUPOPUP

n ROLE_SYSTEM_PAGETAB

n ROLE_SYSTEM_PAGETABLIST

n ROLE_SYSTEM_PANE

n ROLE_SYSTEM_PROGRESSBAR

n ROLE_SYSTEM_PUSHBUTTON

n ROLE_SYSTEM_RADIOBUTTON

n ROLE_SYSTEM_SLIDER

n ROLE_SYSTEM_SPLITBUTTON

n ROLE_SYSTEM_STATICTEXT

n ROLE_SYSTEM_TEXT

n ROLE_SYSTEM_TOOLBAR

n ROLE_SYSTEM_WINDOW

Partially supported:

n ROLE_SYSTEM_GROUPING

n ROLE_SYSTEM_STATUSBAR

Microsoft Visual BasicSupported:

n Check Box (ThunderRT6CheckBox)

n Combo Box (ThunderRT6ComboBox)

n Edit Box

n Group Box (ThunderRT6Frame)

n List Box (ThunderRT6TextBox)

n Push Button (ThunderRT6CommandButton)

n Radio Button (ThunderRT6OptionButton)

n Scroll Bar (ThunderRT6VScrollBar, ThunderRT6HScrollBar)

618

Page 643: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

Microsoft Windows (standard)Excludes .NET controls.

Note:Window class names are in parentheses.

Supported:

n Check Box (button)

n Combo Box (combobox)

n Dialog Box (#32770)

n Edit Box (edit)

n Extended Combo Box (ComboBoxEx32)

n Group Box (button)

n Group Box Frame (static)

n Image (static)

n Label (static)

n List Box (listbox)

n List View (SysListView32)

n List View Header (SysHeader32)

n Menu (#32768)

n Menu Shadow (SysShadow)

n Office 2007 Ribbon

n Push Button (button)

n Radio Button (button)

n Rich Edit Box (RichEdit, RichEdit20W, etc.)

n Scroll Bar (scrollbar)

n Tab (SysTabControl32)

n Toolbar (ToolbarWindow32)

n Tooltip (tooltips_class32)

n Tree View (systreeview32) 

Partially supported:

n Rebar

Microsoft Windows 8 style (C#/C++)

Note: TestingWindows 8 applications is not supported in QA Wizard Pro onWindows 10.

Supported:

619

Page 644: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n Windows.UI.Core.CoreWindow

n Windows.UI.Xaml.Controls.AppBar

n Windows.UI.Xaml.Controls.Border

n Windows.UI.Xaml.Controls.Button

n Windows.UI.Xaml.Controls.Canvas

n Windows.UI.Xaml.Controls.CaptureElement

n Windows.UI.Xaml.Controls.CheckBox

n Windows.UI.Xaml.Controls.ComboBox

n Windows.UI.Xaml.Controls.ContentControl

n Windows.UI.Xaml.Controls.ContentPresenter

n Windows.UI.Xaml.Controls.FlipView

n Windows.UI.Xaml.Controls.Grid

n Windows.UI.Xaml.Controls.GridView

n Windows.UI.Xaml.Controls.HyperlinkButton

n Windows.UI.Xaml.Controls.Image

n Windows.UI.Xaml.Controls.ItemsControl

n Windows.UI.Xaml.Controls.ItemsPresenter

n Windows.UI.Xaml.Controls.ListBox

n Windows.UI.Xaml.Controls.ListView

n Windows.UI.Xaml.Controls.MediaElement

n Windows.UI.Xaml.Controls.Page

n Windows.UI.Xaml.Controls.Panel

n Windows.UI.Xaml.Controls.PasswordBox

n Windows.UI.Xaml.Controls.Primitives.CarouselPanel

n Windows.UI.Xaml.Controls.Primitives.ScrollBar

n Windows.UI.Xaml.Controls.Primitives.ToggleButton

n Windows.UI.Xaml.Controls.ProgressBar

n Windows.UI.Xaml.Controls.ProgressRing

n Windows.UI.Xaml.Controls.RadioButton

n Windows.UI.Xaml.Controls.RichTextBlock

n Windows.UI.Xaml.Controls.RichTextBlockOverflow

n Windows.UI.Xaml.Controls.ScrollContentPresenter

n Windows.UI.Xaml.Controls.ScrollViewer

n Windows.UI.Xaml.Controls.SemanticZoom

n Windows.UI.Xaml.Controls.Slider

n Windows.UI.Xaml.Controls.StackPanel

620

Page 645: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n Windows.UI.Xaml.Controls.TextBlock

n Windows.UI.Xaml.Controls.TextBox

n Windows.UI.Xaml.Controls.ToggleSwitch

n Windows.UI.Xaml.Controls.ToolTip

n Windows.UI.Xaml.Controls.UserControl

n Windows.UI.Xaml.Controls.VariableSizedWrap

n Windows.UI.Xaml.Controls.Viewbox

n Windows.UI.Xaml.Controls.VirtualizingPanel

n Windows.UI.Xaml.Controls.VirtualizingStackPanel

n Windows.UI.Xaml.Controls.WrapGrid

Partially supported:

n Windows.UI.Xaml.Controls.Frame

n Windows.UI.Xaml.Controls.Primitives.RepeatButton

n Windows.UI.Xaml.Controls.RichEditBox

Microsoft Windows 8 style (HTML)Excludes web orWindows 8 Internet Explorer controls.

Note: TestingWindows 8 applications is not supported in QA Wizard Pro onWindows 10.

Supported:

n <a href=””>

n <article>

n <aside>

n <audio>

n <button>

n <b>

n <body>

n <canvas>

n <datalist>

n <details>

n <div>

n <embed>

n <figcaption>

n <figure>

n <footer>

621

Page 646: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n <form>

n <header>

n <hgroup>

n <html>

n <i>

n <img>

n <input type=”button”>

n <input type=”checkbox”>

n <input type=”email”>

n <input type=”image”>

n <input type=”password”>

n <input type=”radio”>

n <input type=”reset”>

n <input type=”search”>

n <input type=”submit”>

n <input type=”text”>

n <input type=”url”>

n <mark>

n <nav>

n <option>

n <output>

n <progress>

n <rp>

n <rt>

n <ruby>

n <section>

n <select>

n <source>

n <span>

n <svg>

n <textarea>

n <track>

n <u>

n <video>

n <wbr>

Partially supported:

622

Page 647: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n <input type=”file”>

n <meter>

Microsoft Windows 8 style (JavaScript)

Note: TestingWindows 8 applications is not supported in QA Wizard Pro onWindows 10.

Supported:

n WinJS.UI.AppBar

n WinJS.UI.AppBarCommand

n WinJS.UI.DatePicker

n WinJS.UI.FlipView

n WinJS.UI.Flyout

n WinJS.UI.GridLayout

n WinJS.UI.HtmlControl

n WinJS.UI.Layout

n WinJS.UI.ListLayout

n WinJS.UI.ListView

n WinJS.UI.Menu

n WinJS.UI.MenuCommand

n WinJS.UI.Rating

n WinJS.UI.SettingsFlyout

n WinJS.UI.TimePicker

n WinJS.UI.ToggleSwitch

n WinJS.UI.Tooltip

n WinJS.UI.ViewBox

Partially supported:

n WinJS.UI.SemanticZoom

Mozilla Firefox XULSupported:

n box

n browser

n button

n checkbox

n description

n dialog

623

Page 648: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n groupbox

n hbox

n image

n label

n menu

n menubar

n menuitem

n menulist

n menupopup

n menuseparator

n popup

n popupset

n prefpane

n prefwindow

n radio

n scrollbar

n scrollbox

n tabbrowser

n textbox

n tree

n vbox

n window

n wizard

n wizardpage

Partially supported:

n tabbox

n tabpanel

n tabpanels

Nokia Qt

Note: Only 32-bit Qt controls are supported.

Supported:

n QCheckBox

n QColorDialog

624

Page 649: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n QComboBox

n QDialog

n QErrorMessage

n QFileDialog

n QFontDialog

n QInputDialog

n QLabel

n QLineEdit

n QListView

n QListWidget

n QMainWindow

n QMdiArea

n QMdiSubWindow

n QMenu

n QMenuBar

n QMessageBox

n QPrintDialog

n QProgressDialog

n QPushButton

n QRadioButton

n QScrollBar

n QSplashScreen

n QToolButton

n QTreeView

n QTreeWidget

n QTreeWidgetItem 

Partially supported:

n QTabBar

n QTabWidget

Oracle FormsSupported:

n oracle.ewt.button.PushButton

n oracle.ewt.combobox.ComboBox

n oracle.ewt.dTree.DTree

625

Page 650: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n oracle.ewt.lwAWT.LWCheckBox

n oracle.ewt.lwAWT.LWLabel

n oracle.ewt.lwAWT.LWList

n oracle.ewt.lwAWT.lwMenu.LWMenu

n oracle.ewt.lwAWT.lwMenu.LWMenuBar

n oracle.ewt.lwAWT.lwMenu.LWPopupMenu

n oracle.ewt.lwAWT.LWScrollbar

n oracle.ewt.lwAWT.lwText.LWTextArea

n oracle.ewt.lwAWT.lwText.LWTextField

n oracle.ewt.lwAWT.lwWindow.LWWindow

n oracle.ewt.multiLineLabel.MultiLineLabel

n oracle.ewt.tabBar.TabBar

n oracle.forms.ui.VButton

n oracle.forms.ui.VCheckBox

n oracle.forms.ui.VComboBox

n oracle.forms.ui.VImage

n oracle.forms.ui.VPopList

n oracle.forms.ui.VRadioButton

n oracle.forms.ui.VTextArea

n oracle.forms.ui.VTextField

n oracle.forms.ui.VTList

Partially supported:

n oracle.forms.ui.ListView

Oracle/Sun Java AWTQAWizard Pro 2009 and later can test applets running in AppletViewer. QA Wizard Pro 2012.2 and later cantest applets running in web pages.

Supported:

n Button

n Checkbox

n CheckboxGroup

n CheckboxMenuItem

n Choice

n Dialog

n FileDialog

626

Page 651: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n Frame

n Image

n Label

n List

n Menu

n MenuBar

n MenuItem

n Panel

n Scrollbar

n ScrollPane

n SplashScreen

n TextArea

n TextField

n Window

Oracle/Sun Java SwingQAWizard Pro 2009 and later can test applets running in AppletViewer. QA Wizard Pro 2012.2 and later cantest applets running in web pages.

Supported:

n Box

n ButtonGroup

n JButton

n JCheckBox

n JColorChooser

n JComboBox

n JComponent

n JDesktopPane

n JDialog

n JEditorPane

n JFileChooser

n JFormattedTextField

n JFrame

n JInternalFrame

n JLabel

n JLayeredPane

627

Page 652: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n JList

n JMenu

n JMenuBar

n JMenuItem

n JOptionPane

n JPanel

n JPasswordField

n JPopupMenu

n JPopupMenu.Separator

n JRadioButton

n JRootPane

n JScrollBar

n JScrollPane

n JSplitPane

n JTable

n JTextArea

n JTextField

n JTextPane

n JToolTip

n JTree

n JViewport

n JWindow

Partially supported:

n CellRendererPane

n JApplet

n JCheckBoxMenuItem

n JRadioButtonMenuItem

n JSeparator

n JToggleButton

TinyMCESupported:

n Button

n Combo Box

628

Page 653: QA Wizard Pro User Guide v2017 - Perforce

Appendix A: Supported Technologies and Controls

n Context Menu

n WYSIWYGEditor

629

Page 654: QA Wizard Pro User Guide v2017 - Perforce
Page 655: QA Wizard Pro User Guide v2017 - Perforce

Appendix B: Run Results Email Field CodesYou can use field codes to replace the subject andmessage body in a run results email with a specific value.See Setting email notification options, page 44.

For example, entering %RUN_TYPE% as the subject and %RUN_RESULT% as themessage body sends an emailwith the run type (Batch Run, Script Run, or Load Test Run) as the subject and the result (Successful orFailed) as themessage body.

Following are available field codes and the values they are replaced with.

Field code Values Description

%RUN_TYPE% Batch Run, Script Run, or Load Test Run Specifies the run type.

%RUN_RESULT%

Successful or Failed Specifies if playback succeeded orfailed.

%RUN_FILETYPE%

Batch File, Script Files, or Load Test Files Specifies the file types run.

%RUN_FILELIST%

Batch: Batch filenameSingle script: Script nameMultiple scripts: All script names separated withcommas.

Specifies the test file names.

631

Page 656: QA Wizard Pro User Guide v2017 - Perforce
Page 657: QA Wizard Pro User Guide v2017 - Perforce

Appendix C: Third-Party Software Licenses

D3.js license

The following license information applies specifically to the D3 software.

Copyright (c) 2010-2014, Michael Bostock

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that thefollowing conditions aremet:

n Redistributions of source codemust retain the above copyright notice, this list of conditions and thefollowing disclaimer.

n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and thefollowing disclaimer in the documentation and/or other materials provided with the distribution.

n The nameMichael Bostock may not be used to endorse or promote products derived from this softwarewithout specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NOEVENT SHALLMICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OROTHERWISE) ARISING IN ANYWAY OUTOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OFTHE POSSIBILITY OF SUCH DAMAGE.

Nunit license

The following license information applies specifically to the Nunit software.

Copyright © 2002-2014 Charlie PooleCopyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. VorontsovCopyright © 2000-2002 Philip A. Craig

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be heldliable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, andto alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this softwaremust not bemisrepresented; youmust not claim that you wrote the originalsoftware. If you use this software in a product, an acknowledgment (see the following) in the productdocumentation is required.

Portions Copyright © 2002-2014 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C.Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig

2. Altered source versions must be plainly marked as such, andmust not bemisrepresented as being theoriginal software.

3. This noticemay not be removed or altered from any source distribution.

633

Page 658: QA Wizard Pro User Guide v2017 - Perforce

Appendix C: Third-Party Software Licenses

Software under the Apache license, version 2.0

The following software components are used under the Apache License, Version 2.0.

Tesseract OCR Copyright 2012-2016 Charles Weld.

Licensed under the Apache License, Version 2.0 (the "License"); youmay not use this file except incompliance with the License. Youmay obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributedon an "AS IS" BASIS, WITHOUTWARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied. See the License for the specific language governing permissions and limitations under the License.

Software under the MIT license

The following software components are used under theMIT License.

Bootstrap Copyright 2011-2016 Twitter, Inc.

C3 Copyright (c) 2013Masayuki Tanaka

disasm-lib Copyright (c) 2002, Matt Conover ([email protected])

jQuery Copyright 2012 jQuery Foundation and other contributors http://jquery.com/

Modernizr Copyright (c) 2009-2016 Faruk Ates, Paul Irish, Alex Sexton

Moment.js Copyright (c) 2011-2014 TimWood, Iskren Chernev, Moment.js contributors

NewtonSoft Json.NET Copyright (c) 2007 James Newton-King

pugixml parser Copyright (c) 2006-2014 Arseny Kapoulkine

respond.js Copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas

TheMIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associateddocumentation files (the "Software"), to deal in the Software without restriction, including without limitation therights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions ofthe Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUTWARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDINGBUT NOT LIMITED TO THEWARRANTIES OFMERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NOEVENT SHALL THE AUTHORSOR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OFOR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

634

Page 659: QA Wizard Pro User Guide v2017 - Perforce

Glossary

Application repositoryStores information about tested applications, versions, and windows, and controls.

ArrayA variable that contains a series of values.

BreakpointA pause during script debugging. The script runs until it reaches a breakpoint then playback is suspendedso you can examine the step and determine the problem.

CheckpointVerifies application attributes against specific criteria.

Conditional statementSpecifies a condition and performs different script steps based on whether the condition is true or false.

ContextThe current connection to the application repository.

ControlAn element in an application such as amenu, button, text field, or check box.

DashboardA web application used tomonitor playback information and statistics in real-time.

Data-driven scriptA script that uses input values from a local or external data source.

DatasheetStores data for use in data-driven testing. The data can be stored with the workspace in a local datasheetor in an external file, such as a spreadsheet or database table.

DebugA mode that allows you to add breakpoints and run scripts step-by-step to troubleshoot and fix steps thatcause scripts to fail.

ExpressionA combination of values, variables, operators, and functions that are interpreted to return a value.

Keyword ViewDisplays scripts in a grid format.

Load testingA method for testing how aweb application and server perform under a simulated load of users.

LoopA block of script steps that repeats based on a condition.

635

Page 660: QA Wizard Pro User Guide v2017 - Perforce

Glossary

Low-level actionsMouse actions that QAWizard Pro records when it cannot recognize a window or control.

OCROptical Character Recognition. A technology that converts graphical text in applications into actual text.

OCR checkpointVerifies graphical text matches a specified text string, expression, or datasheet value.

OperatorA character that represents an action.

ProcessAn instance of a program running on a computer. Often not visible to the user.

PromoteCopies an application from the local repository to the global repository.

PropertyA characteristic that defines the properties of a control. Consists of a name and a value.

QA Wizard Pro ServerStores global application data and hosts the server database, which stores playback history information, ina central location. The server is hosted on a computer that can be accessed over a network.

RecordsetA set of data from an external data source.

Regular expressionA string of special characters used tomatch a pattern in a text string.

Repository variableA variable stored in the application repository that can be used in all scripts recorded or run against anapplication version.

Smart matchingEvaluates window and control properties after recording and playback to recommend search criteriachanges in the application repository.

Status toolAn application used to review script playback line-by-line in real-time.

StressesChanges to drive, memory, and networking conditions on the test computer that are applied duringplayback to determine how an application performs under stressful conditions.

StringSequence of characters that appear exactly as they are typed.

Text ViewDisplays scripts in text format.

636

Page 661: QA Wizard Pro User Guide v2017 - Perforce

Glossary

VariableA value that can change depending on conditions or information passed to the program.

Variables windowDisplays script variables and values that you can evaluate and edit when debugging scripts.

VersionContains information used to start an application and locate windows and controls during playback. Eachapplication in the repository contains one or more versions.

WorkspaceA QAWizard Pro directory that contains scripts, reports, and associated datasheets.

XPathA language that can be used to find elements in HTML documents based on the document hierarchy.

637

Page 662: QA Wizard Pro User Guide v2017 - Perforce
Page 663: QA Wizard Pro User Guide v2017 - Perforce

Index: # statement – ArrayToJSONArray statement

Index

#

# statement 351

A

Abs statement 352

Absolute Value statement 352

Access external datasheets 190

AddDefect See AddIssue statement

AddFileAttachment statement 352

Adding

application versions 51

applications 47

browser actions 149

controls to repository during recording 115

controls to repository manually 138

functions 146

local datasheets 187-188

new scripts 71

repository variable list values 218

statements 146

AddIssue statement 353

Addition operator 594

AddToHelixALM statement 354

AddToTestTrack statement 354

Alert statement 355

And operator 595

ANYCOLUMN constant variable 239, 241

ANYROW constant variable 239, 241

AppendToFile statement 355

Application control statements 321

Application repositories 57

adding applications 47

adding controls manually 138

change reasons 118

configuring global 254

configuring windows and controls 136

connecting to global 63

deleting user-added windows andcontrols 143

duplicating windows and controls 142

editing user-added windows and controls 143

maintaining 60

moving 49

populating 60

reviewing changes 116

saving changes 116

setting up 59

synchronizing scripts 143-144

Application versions

adding 51

deleting 54

modifying 53

Applications

adding 47

backing up 49

copying 49

deleting 54

exporting 49

importing 50

modifying properties 51

moving 49

promoting 50

renaming 51

ArrayClear statement 356

Arrays

assigning values 31

declaring 31

declaring dynamic 32

ArraySize statement 356

ArrayToJSONArray statement 357

639

Page 664: QA Wizard Pro User Guide v2017 - Perforce

Index: ASCII statement – Commenting

ASCII statement 357

Assignment

operator 595

statement 358

variable values 30

B

Back statement 358

Backing up

repositories 49

server database 262

Batch files

creating 83

modifying 86

running 87

updating 86

Beep statement 359

Boolean statement 359

BoundaryChecks statement 360

Breakpoints 212

Browsers

adding statements 149

setting default 68

statements 350

C

Calling scripts 151

CallScript statement 528

CaptureScreenshot statement 360

Case statement 361, 536

Cell statement 362

Character statement 366

CheckExists statement 362

Checkpoint statement 363

CheckpointExpression statement 364

CheckpointImage statement 364

CheckpointOCR statement 493

Checkpoints

adding to HTML tables 240

capturing values during playback 179

creating 169

creating exists 171

creating expression 176

creating image 173

creating OCR 183

creating string exists and not exists 177

deleting 177

editing 171

examples 178

OCR example 185

statements 324

types 165

using XPath queries 225

CheckpointStringExists statement 365

CheckpointStringNotExists statement 366

Chr statement 366

Clear Check Box statement 367

Clear statement 367

ClearContext statement 529

ClearLoadTestContext statement 529

ClearOutput statement 367

Click statement 367

Close statement 368

CloseApp statement 530

CloseTab statement 368

Code completion 29

Collapse statement 368

Column index 244

CombinePaths statement 369

Comment statements 325, 516

Commenting

blocks of steps 154

640

Page 665: QA Wizard Pro User Guide v2017 - Perforce

Index: CommitRecordsetRow statement – Dashboard

single step 516

CommitRecordsetRow statement 370

CompareFileContents statement 370

CompareImage statement 371

ComputerName statement 372

Concatenation operator 596

Conditional statements 325

ConnectToProcess statement 530

Constants 600

Container controls 233

Contains Substring statement 372

ContainsRuntimeValue statement 130

ContainsSubStr statement 372

Context menus 144

Controls

adding properties to user-added controls 140

adding to repository manually 138

capturing data during recording 115

capturing HTML table properties 244

changing types 132

configuring user-added controls 136

container 233

default naming convention 121

deleting properties from user-addedcontrols 142

deleting user-added controls 143

disabling smart matching 119, 131

duplicating 142

editing property expected values 126

editing user-added controls 143

merging 136

modifying names 116

modifying types 116

nested 233

overriding naming conventions 119

properties

changing search method for multiplecontrols 128

renaming 133

supported 607

CopyFile statement 373

Copying applications 49

Cos statement 373

Cosine statement 373

CreateDirectory statement 374

CreateGUID statement 374

CreateObject statement 375

CreateRecordsetRow statement 375

CreateTempFile statement 376

Creating

batch files 83

checkpoints 169

exists checkpoints 171

expression checkpoints 176

image checkpoints 173

OCR checkpoints 183

record-time check exists checkpoints 168

record-time checkpoints 166

repository variables 215

string exists and not exists checkpoints 177

URL format rules 227

workspaces 23

D

Dashboard

changing widget data 95

configuring IIS 97

installing 97

URL 91

using 90

widget types 92

641

Page 666: QA Wizard Pro User Guide v2017 - Perforce

Index: Data source linking – DragTo statement

Data source linking 189

Databases

configuring 255

Oracle 317

PostgreSQL 318

querying 206-207

SQL Server 318

Datasheets 187

Access databases 190

associating with scripts 203

creating from PostgreSQL database 197

Excel files 192

external 190

navigating 205

Oracle databases 195

SQL Server databases 193

SQLite databases 199

statements 205, 325

text files 200

using values in scripts 203

Date statement 376

Date/time

format examples 605

formatting values 381

statements 327

DateAdd statement 377

DateDiff statement 378

DatePart statement 379

DateTime statement 380

DateTimeFormat statement 381

Day statement 383

Debugging scripts 211

breakpoints 212

INDEBUGMODE variable 213

variables 213

DecimalSeparator statement 384

Declaring

arrays 31

functions 33

subroutines 33

variables 29

DecryptString statement 384

Default directories 5

Defects See Issues

Definitions 154

Delay statement 385

DeleteDirectory statement 385

DeleteFile statement 386

DeleteRecordsetRow statement 386

Deleting

application versions 54

applications 54

checkpoints 177

external datasheets 210

local datasheets 209

playback data 256

repository variable list values 219

repository variables 217

scheduled playback data removals 260

statements 151

URL format rules 232

DirectoryExists statement 387

DisableNetworking statement 387

Division operator 596

Do...Loop Until statement 388

Do...Loop While statement 389

DoubleClick statement 390

Drag and drop 164

Drag statement 391

DragTo statement 391

642

Page 667: QA Wizard Pro User Guide v2017 - Perforce

Index: Editing – External datasheets

E

Editing

checkpoints 171

image checkpoints 175

local datasheets 208

playback data removal schedules 260

repository variable list values 219

repository variables 217

scheduled playback data removal filters 259

statements 151

URL format rules 230

window and control property expectedvalues 126

Else statement 392, 451

ElseIf statement 392, 451

Emailing run results 44

field codes 631

EnableNetworking statement 393

Encrypting text 162

EncryptString statement 394

Ends with Substring statement 394

EndsWithSubStr statement 394

Environment variables 605

Err.CallStack statement 395

Err.Clear statement 396

Err.Description statement 396

Err.LineNumber statement 397

Err.LineText statement 398

Err.Number statement 399

Err.Raise statement 400

Err.ScriptName statement 401

Err.Source statement 401

Error Call Stack statement 395

Error Clear statement 396

Error Description statement 396

Error handling 155

statements 328

Error Line Number statement 397

Error Line Text statement 398

Error Number statement 399

Error Raise statement 400

Error Script Name statement 401

Error Source statement 401

Evaluate Regular Expression statement 402

EvaluateRegExpression statement 402

Excel external datasheets 192

Exception handling 155

Exists checkpoints 171

Exit statement 403

Expand statement 404

Exponentiation operator 596

Exporting

applications 49

QTP data 304

results 76

Exporting playback session reports 101

Expression checkpoints

creating 176

External datasheets

Access 190

associating with scripts 203

configuring 190

deleting 210

Excel 192

modifying properties 209

Oracle 195

PostgreSQL 197

queries 206

script-generated queries 207

SQL Server 193

643

Page 668: QA Wizard Pro User Guide v2017 - Perforce

Index: ExternalAssemblyCall statement – GetContext statement

SQLite 199

text files 200

using values in scripts 203

ExternalAssemblyCall statement 404

ExternalCall statement 406

ExtractHTML statement 407

ExtractHTMLToString statement 407

F

Fail statement 408

FileBaseName statement 408

FileDateCreated statement 409

FileDateLastModified statement 409

FileDirectoryName statement 410

FileExists statement 410

FileExtension statement 411

FileFullPath statement 412

FileName statement 412

FileReadOnly statement 413

FileRootDirectoryName statement 413

Files

adding to workspaces 23

identifying in statements 156

FileSize statement 414

FileType statement 414

Find Substring statement 417

FindColumnByRowIndex statement 244, 415

Finding

column index in HTML tables 244

definitions 153

references in scripts 153

row index in HTML tables 244

text in individual scripts 158

text in multiple scripts 159

window and control properties 134

FindRowByColumnIndex statement 244, 416

FindSubStr statement 417

First Recordset Row statement 417

FirstRow statement 417

Float statement 418

Folders 24

For Each...Next statement 418

For loop 418-419

For...Next statement 419

Format statement 420

Forward statement 422

Function search method 124, 129

Functions See also Statements

adding 146

calling 33

creating 32

declaring 33

finding definitions 153

finding references 153

identifier rules 32

returning values 33

using results as arguments 148

G

General options 40

General statement 422

Get .NET Property statement 429

Get .NET Property with Arguments statement 430

Get Current Directory statement 426

Get Environment statement 431

Get Number of Items statement 436

Get Stopwatch Milliseconds statement 443

Get Stopwatch Time statement 443

GetAllValues statement 422

GetBrowserVersion statement 423

GetCallStack statement 423

GetContext statement 531

644

Page 669: QA Wizard Pro User Guide v2017 - Perforce

Index: GetControlFromTable statement – Helix ALM integration

GetControlFromTable statement 243, 424

GetControlFromXPathQuery statement 425

GetControlSearchTimeout statement 425

GetCurDir statement 426

GetCurrentBrowserType statement 426

GetDataSourceColumnNames statement 427

GetDiagnostics statement 427

GetDirectory statement 428

GetDirectoryNames statement 428

GetDotNETProperty statement 429

GetDotNETPropertyWithArgs statement 430

GetEnv statement 431

GetFieldValue statement 431

GetFileNames statement 432

GetFilePath statement 433

GetLength statement 433

GetLineNumber statement 531

GetLoadTestContext statement 532

GetLowLevelSpeed statement 434

GetMouseXCoordinate statement 435

GetMouseYCoordinate statement 435

GetNumItems statement 436

GetPlaybackDelay statement 436

GetPlaybackSessionName statement 437

GetPropertyMap statement 437

GetPropertyNames statement 438

JSONObject 439

GetRecordsetColumnNames statement 439

GetRowValue statement 440

GetRuntimeValue statement 130

GetScreenHeight statement 441

GetScreenWidth statement 441

GetScriptVariable statement 442

GetSQLScalar statement 442

GetStopwatchElapsedMilliseconds statement 443

GetStopwatchElapsedTime statement 443

Getting started 7

GetValue statement

JSONArray 444

JSONObject 445

GetVariableValues statement 446

GetVirtualUserID statement 446

GetWindowsVersion statement 446

Global repository

backing up 49, 262

changing directory 254

connecting 63

installing server 253

promoting applications 50

server connection options 43

server installation 3

starting server 254

startup information 62

Go to definition 154

Grouping steps 150

H

HasProperty statement

JSONObject 447

PropertyMap 448

Helix ALM

statements 331

Helix ALM Data Warehouse integration 254

Helix ALM integration 265

adding issues 277

adding issues from reports 278

adding issues from scripts 279

adding test cases 269

adding workbook tasks 283

adding workflow events to items 281

configuring 265

645

Page 670: QA Wizard Pro User Guide v2017 - Perforce

Index: Help statement – Integration

creating scripts from test cases 272

deleting issues 281

deleting test cases 275

deleting test runs 276

deleting workbook tasks 284

duplicating items 282

editing issues 281

editing test cases 275

editing test runs 276

editing workbook tasks 284

issues 276

list windows 20, 267

recording test case steps 270

running tests 275

test cases and test runs 268

viewing issues 280

viewing test cases 274

viewing test runs 276

viewing workbook tasks 284

workbook 283

Help statement 448

Hiding panes 35-36

Home statement 449

Hour statement 449

Hover 449

HTML tables

adding statements 237

capturing control properties 244

checkpoint examples 242

creating checkpoints 240

finding row and column indexes 244

GetControlFromTable statement 243

nested tables 245

object action statement examples 239

HTMLFindByID statement 162, 450

HTMLFindByTag statement 162, 451

I

Identifier rules

functions 32

subroutines 32

variables 30

If statement 451

IgnoreAutocompleteDropDowns statement 452

IgnoreErrors statement 453

IgnoreWarnings statement 453

Ignoring overlay controls 132

IIS configuration for dashboard 97

Image checkpoints

creating 173

editing 175

Image statements 332

Images

finding text 181

Importing

applications 50

external test data 189

INDEBUGMODE variable 213

InsertAt statement 453

Installation 3

after installing 6

before installing 3

default directories 5

minimum Windows user rights 3

QA Wizard Pro Server 3, 253

running the installer 4

system requirements 3

Integer statement 454

Integrated action statements 332

Integration

Helix ALM 265

646

Page 671: QA Wizard Pro User Guide v2017 - Perforce

Index: Interface – JSONObjectSetValue statement

Helix ALM Data Warehouse 254

source control applications 285

Interface 11

Application Repository pane 13

auto hiding panes 35

Call Stack pane 14

closing items 19

customizing 35

Errors pane 15

Find Results pane 15

Helix ALM list windows 20, 267

hiding panes 36

Issues pane 20

moving panes 35

opening multiple items 19

Output pane 15

Pending Changes pane 16

Preview pane 16

References pane 17

Reports pane 17

Script pane 18

Statements pane 19

Test Cases pane 20

Test Runs pane 20

undocking panes 35

Variables pane 20

viewing multiple items simultaneously 19

Workbook pane 20

Workspace pane 21

Invoke .NET Method statement 454

Invoke .NET Method with Argumentsstatement 455

InvokeDotNETMethod statement 454

InvokeDotNetMethodWithArgs statement 455

InvokeJavaScript statement 456

Is operator 597

Is64BitWindows statement 457

IsArray 457

IsDate statement 461

IsIgnoringAutocompleteDropDownsstatement 458

IsIgnoringErrors statements 458

IsIgnoringWarnings statement 459

IsJSONArray statement 459

IsJSONObject statement 460

IsJSONType statement 460

IsNull statement 462

IsNumeric statement 462

IsObject statement 463

Issues 276

adding

from scripts 279

adding from QA Wizard Pro 277

adding from run reports 278

deleting 281

duplicating 282

editing 281

moving through the workflow 281

viewing 280

J

JSON statements 333

JSONArrayGetValue statement 463

JSONArraySetValue statement 464

JSONCanParseAsArray statement 465

JSONCanParseAsObject statement 465

JSONIsValid statement 466

JSONNewArray statement 467

JSONNewObject statement 467

JSONObjectGetValue statement 467

JSONObjectSetValue statement 468

647

Page 672: QA Wizard Pro User Guide v2017 - Perforce

Index: JSONParse statement – Merging controls

JSONParse statement 469

K

Keyboard

locking 77

shortcuts 39

unlocking 77

Keyboard action statements 335

KeyDown statement 470

KeyPress statement 470

KeyUp statement 471

Keyword View 27

outlining 151

Keywords

in use 603

reserved for future 604

L

Last Recordset Row statement 472

LastRow statement 472

Left Mouse Click statement 473

Left Mouse Double-Click statement 474

Left Mouse Down statement 475

Left Mouse Up statement 476

Left statement 472

Length statement 473

Licenses

adding 11

maintenance extenders 11

options 40

viewing 11

Linking data sources 189

LMouseClick statement 473

LMouseDoubleClick statement 474

LMouseDown statement 475

LMouseUp statement 476

Load testing 103

licenses 11

recording scripts 103

running tests 104

running tests from command prompt 106

statements 336

viewing run results 109

LoadExternalAssembly statement 476

Local datasheets

adding 187-188

associating with scripts 203

deleting 209

editing 208

modifying properties 208

using values in scripts 203

Locking keyboard and mouse 77

Loop statements 339

Low-level action statements

recording 70

Lower statement 477

M

Main script 74

Maintenance license extenders 11

Make Regular Expression statement 477

MakeRegExpression statement 477

MakeURL statement 478

Math statements 339

Max statement 479

Maximize statement 479

Maximum statement 479

Menus

adding commands 37

modifying 38

setting options 38

Merging controls 136

648

Page 673: QA Wizard Pro User Guide v2017 - Perforce

Index: Mid statement – OCR

Mid statement 479

Middle Mouse Click statement 481

Middle Mouse Double-Click statement 482

Middle Mouse Down statement 483

Middle Mouse Up statement 484

Min statement 480

Minimize statement 481

Minimum statement 480

Minute statement 481

MMouseClick statement 481

MMouseDoubleClick statement 482

MMouseDown statement 483

MMouseUp statement 484

Mod operator 597

Modifying

application properties 51

application version properties 53

batch files 86

control names 116

control types 116, 132

external datasheet properties 209

local datasheet properties 208

script properties 163

window and control names 133

window and control properties 122

workspace properties 25

Month Numeric statement 485

Month statement 484

MonthName statement 485

MonthNum statement 485

Mouse

locking 77

unlocking 77

Mouse action statements 340

MouseMove statement 486

MouseMoveFromCurrentPosition statement 487

MoveDirectory statement 487

MoveFile statement 488

Moving

panes 35

repositories 49

MSAADoDefaultAction statement 488

MSAASetName statement 488

MSAASetValue statement 489

Multiplication operator 597

N

Name overrides 119

Navigate statement 489

Negation operator 598

Nested controls 233

adding statements 233

container control types 233

object action statement examples 234

Nested HTML tables 245

examples 246

NewIssue statement 490

NewTab statement 490

Next Recordset Row statement 491

NextRow statement 491

Not operator 598

Now statement 491

Number formatting characters 420

O

Object action statements 341

OCR 181

checkpoint example 185

checkpoint statement 491

creating checkpoints 183

default playback options 77

statements 342

649

Page 674: QA Wizard Pro User Guide v2017 - Perforce

Index: OCRCheckpoint statement – Playback data removal

troubleshooting 186

OCRCheckpoint statement 491

OCRCheckpointPreviousStatement statement 493

OCRConvertToGrayscale statement 493

OCRGetContrast statement 494

OCRGetLanguageFilePath statement 495

OCRGetScale statement 496

OCRGetText statement 497

OCRGetTextFromFile statement 498

OCRGetTextPreviousStatement statement 499

OCRIsConvertingToGrayscale statement 500

OCRSetContrast statement 501

OCRSetLanguageFilePath statement 502

OCRSetScale statement 503

OnError statement 504

Opening workspaces 26

OpenRecordset statement 504

OpenRecordsetQuery statement 505

Operators 593

addition 594

and 595

assignment 595

concatenation 596

division 596

exponentiation 596

Is 597

mod 597

multiplication 597

negation 598

not 598

or 598

subtraction 599

xor 599

Options

email notifications 44

general 40

licenses 40

playback 76

remote computers 249

reporting 78

server 43

source control 286

Text View 34

Or operator 598

Oracle

connecting to 317

connection errors 319

creating external datasheets 195

creating server database tables 317

creating users 317

instant client libraries (OCI) 317

setting up 317

sizing, memory, and tuning 318

Outline Block statement 351

Outlining blocks of steps 150

Overriding startup information for localcomputer 62

P

Panes

auto hiding 35

hiding 36

moving 35

undocking 35

ParseString statement 506

Password

data removal 262

PerformXPathQuery statement 506

Playback data removal 256

adding schedule 257

deleting scheduled removals 260

650

Page 675: QA Wizard Pro User Guide v2017 - Perforce

Index: Playback options – ReadTextFile statement

editing removal schedules 260

editing scheduled removal filters 259

manually removing data 261

scheduling 257

setting password 262

Playback options 76

Pop statement 507

Populating

local datasheets 187

repositories 60

Postdata file 104

PostgreSQL

connection errors 320

creating external datasheets fromdatabases 197

creating server database tables 318

setting up 318

Previous Recordset Row statement 508

PrevRow statement 508

Print Line statement 509

Print statement 508

PrintLn statement 509

Programming statements 343

Promoting applications 50

Property statement 509

PropertyMap 510

Push statement 511

Q

QA Wizard Pro

login 74

server

backing up 262

compatibility 4

configuring database 255

connection options 43

installing 253

starting 254

starting the admin utility 254

statements 345

QAWLoadTest command 106

QAWRemote

starting 250

QAWRunScript command 80

QTP conversion 305

converting checkpoints 306

converting function libraries 309

converting repository objects 306

converting tests 309

exporting data 304

how items are converted 304

process overview 303

reviewing results 312

supported applications 303

troubleshooting 314

viewing log 314

Queries

database 206

script-generated 207

R

Rand statement 511

Random statement 511

Range statement 512

RDBMS connections

QA Wizard Pro Server cannot start 319

QA Wizard Pro Servers using samedatabase 319

troubleshooting 319

RDBMS databases 317

ReadRegistryEntry statement 512

ReadTextFile statement 513

651

Page 676: QA Wizard Pro User Guide v2017 - Perforce

Index: Record-time checkpoints – RMouseUp statement

Record-time checkpoints

creating 166

creating check exists 168

Recording

additional script steps 69

load test scripts 103

low-level actions 70

scripts 65

RecordsetBOF statement 513

RecordsetEOF statement 514

RecordsetRowCount statement 515

Refresh statement 515

Regular expressions 127

Rem statement 516

Remote testing

running multiple scripts 251

running scripts 250

setting up computers 249

starting QAWRemote 250

RemoveAt statement 516

RemoveField statement 517

RemoveProperty statement 518

Removing playback data 256

Renaming

applications 51

scripts 163

windows and controls 133

workspaces 25

Replace statement 519

Replacing

text in individual scripts 158

text in multiple scripts 160

window and control properties 134

Reports

adding Helix ALM issues 278

exporting 76

exporting to different formats 75, 110

options 78

viewing 75

viewing load test results 109

Repositories See Application repositories

Repository variables

about 29

adding list values 218

creating 215

deleting 217

deleting list values 219

editing 217

editing list values 219

entering values during playback 221

managing list values 217

URLROOT 220

using in scripts 220

Reserved words 603

ResetStopwatch statement 520

Resize statement 520

Restore statement 520

Results See Reports

exporting reports 76

Returning values from functions 33

Reviewing repository changes 116, 119

Right Mouse Click statement 521

Right Mouse Double-Click statement 522

Right Mouse Down statement 523

Right Mouse Up statement 523

Right statement 521

RMouseClick statement 521

RMouseDoubleClick statement 522

RMouseDown statement 523

RMouseUp statement 523

652

Page 677: QA Wizard Pro User Guide v2017 - Perforce

Index: Row index – Select...Case statement

Row index 244

RunApp statement 532

RunBackgroundCommand statement 524

RunCommand statement 525

Running scripts 73

batch files 87

command prompt 80

global repository 79

load tests 104

load tests from command prompt 106

main script 74

monitoring playback 89

multiple scripts 79

remotely 250-251

RunScriptRemote statement 526

RunSQLCommand statement 526

S

Sample scripts and applications 22

SaveRegionToImageFile statement 527

Saving repository changes 116, 118

Scheduling playback data removal 257

Schema.ini file 202

Script Close Application statement 530

Script control statements 345

Script Run Application statement 532

Script variables 29

ScriptName statement 535

Scripts

adding existing to workspaces 23

adding new 71

associating datasheets 203

calling 151

cleaning up 150

debugging 211-213

finding and replacing text 158

finding text 159

modifying properties 163

monitoring playback 89

recording 65

recording additional steps 69

recording load tests 103

renaming 163

replacing text 160

running 73

running against global repository 79

running from command prompt 80

running load tests 104

running main 74

running multiple 79

running remotely 250-251

searching 158

searching for text in the workspace 159

synchronizing 143-144

Search criteria

adding properties for user-added controls 140

changing properties 124

editing property expected values 126

Search methods 124

changing for multiple controls 128

Function 124, 129

Standard 124

XPath 124, 223

Searching scripts 158-159

Second statement 535

Seed Random statement 554

Select Grid Row statement 538

Select Item statement 537

Select Range statement 512

Select statement 537

Select...Case statement 536

653

Page 678: QA Wizard Pro User Guide v2017 - Perforce

Index: SelectRow statement – Source control

SelectRow statement 538

SelectTab statement 538

Server admin utility

configuring the server database 255

removing playback data 256

setting general server options 254

starting 254

Server connection options 43

Server database

backing up 262

configuring 255

default file path 255

removing playback data 256

Server database tables

Oracle 317

PostgreSQL 318

SQL Server 319

Set .NET Property statement 544

Set .NET Property with Arguments statement 545

Set Check Box statement 538

Set Recordset Row Value statement 547

Set statement 538

SetAllFilesReadOnly statement 539

SetBrowser statement 533

SetCell statement 539

SetContext statement 534

SetControlSearchTimeout statement 540

SetDate statement 540

SetDateRange statement 541

SetDateTime statement 541

SetDiagnostics statement 542

SetDotNETProperty statement 544

SetDotNETPropertyWithArgs statement 545

SetFieldValue statement 542

SetFileReadOnly statement 543

SetLoadTestContext statement 534

SetLowLevelSpeed statement 545

SetPlaybackDelay statement 546

SetPlaybackSessionName statement 546

SetRowValue statement 547

SetScriptVariable statement 547

SetText statement 548

SetTime statement 548

SetValue statement 549

JSONArray 549

JSONObject 550

SimulateDriveReadOnly statement 551

SimulateDriveRemainingSpace statement 551

SimulateMemoryPerAllocationLimit statement 552

SimulateMemoryRemainingSpace statement 552

Sin statement 553

Sine statement 553

Size statement 554

Smart matching 118

disabling 119

enabling 131

playback 119

recording 118

Source control 285

adding files 289

annotating files 294

checking in files 298

checking out files 291

configuring integration 285

excluding files 289

file status icons 287

getting files 290

managing changelists 298

opening workspaces 288

removing files 301

654

Page 679: QA Wizard Pro User Guide v2017 - Perforce

Index: SQL Server – Status tool

renaming files 301

setting options 286

undoing check out 300

viewing file differences 296

viewing file history 292

viewing file properties 291

viewing pending changes 296

SQL Server

connection errors 319

creating external datasheets fromdatabases 193

creating server database tables 319

setting up 318

SQLite

creating external datasheets 199

SRand statement 554

Standard search method 124

Starting

QA Wizard Pro 11

QA Wizard Pro Server 254

QA Wizard Pro Server Admin Utility 254

QAWRemote.exe for remote testing 250

Starts with Substring statement 555

StartStopwatch statement 555

StartsWithSubStr statement 555

Startup information 62

Statements

adding 146

adding for nested controls 233

application control 321

checkpoint 324

comment 325

conditional 325

datasheet 205, 325

date/time 327

deleting 151

editing 151

error handling 328

file 329

Helix ALM 331

image 332

integrated actions 332

JSON 333

JSONArray statements 334

JSONObject statements 335

keyboard actions 335

load testing 336

loop 339

math 339

mouse actions 340

object actions 341

OCR 342

programming 343

PropertyMap

PropertyMap statements 344

QA Wizard Pro 345

script control 345

stress 346

string 346

system 348

timing 349

touch actions 349

using function results as arguments 148

web 350

web browser actions 350

window actions 351

Status tool

connecting to server 100

exporting playback reports 101

using 99

655

Page 680: QA Wizard Pro User Guide v2017 - Perforce

Index: Stop statement – Toolbars

Stop statement 556

StopStopwatch statement 556

Str statement 557

StrCompare statement 557

StrEquals statement 558

Stress testing 111

applying stresses 112

creating tests 111

running tests 111

statements 346

String Compare statement 557

String Equals statement 558

String exists and not exists checkpoints 177

String statement 346, 557

Subroutines

calling 33

creating 32

declaring 33

finding definitions 153

finding references 153

identifier rules 32

Subtraction operator 599

Supported controls 607

Synchronizing scripts 143-144

System requirements 3

System statements 348

T

Test cases 268

adding 269

creating scripts from test steps 272

deleting 275

duplicating 282

editing 275

moving through the workflow 281

recording steps 270

viewing 274

Test runs 268

deleting 276

duplicating 282

editing 276

moving through the workflow 281

performing tests 275

viewing 276

TestCaseStep statement 559

Testing context menus 144

Testing process 9

Text

encrypting 162

finding and replacing 158

Text file external datasheets 200

Text View 28

assigning array values 31

assigning variable values 30

calling variables 31

code completion 29

creating functions 32

creating subroutines 32

declaring arrays 31

declaring dynamic arrays 32

declaring variables 29

font and color options 34

outlining 151

script syntax 28

variable scope 30

Throw statement 559

Time statement 560

Timing statements 349

Today statement 560

Toolbars

adding buttons 37

656

Page 681: QA Wizard Pro User Guide v2017 - Perforce

Index: ToString statement – WebGetAllCustomHeaders statement

creating 37

customizing 36

displaying 36

hiding 36

modifying 38

options 38

removing buttons 37

ToString statement

JSONArray 561

JSONObject 561

Touch action statements 349

TouchDown statement 562

TouchMove statement 563

TouchUp statement 564

Trim statement 564

Troubleshooting

OCR 186

QTP conversions 314

RDBMS connections 319

variables 213

Try...Catch...Finally statement 565

TypeText statement 566

U

Uncommenting steps 155

Undocking panes 35

Unlocking keyboard and mouse 77

Updating batches 86

Upper statement 566

URL format rules

applying 229

creating 227

deleting 232

editing 230

URLROOT repository variable 220

Usage statistics 4

User agents 106

UserName statement 567

V

Variables

assigning values 30

calling 31

debugging 213

finding definitions 153

finding references 153

identifier rules 30

INDEBUGMODE 213

scope 30

troubleshooting 213

Versions

adding 51

W

WaitForExists statement 567, 569

WaitForExistsTimed statement 568

Warning statement 570

Web applications

adding browser actions 149

testing dynamic sites 223

testing on different servers 226

working with text in HTML elements 162

Web browser action statements 350

Web statements 350

WebAddNetworkCredential statement 570

WebAddSessionVariable statement 571

WebClearAllCustomHeaders statement 572

WebClearNetworkCredentials statement 572

WebCloseAllConnections statement 572

WebCloseConnection statement 573

WebDelete statement 573

WebGet statement 574

WebGetAllCustomHeaders statement 574

657

Page 682: QA Wizard Pro User Guide v2017 - Perforce

Index: WebGetCookie statement – Year statement

WebGetCookie statement 575

WebGetCustomHeader statement 576

WebGetReferrer statement 577

WebGetUserAgent statement 578

WebHead statement 578

WebOptions statement 579

WebPatch statement 579

WebPatchFromFile statement 580

WebPatchJSON statement 581

WebPost statement 581

WebPostFromFile statement 582

WebPostJSON statement 583

WebPut statement 584

WebPutFromFile statement 584

WebPutJSON statement 585

WebRemoveAllSessionVariables statement 586

WebRemoveCustomHeader statement 586

WebRemoveSessionVariable statement 587

WebSetCookie statement 588

WebSetCustomHeader statement 588

WebSetReferrer statement 589

WebSetUserAgent statement 590

Weekday statement 590

WeekdayName statement 591

WeekdayNum statement 591

While statement 592

Window action statements 351

Window and control properties

adding to user-added controls 140

deleting from user-added controls 142

finding and replacing 134

modifying 122

setting advanced options 131

Workbook

adding tasks 283

deleting tasks 284

duplicating tasks 282

editing tasks 284

viewing tasks 284

Workspaces

adding existing files 23

adding folders 24

creating 23

modifying properties 25

opening 26

renaming 25

WriteRegistryEntry statement 592

X

Xor operator 599

XPath

search method 124, 223

using in statements 225

using queries 223

Y

Year statement 593

658