cid=77
VB Script - Part III Start QTP, open an existing test and Run the Test:
Working with Files using FSO
Dim qtApp
Excel Dim qtTest
'Close QTP
Contact Us qtApp.quit
'Release Object
Set qtTest = Nothing
info@qtpworld.com Set qtApp = Nothing
+91- 9886477710
Start QTP, open an existing test and Run the Test And Store Run Results in Specified Folder:
Dim qtApp
Dim qtTest
Dim qtResultsOpt
qtApp.Launch
End If
1 of 4 1/29/2016 9:37 AM
QTPWorld http://www.qtpworld.com/index.php?cid=77
'Close QTP
qtApp.quit
'Release Object
Set qtResultsOpt = nothing
Set qtTest = Nothing
Set qtApp = Nothing
Dim qtApp
Dim qtTest
'Example : qtApp.TDConnection.Connect
'"http://200.168.1.1:8080/qcbin","Default","proj1","qtpworld","qtp",false
End If
'Close QTP
qtApp.quit
'Release Object
Set qtApp = Nothing
Start QTP, open an existing test, associate Object Repositories and save the test:
Dim qtApp
Dim qtTest
Dim qtRepositories
2 of 4 1/29/2016 9:37 AM
QTPWorld http://www.qtpworld.com/index.php?cid=77
' Get the object repositories collection object of the "SignIn" action
Set qtRepositories = qtApp.Test.Actions("SignIn").ObjectRepositories
' Add Object repositry "Reposit.tsr" if it's not already associated wit action "SignIn"
If qtRepositories.Find("D:\Reposit.tsr") = -1 Then
qtRepositories.Add "D:\Reposit.tsr", 1
End If
'Close QTP
qtApp.quit
'Release Object
Set qtLibraries = Nothing
Set qtTest = Nothing
Set qtApp = Nothing
Start QTP, open an existing test, associate libraries and save the test:
Dim qtApp
Dim qtTest
Dim qtLibraries
'If the library file "libraary.vbs" is not assiciates with the Test then associate it
If qtLibraries.Find("D:\libraary.vbs") = -1 Then
qtLibraries.Add "D:\libraary.vbs", 1
End If
'Close QTP
qtApp.quit
'Release Object
Set qtLibraries = Nothing
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
Dim qtApp
End If
'Close QTP
qtApp.quit
'Release Object
Set qtApp = Nothing
3 of 4 1/29/2016 9:37 AM
QTPWorld http://www.qtpworld.com/index.php?cid=77
End If
'Close QTP
qtApp.quit
'Release Object
Set qtApp = Nothing
Start QTP, Open an Existing Test and Get All Available Action Names From the Test:
Dim qtApp
'Create the QTP Application object
Set qtApp = CreateObject("QuickTest.Application")
MsgBox qtApp.Test.Actions(iCounter).Name
Next
'Close QuickTest
qtApp.Quit
'Release Object
Set qtApp = Nothing
Copyright QTPWorld.com 2013 Home | Demo videos | Students | Training | FAQ's | Feedback | About Us Designed By WebZone
4 of 4 1/29/2016 9:37 AM