UFT Tutorial 32

UFT Class 32 (Batch Testing/ Batch Execution)
Batch Testing:

Executing series of Tests

> It is one of the advantages of Test Automation, In Manual Testing for each and every Test case execution human user interaction is mandatory. If It is automation Test Tool can execute series of tests without user interaction.

They are four ways for batch testing in UFT:

i) Using "Test Batch Runner" tool

ii) Using AOM(Automation Object Model) Script.

iii) Using Driver script in Automation framework.

iv) Using QC/ALM tool
Steps of Batch Testing Using "Test Batch Runner" tool:

a) Create basic tests and run them once.

b) Launch "Test Batch Runner" Tool and create Test batches.

c) Provide permission to "Test Batch Runner" Tool to execute tests and components.

d) Run the Test Batch.
Note: "Test Batch Runner" Tool doesn't provide batch wise Result.

Note 2: "Test Batch Runner" Tool can execute entire Test batch or part of the Test batch.
Navigation to Provide permission to "Test Batch Runner" Tool:

Tools menu -> Options -> GUI Testing -> Test Runs ->
Select "Allow other HP products to Run tests and components -> OK
Test Batch execution process:
Test batch Runner tool launches UFT tool and provides instructions,
UFT only executes Tests one by one based on "Test batch Runner" instructions.
ii) Using AOM(Automation Object Model) Script.
Automation Object model is a private object model.

Usage of VBScript:
    i) Client side scripting in the web
    ii) Server side scripting in the web
    iii) Network Administration
    iv) System Administration
    v) Test Automation etc...

Global object models (ex: Filesystem object model, Excel object model and Database object models)
for all types of Scripting,

AOM (QTP Application object) is a Private object model, it is only for
UFT Test Automation.

QTP Application object is used to automate UFT tool operations.

Create QTP Application object:

Set Variable = CreateObject("QuickTest.Application")
Note: Don't run AOM scripts from UFT tool editor,
AOM is not UFT test script, It is VBScript file.

> You can create AOM script in UFT tool editor for getting context help.

Otherwise open notepad, write the code and save as .vbs file

Example (Batch Testing using QTP Application Object):
Dim objQTP
'Create QTP Application Object, it is used to automate UFT tool operations
Set objQTP = CreateObject("QuickTest.Application")
objQTP.Visible = True 'To view the UFT tool during execution.

objQTP.Launch 'To launch UFT Tool.

objQTP.Open "C:\Users\G C Reddy\Desktop\Tests\Login"
objQTP.Test.Run 'To run the Test
objQTP.Test.Close 'To close the Test

objQTP.Open "C:\Users\G C Reddy\Desktop\Tests\OpenOrder"
objQTP.Test.Run 'To run the Test
objQTP.Test.Close 'To close the Test

objQTP.Open "C:\Users\G C Reddy\Desktop\Tests\FaxOrder"
objQTP.Test.Run 'To run the Test
objQTP.Test.Close 'To close the Test

objQTP.Quit 'To close UFT Tool
Set objQTP = Nothing 'To release the memory.
Batch Testing using AOM,

Read Test paths from a text file and execute using Loop statements.
Dim objFSO, objTextstream, objQTP, TestPath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextstream = objFSO.OpenTextFile("C:\Users\G C Reddy\Desktop\testpaths.txt")

Set objQTP = CreateObject("QuickTest.Application")

Do Until objTextstream.AtEndOfStream = True
TestPath= objTextstream.ReadLine
objQTP.Open TestPath

Set objTextstream = Nothing
Set objFSO = Nothing
Debugging Tests

What is Debugging?

Locating and Isolating Errors thru Step by Step execution

Application Life Cycle
Development phase    Testing phase        Production phase
Error            Defect            Failure
Mistake            Bug
When Debugging Tests is required?
Debugging is optional in UFT Test Automation,

Scenario 1:
Test is not showing any errors and providing correct output - Not required.

Scenario 2:
Test is showing errors -Debugging is optional

Scenario 3:
Test is not showing any errors and Not providing correct output - Debugging is required.

x = a * b

How to Debug Tests?


Post a Comment