Showing posts with label Automation Object Model Sample Script. Show all posts
Showing posts with label Automation Object Model Sample Script. Show all posts

Wednesday, December 29, 2010

Automation Object Model - Sample QTP Script

'AOM
'Code for Automating the QTP Operation by using Automation Object Model

Option Explicit
Dim qtapp,qtrep,qtfun,qttest
set qtapp=CreateObject("QuickTest.Application")
qtapp.Launch
qtapp.Visible=true
qtapp.ActivateView "ExpertView"
qtapp.ShowpaneScreen "Datatable",True
qtapp.ShowpaneScreen "ActiveScreen",True
qtapp.ShowpaneScreen "DebugViewer",True
qtapp.Open "C:\Documents and Settings\Administrator\Desktop\Recovery"
set qtrep=qtapp.Test.Actions("Action1").ObjectRepositories
qtrep.Add "C:\Documents and Settings\Administrator\Desktop\Rep123.tsr"
set qtfun=qtapp.Test.Settings.Resources.Libraries
qtfun.Add "C:\Documents and Settings\Administrator\Desktop\funlib.vbs"
set qttest=qtapp.Test
qttest.Run
qtapp.windowstate="maximized"
qtapp.quit
set qtapp=Nothing
set qtrep=nothing
set qtfun=nothing
set qttest=nothing
'**********************************************************