Micro Focus QTP (UFT) Forums
Launch QTP and driver script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Launch QTP and driver script (/Thread-Launch-QTP-and-driver-script)



Launch QTP and driver script - eltee - 03-25-2011

Hi,

Could you help me with writing a script which will launch QTP, associate the function library and repository, import inputsheet and run the driver script?

Thanks,
Liju


RE: Launch QTP and driver script - manishbhalshankar - 03-25-2011

Hi Eltee,

This can be done using VBScript. Search for it I am sure you will get something in this forum.


RE: Launch QTP and driver script - basanth27 - 03-25-2011

Since its easy to answer -
Search with the keyword as AOM or Quicktest.application


RE: Launch QTP and driver script - eltee - 03-29-2011

Hi team,

I wanted to keep it simple. Here's my code:

Code:
Dim qtApp
Const ForReading = 1, ForWriting = 2
Dim fso, f, result
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Results.txt", ForWriting, True)
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.Test.Settings.Resources.Libraries.Add(LibraryDirectory&"Generic_function.qfl")
Set qtResourcesTab = qtApp.Test.Settings.Resources
qtTestResourcesTab.ObjectRepositoryPath = "E:\Framework\Object_Repository\AAI_Object_Repository_merged_March24.tsr"
qtp.open "E:\Framework\SampleTest\DriverScript_WithoutDiscount",True,True
And VBScript error throws upon line 11 (w.r.t to qtResourcesTab). Please help me launch the correct Obj Rep and open the driver script in QTP.