pcl2004_27 发表于 2006-10-25 13:47:31

WinRunner:Modifying searchpath for the current test.

Description

      This 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]
查看完整版本: WinRunner:Modifying searchpath for the current test.