Pages

Tuesday, November 13, 2012

Quick Test Professional (QTP) - PathFinder Object


This object can be used to find the absolute path to a file. QTP allows setting folder path in the Tools->Options->Folders (Tab) as shown in the figure and in situations where we want to determine which particular folder a file reside in we can use PathFinder.Locate method. Consider the following example:




Let's say we want find the key.txt file located in the "C:\Setup" folder.
'this will assign "C:\Setup\key.txt" to x
x = PathFinder.Locate("key.txt")

Even if "C:\Support" folder has a "key.txt" file, the Locate method will still return "C:\Setup\key.txt" as the "C:\Setup"folder has higher priority than the "C:\Support" folder.

No comments:

Post a Comment