Object Model QTP Automation, Test
Object Model in QTP with Real Life Example
Explain
in brief about the QTP Automation Object Model
…
Automation of QTP
itself deals for QTP Automation Object model. Around all type of
Functionality and configuration offered by QTP is presented by the
QTP's Automation Object Model. All Type of Dialog Boxes in QTP have
related automation object which can be retrieved or set with the help
of related functions or properties in automation object model. QTP
Automation objects can use with standard Visual Basic programming
features i.e. conditional statements or iterative loops statements to
co-operate you design a selected script.
Automation Object
model is just a collection of objects, properties and methods which
can be used to execute the quickest operations. All From this object
model we can execute the process explained on the interface of QTP.
For each and all option in QTP interface (Menus) have methods,
properties and Objects are available there under this model.
And AOM is the
subject to automate QTP itself.
Dim qtApp Dim qtpTest 'Generate the QTP Application object Set qtApp = CreateObject("QuickTest.Application") 'When QTP is not open then open it If qtApp.launched <> True then qtApp.Launch End If 'Make Visible the Quick Test application qtApp.Visible = True 'Set Quick Test execution options 'Inform Quick Test to execute next step if error generates qtApp.Options.Run.ImageCaptureForTestResults = "OnError" qtApp.Options.Run.RunMode = "Fast" qtApp.Options.Run.ViewResults = False 'Test need to open in read-only mode qtApp.Open "C:\Program Files\HP\QuickTest Professional\Tests\trial", True 'set the execution settings for the test script Set qtpTest = qtApp.Test 'Inform Quick Test to execute the next step if error generates qtpTest.Settings.Run.OnError = "NextStep" 'Run the test qtpTest.Run 'Verify the Output of the executed test MsgBox qtpTest.LastRunResults.Status ' Close the test script qtpTest.Close 'Close QTP qtApp.quit 'Release Object Now Set qtpTest = Nothing Set qtApp = Nothing
Object Model QTP Automation |
No comments:
Post a Comment