Micro Focus QTP (UFT) Forums
Give path in .vbs file - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Give path in .vbs file (/Thread-Give-path-in-vbs-file)



Give path in .vbs file - topnil - 11-03-2009

Hi All ,

I am using .vbs file to start QTP , in .vbs i want to give relative path ,
some how i gave it but not worked

what can be the issue ?

This is my .vbs file

Code:
dim folder, path , path2
dim arg1,arg2
Set args=WScript.Arguments
arg1=args.item(0)
path2 = "..\..\bin\GetAc"

Dim qtpApp    
Dim qtpTest      
Set qtpApp = CreateObject("QuickTest.Application")
qtpApp.Visible = true
if arg1=1 then
qtpApp.Open path2, True  
else
qtpApp.Open path2, True  
end if
Set qtpTest = qtpApp.Test  
qtpTest.Run
qtpTest.Close
qtpApp.quit
Set qtTest = Nothing
Set qtApp = Nothing
if arg1=1 then
path = "..\..\Downloads"
set filesys=CreateObject("Scripting.FileSystemObject")
Set folder = filesys.CreateFolder(path)
end if

path variable is working and path2 is not working , it gives 'cannot open test' error

Thanks in advance


RE: Give path in .vbs file - Saket - 11-03-2009

This is not supported in QTP AOM, you should use the abosulte path to open a test. You can get the absolute path using 'filesys.GetAbsolutePathName' and then open the script.


RE: Give path in .vbs file - topnil - 11-04-2009

Hi Saket

Thanks for help, it works