Header Ads

How to get Test Path in QTP

Many a times we need to find out from where the test is running i.e.-the parent path.here is the code for finding out the parent path.

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application objectqtpApp.Test.Location
TestLoc = qtApp.Test.Location
MsgBox TestLoc

Another way..
msgbox Environment("TestDir")

However you need to save the test before run.Else will give
1.not save
2.temp directory as output.
Powered by Blogger.