Interview Questions

WinRunner script to get Min and Max

Mercury WinRunner FAQ


(Continued from previous question...)

WinRunner script to get Min and Max

public function fnMinMaxWinrunner (in action)
{
auto handle;
const SW_MAXIMIZE = 3;
const SW_MINIMIZE = 6;
load_dll("user32.dll");
#extern int ShowWindow(long, int);
win_get_info("{class: window, label: \"!WinRunner.*\"}", "handle", handle);
switch(action)
{
case "SW_MINIMIZE" :
{
# Maximizing WinRunner
ShowWindow(handle, SW_MINIMIZE);
wait(2);
break;
}
case "SW_MAXIMIZE" :
{ # Maximizing WinRunner
ShowWindow(handle, SW_MAXIMIZE);
wait(2);
break;
}
}
unload_dll("user32.dll");
};

(Continued on next question...)

Other Interview Questions