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 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.
How to get Test Path in QTP How to get Test Path in QTP Reviewed by Animesh Chatterjee on January 20, 2009 Rating: 5

No comments:

Powered by Blogger.