Interview Questions

WinRunner: How to Set GUI file's searchpath?

Mercury WinRunner FAQ


(Continued from previous question...)

WinRunner: How to Set GUI file's searchpath?

WinRunner: How to Set GUI file's searchpath?
[GUI file at d:\1\2\3\4\windows.gui
How to use the script bellow to load the GUI file successfully.?
#load gui file
GUI_unload_all;
if(GUI_load("windows.gui")!=0)
{
pause("can not open \"windows.gui\" File");
texit;
}
#end loading gui

Put all the scripts at localmachine but GUI files at TD Server ,Used command line to run my scripts(successfully).
When update Winrunner 7.6 Version to 8.2 and connect to TD Server,now it seems that wrun.exe couldn't find localmachine's scripts, anyone knows wrun.exe command-line mode's new parameters(in WINRUNNER 8.2 Ver.)?

Answer1:
GUI_load("C:\\Program Files\\Mercury
Interactive\\WinRunner\\EMR\\EMR.gui");
in your winrunner startup file, you can set the path for this startup file in general options->startup
#load gui file
GUI_unload_all;
if(GUI_load("C:\\Program Files\\Mercury Interactive\\WinRunner\\EMR\\EMR.gui")!=0)
{
pause("unable to open C:\\Program Files\\Mercury
Interactive\\WinRunner\\EMR\\EMR.gui");
texit;
}
#end loading gui
you cant set path for GUI map file in winruner other than Temporary GUI Map File

Answer2:
Might suggest to your boss that the GUI is universal to all machines in spite of the fact that all machines must have their own local script in his view. Even if you are testing different versions of the same software, you can have the local machine "aware" of what software version it is running and know what GUI to load from you server. I run a lab with 30 test machines, each with their own copy of the script(s) from the server, but using one master GUI per software roll.
As far as how to set search path for the local machine, you can force that in the setup of each machine. Go to Tools=>Options=>General Options=> Folders. Once there, you can add, delete or move folders around at will. WinRunner will search in the order in which they are listed, from top down. "Dot" means search in the current directory, whatever that may be at the time.

(Continued on next question...)

Other Interview Questions