51Testing软件测试论坛

标题: WinRunner:ddt function to retrieve data [打印本页]

作者: pcl2004_27    时间: 2006-10-30 14:21
标题: WinRunner:ddt function to retrieve data
Description

      ddt function to retrieve data.


Solution

      An excellent function to use when you have loads of columns in you spreadsheet and dont want to read in each one with
value = ddt_val(table, "value");

This function will create an array which will hold data of the current row. The column name from the table is used as the index for the array.

an example of the function call is:
funcDdtBuildArray(table,table_Row,dataArray);

email nkaria@ctc.uk.com if you have any questions.


public function funcDdtBuildArray(in table, in i, out Array[]){

auto j,parList,parNum, parArray[];

ddt_get_parameters(table,parList,parNum);
split(parList,parArray," ");
ddt_set_row(table,i);

for(j=1;j<=parNum;j++){

Array[parArray[j]]=ddt_val(table,parArray[j]);
}
}
作者: pcl2004_27    时间: 2006-10-30 14:22
标题: WinRunner:To click on a dynamic link
Description

      Dynamic links cannot be added in the GUI MAP becuase they change so here's a function that will help you add the link to the GUI MAP temporarily and also click on the link


Solution

      public function web_click_dynamic_link(in link)
{
auto res_arr[];

#extern FalconASGui;
GUI_add ("","page_name",link,"{class: object,MSW_class: html_text_link,html_name: \"" & link & "\"}");

set_window("page_name",10);
win_find_text("page_name",link,res_arr);
win_click_on_text("page_name",link,res_arr[1],res_arr[2],res_arr[3],res_arr[4],FALSE,LEFT);
wait(3);

web_sync(10);
GUI_delete("","page_name",link);
}




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2