WinRunner:Modifying searchpath for the current test.
DescriptionThis technique allows each test to modify the searchpath as needed without adding duplicates and leaving unnecessary directories in it.
Solution
#Get the current path and the test path.
orgPath = getvar("searchpath");
testPath = getvar("curr_dir");
#if the test path is not in the current path
if ( index(orgPath,testPath) == 0 )
{
#add the test path to the current path.
newPath = orgPath & "<" & testPath & ">";
setvar("searchpath",newPath);
}
#Tests go here.
#Restore the old path.
if ( orgPath != "" )
{
setvar("searchpath",orgPath);
}
页:
[1]