If the winrunner always crash for something, you should select this option to avert it.
The past is experience, the present is experiment and the future is exam.
Use your experience in your experiments, and you will pass the exams. (3 Idiots, 2009)
Linkedin : tw.linkedin.com/in/iamsunny
The ping check.
returncode = E_OK;
db_file_name="H:\\QAautomation\\WinRunner\\log.txt";
dos_system("ping www.google.org > " db_file_name);
file_open(db_file_name, FO_MODE_READ);
while(file_getline(db_file_name, line) == E_OK) {
if (match(line, "100% loss")) {
tl_step ( "ping check", FAIL, "check fail");
returncode = FAIL;
break;
}
}
print returncode;
file_close(db_file_name);
db_file_name="H:\\QAautomation\\WinRunner\\log.txt";
dos_system("ping www.google.org > " db_file_name);
file_open(db_file_name, FO_MODE_READ);
while(file_getline(db_file_name, line) == E_OK) {
if (match(line, "100% loss")) {
tl_step ( "ping check", FAIL, "check fail");
returncode = FAIL;
break;
}
}
print returncode;
file_close(db_file_name);
Function get newset firmware
function get_newest_firmware()
{
auto temp_file, rc;
auto line;
temp_file = "c:\\_retivista_firmware_list.txt";
dos_system("dir C:\\firmware\\rv /B/O-D > " & temp_file);
file_open(temp_file,"r");
rc = file_getline(temp_file, line); #Read file line by line.
pause(line); #Type contents into a Pause message
file_close(temp_file); #Close file
dos_system("del " & temp_file); #Delete file.
return(line);
}
fr = get_newest_firmware();
{
auto temp_file, rc;
auto line;
temp_file = "c:\\_retivista_firmware_list.txt";
dos_system("dir C:\\firmware\\rv /B/O-D > " & temp_file);
file_open(temp_file,"r");
rc = file_getline(temp_file, line); #Read file line by line.
pause(line); #Type contents into a Pause message
file_close(temp_file); #Close file
dos_system("del " & temp_file); #Delete file.
return(line);
}
fr = get_newest_firmware();
function ipconfig
function ipconfig;
{
file_name="c:\\temp\\settings.txt";
dos_system("ipconfig > "file_name);
file_open(file_name,FO_MODE_READ);
while(file_getline(file_name,line)==E_OK)
value=value&line&"\n";
file_close(file_name);
print value;
}
{
file_name="c:\\temp\\settings.txt";
dos_system("ipconfig > "file_name);
file_open(file_name,FO_MODE_READ);
while(file_getline(file_name,line)==E_OK)
value=value&line&"\n";
file_close(file_name);
print value;
}
What's diffence between GUI_unload_all and GUI_close_all!
GUI_open加載GUI map文件(也可编輯GUI map文件),如果你只想编輯GUI map文件,你可以用GUI_open功能打開GUI map文件來编輯,而不加載這個文件.
用GUI_close功能關閉文件.
用GUI_unload和GUI_unload_all功能卸除已經加載的 GUI map文件.
使用GUI_close_all後不能對GUIMAP文件進行编輯,而GUI_unload_all則可以進行编輯
GUI_open => load and edit the GUI Map (load and edit)
GUI_close => close GUI map and you can not edit it any more (only close)
GUI_load => load the GUI map, but you can not edit it.(only load)
GUI_unload => unload the GUI map, also you can edit it because you did not closed(unload and edit)
用GUI_close功能關閉文件.
用GUI_unload和GUI_unload_all功能卸除已經加載的 GUI map文件.
使用GUI_close_all後不能對GUIMAP文件進行编輯,而GUI_unload_all則可以進行编輯
GUI_open => load and edit the GUI Map (load and edit)
GUI_close => close GUI map and you can not edit it any more (only close)
GUI_load => load the GUI map, but you can not edit it.(only load)
GUI_unload => unload the GUI map, also you can edit it because you did not closed(unload and edit)
在测试運行時自動關閉弹出窗口,繼續進行測試。
下面我們對弹出窗口 Flight Reservations進行處理:
1 使用恢复向导的步骤:
1)打开 Recovery Wizard,选择 Popup event 〉next;
2)在Scenario Name框中输入场景名稱,此對以 popup_win 為名,並輸入Description(可選),next;
3)单击 手型 选择弹出窗口 Flight Reservations, next;
4)此时在恢复操作(Recovery Operations)中有三个选项:Click button, Close active window,Exceute a recovery function.
a如果选择 Click button,那么就单击 手型 选择弹出窗口 Flight Reservations 中的 “确定”按钮, next;
b可以选择 Close active window, next;
c如果选择Exceute a recovery function,那么需要键入恢复功能的名称,然后单击 Define recovery function ,定义恢复功能。在Recovery Function 中输入如下代码:
if( win_exists("Flight Reservations",20 ) == E_OK){
set_window("Flight Reservations", 10);
report_msg("popup win exists");
#win_close("Flight Reservations");
button_press("确定");
}
exception_on("popup_win");
此时,会提示需要将该函数保存在一个Compiled Module中,并在需要执行恢复操作的脚本中加载该模块。此处我们假设将该模块命名为 popupException.然后在脚本 aa 的开始处加上 load(".\\popupException") 即可;
5)单击 Finish。
完成上面步骤后,就可在测试运行时自动关闭该弹出窗口,继续进行测试。
1 使用恢复向导的步骤:
1)打开 Recovery Wizard,选择 Popup event 〉next;
2)在Scenario Name框中输入场景名稱,此對以 popup_win 為名,並輸入Description(可選),next;
3)单击 手型 选择弹出窗口 Flight Reservations, next;
4)此时在恢复操作(Recovery Operations)中有三个选项:Click button, Close active window,Exceute a recovery function.
a如果选择 Click button,那么就单击 手型 选择弹出窗口 Flight Reservations 中的 “确定”按钮, next;
b可以选择 Close active window, next;
c如果选择Exceute a recovery function,那么需要键入恢复功能的名称,然后单击 Define recovery function ,定义恢复功能。在Recovery Function 中输入如下代码:
if( win_exists("Flight Reservations",20 ) == E_OK){
set_window("Flight Reservations", 10);
report_msg("popup win exists");
#win_close("Flight Reservations");
button_press("确定");
}
exception_on("popup_win");
此时,会提示需要将该函数保存在一个Compiled Module中,并在需要执行恢复操作的脚本中加载该模块。此处我们假设将该模块命名为 popupException.然后在脚本 aa 的开始处加上 load(".\\popupException") 即可;
5)单击 Finish。
完成上面步骤后,就可在测试运行时自动关闭该弹出窗口,继续进行测试。
The popup function.
msg.sh is for popup function.
we can use it to verify the computer is connect to send message.
# If the computer can not recognize the name of each computer then the popup function won't work.
# The popup function is depend on net this command to send message to other computer.
we can use it to verify the computer is connect to send message.
# If the computer can not recognize the name of each computer then the popup function won't work.
# The popup function is depend on net this command to send message to other computer.
訂閱:
文章 (Atom)