Batch Testing inwards UFT


Batch Testing inwards UFT

Batch Testing or Batch Execution

Executing Series of Tests is called Batch Testing.

It is 1 of the advantages of Test Automation, Test Tool tin execute Series of Tests without user(Tester) interaction.

If it is Manual Testing, for every Test representative execution user interaction is mandatory.

In Four ways nosotros tin acquit Batch Testing inwards UFT:
i) Using "Test Batch Runner" tool

ii) Using AOM Script (QTP Application Object)

iii) Using Driver Script (UFT Test Script)

iv) Using ALM / QC Tool
------------------------------------------
i) Using "Test Batch Runner" tool

Steps for Batch Testing using "Test Batch Runner" Tool
a) Generate basic Tests in addition to run them once.

b) Launch "Test Batch Runner" tool in addition to exercise Test batches.

c) Provide permission to "Test Batch Runner" to execute Tests.

d) Run Test batches.
-------------------------
Advantage:

Test Batch Runner tool tin execute entire Test batch or business office of the Test batch.

Disadvantage:

Test Batch Runner tool doesn't render Batch wise Test result, provides solely Test wise result.

Test Execution Process:

It launches UFT tool, provides instructions to UFT, UFT executes tests 1 past times 1 based on Test Batch Runner instructions.
----------------------------------------
Test Batch file extension is .mtb

Navigation to render Permission To Test batch runner to execute Tests.

Tools card -> Options -> GUI Testing -> Test Runs
-> Check "Allow other HP products to run Tests in addition to components" option
-> OK
----------------------------
How to thought Test Results:

i) Click "Test Result Link" inwards Test batch runner

Or

ii) Launch "Results viewer", opened upwards the Test in addition to pick out the Result.

Or

iii) In UFT, Launch "Result viewer, opened upwards the Test in addition to pick out the Result.
-------------------------------------------------------------------
Deleting Test Results:

Using Test Results Deletion tool nosotros tin delete Test Results.

Launch Test Results deletion tool

-> Browse path of the Test

-> Select Test Results -> Delete
-------------------------------
ii) Batch Testing using AOM Script

AOM - Automation Object Model
It is Private object model, created solely for UFT examination automation.

Note: File System object model, Excel object model, Database object models etc... are global object models, tin endure used for all types of Scripting(Client side scripting inwards the web, Server side Scripting inwards the web, Network Administration, System Administration in addition to Test Automation).

Create QTP Application Object

Set Variable = CreateObject("QuickTest.Application")

QTP Application Object is used to automate UFT tool operations.

Using QTP Application object nosotros tin acquit batch testing, exactly QTP application object non solely for batch testing.

AOM script file extension is .vbs

Create AOM Script:

i) Type Script inwards UFT tool editor, re-create the script, glue inwards Notepad in addition to salve equally .vbs file

Or

ii) Launch Notepad, Type Script in addition to salve equally .vbs file.

Note: UFT tool editor provides context help.

Execute AOM Script:

Run .vbs file (External file)
---------------------------------------------
Example:

1) AOM script for batch Testing

Dim objQTP
Set objQTP = CreateObject("QuickTest.Application")
objQTP.Visible = True 'To thought the UFT tool during execution

objQTP.Launch 'To launch the UFT tool

objQTP.Open "C:\Users\gcreddy\Desktop\Tests\Login" ' opened upwards the Test
objQTP.Test.Run 'Run the Test
objQTP.Test.Close 'Close the Test

objQTP.Open "C:\Users\gcreddy\Desktop\Tests\OpenOrder"
objQTP.Test.Run
objQTP.Test.Close

objQTP.Open "C:\Users\gcreddy\Desktop\Tests\FaxOrder"
objQTP.Test.Run
objQTP.Test.Close

objQTP.Quit 'To unopen UFT tool
Set objQTP = Nothing
--------------------------------------------------
2) Read Test paths from a text file in addition to acquit batch testing using AOM.

Dim objFso, objTextstream, objQTP, testpath
Set objFso = CreateObject("scripting.FileSystemObject")
Set objTextstream = objFso.OpenTextFile ("C:\Users\gcreddy\Desktop\testPaths.txt")

Set objQTP = CreateObject("QuickTest.Application")
objQTP.Visible = True
objQTP.Launch

Do Until objTextstream.AtEndOfStream = True
testpath = objTextstream.ReadLine

objQTP.Open testpath
objQTP.Test.Run
objQTP.Test.Close
Loop

objQTP.Quit
objTextstream.Close

Set objQTP = Nothing
Set objTextstream = Nothing
Set objFso = Nothing
---------------------------------------------
Regular Expressions inwards UFT

What is Regular Expression?
It is a Formula for matching patterns.

Constant matching

india.doc - india.doc
 

Pattern Matching

i*.

ia....
ib.....
.
.
india.doc
--------------------------------------
Usage of Regular Expressions inwards UFT:
i) To grip Dynamic objects


How to role Regular Expressions:

If it is Object Repository based Test, opened upwards Object Repository, pick out the object in addition to render Regular expression.

If it is Descriptive programming, Provide Regular facial expression guide inwards the Test Script.

[0-9]
[A-Z]
[a-z]

Ex:
For ord = 8 To eleven Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set ord
wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;Fax Order..."
Window("Flight Reservation").Dialog("text:=Fax Order No. [0-9]*").Activate
Window("Flight Reservation").Dialog("text:=Fax Order No. [0-9]*").ActiveX("progid:=MSMask.MaskEdBox.1").Type "1111111111"
Window("Flight Reservation").Dialog("text:=Fax Order No. [0-9]*").WinButton("text:=&Send").Click
Next

'Regular expressions inwards Checkpoints

For i = 1 To 10 Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set i
wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Tickets:").Check CheckPoint("Tickets:")
Next
--------------------------------------
Regular Expression ObjectUsing New in addition to RegExp keywords nosotros tin exercise Regular facial expression object.

Syntax:

Set variable = New Regexp

ii) For Search operations

------------------------------------

Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post