LoadRunner函数大全.docx
- 文档编号:4210699
- 上传时间:2023-05-06
- 格式:DOCX
- 页数:167
- 大小:97.05KB
LoadRunner函数大全.docx
《LoadRunner函数大全.docx》由会员分享,可在线阅读,更多相关《LoadRunner函数大全.docx(167页珍藏版)》请在冰点文库上搜索。
LoadRunner函数大全
LoadRunner函数大全
1
LoadRunner函数大全之中文解释
//button_press函数激活指定的推按钮。
intbutton_press(LPCSTRbutton);
//button_set函数将按钮状态设置为ON或OFF。
intbutton_set(LPCSTRbutton,intstate);
//close_session函数关闭所有打开的窗口并结束
//当前的Baan会话。
在Baan模板中创建的此函数
//出现在脚本的vuser_end部分中。
intclose_session();
//edit_get_text函数返回在指定edit对象中
//找到的所有文本。
若要从特定块中读取文本,
//请使用edit_get_block。
intedit_get_text(LPCSTRedit,char*out_string);
//edit_set函数使用指定的字符串设置edit对象的
//内容。
该字符串将替换任何现有字符串。
intedit_set(LPCSTRedit,LPCSTRtext);
//edit_set_insert_pos函数将光标放置
//在edit对象内的指定位置。
intedit_set_insert_pos(LPCSTRedit,introw,intcolumn);
//edit_set_selection函数突出显示指定文本。
intedit_set_selection(LPCSTRedit,intstart_row,intstart_column,intend_row,int
end_column);
//edit_type函数将文本字符串输入到edit
//对象中。
该文本字符串不会替换现有字符串;
//它替换的是位于当前光标位置的指定文本。
intedit_type(LPCSTRedit,LPCSTRtext);
//init_session函数通过指定登录数据和配置
//信息打开Baan连接。
此函数向Baan服务器
//呈现包含在BaanConfiguration部分中
//的信息。
intinit_session(char*host,char*user,char*password,char*BSE,char*Bshell_name,char
*settings);
//list_activate_item函数双击列表中的项目。
2
//项目可由其逻辑名称指定。
intlist_activate_item(LPCSTRlist,LPCSTRitem);
//list_collapse_item函数隐藏展开的TreeView
//列表中的子项,例如文件夹中的各个文件。
intlist_collapse_item(LPCSTRlist,LPCSTRitem);
//list_expand_item函数显示展开的
//TreeView列表中所隐藏的子项,例如
//文件夹中的各个文件。
intlist_expand_item(LPCSTRlist,LPCSTRitem);
//list_get_selected函数返回列表中的选定
//项目。
它既查找标准列表,也查找多选项列表。
intlist_get_selected(LPCSTRlist,LPCSTRout_item,LPCSTRout_num);
//list_select_item函数从列表中选择项目
//(在项目上执行一次鼠标单击)。
项目可由
//其名称或数字索引指定。
索引被指定为一个
//字符串,并前置有字符#。
列表中的第一个
//项目编号为0。
例如,列表中的第三个项目
//将表示为"#2"。
intlist_select_item(LPCSTRlist,LPCSTRitem);
//menu_select_item函数根据菜单
//的逻辑名称和项目名称从菜单中选择
//项目。
注意,菜单和项目表示为单个
//字符串,并使用分号分隔。
intmenu_select_item(LPCSTRmenu_item);
//obj_get_info函数检索指定属性的值,
//并将其存储在out_value中。
intobj_get_info(LPCSTRobject,LPCSTRproperty,char*out_value);
//obj_get_text函数从指定的对象
//或对象区域中读取文本。
intobj_get_text(LPCSTRobject,LPCSTRout_text);
//obj_mouse_click函数在对象内的
//指定坐标处单击鼠标。
intobj_mouse_click(LPCSTRobject,intx,inty,[mouse_button]);
//obj_mouse_dbl_click函数在对象内的
//指定坐标处双击鼠标。
3
intobj_mouse_dbl_click(LPCSTRobject,intx,inty,[mouse_button]);
//obj_mouse_drag函数在GUI
//对象中执行鼠标拖动操作。
指定的
//坐标是相对于GUI对象(而非
//屏幕)的左上角。
intobj_mouse_drag(LPCSTRobject,intstart_x,intstart_y,intend_x,intend_y,[ButtonT
mouse_button]);
//obj_type函数指定将keyboard_input
//发送到的目标对象。
intobj_type(LPCSTRobject,unsignedcharkeyboard_input,[unsignedcharmodifier]);
//obj_wait_info函数等待对象
//属性达到指定值,然后继续
//测试运行。
如果未达到指定
//值,则函数将一直等到时间
//到期,然后再继续测试。
intobj_wait_info(LPCSTRobject,LPCSTRproperty,LPCSTRvalue,UINTtime);
//scroll_drag_from_min函数将滚动屏
//移动到与最小位置相距指定距离的位置。
intscroll_drag_from_min(LPCSTRobject,[intorientation],intposition);
//scroll_line函数滚动指定行数。
//此函数可用于滚动栏和滑块对象。
intscroll_line(LPCSTRscroll,[ScrollTorientation],intlines);
//scroll_page函数将滚动屏移动指定页数。
intscroll_page(LPCSTRscroll,[ScrollTorientation],intpages);
//set_default_timeout函数设置回放
//期间BaanVuser函数的超时期间段。
//例如,当脚本执行set_window函数
//时,如果窗口在指定超时时间段内没有
//出现,则会生成错误。
voidset_default_timeout(longtime);
//set_exception函数指定在发生异常时
//应执行的操作。
应指定要调用以处理异常
//窗口的函数。
voidset_exception(LPCSTRtitle,longfunction);
//set_think_time函数指定脚本执行
4
//期间要使用的思考时间范围。
运行脚本
//时,LoadRunner使用指定范围内的
//随机思考时间,并在每个操作完成后
//暂停该思考时间长度。
voidset_think_time(USHORTstart_range,USHORTend_range);
//set_window函数将输入定向到
//当前应用程序窗口并在GUI图中
//设置对象标识范围。
intset_window(LPCSTRwindow[,inttimeout]);
//start_session函数在Baan
//服务器上开始指定的会话。
intstart_session(LPCSTRsession);
//static_get_text函数返回在指定
//静态text对象中找到的所有文本。
intstatic_get_text(LPCSTRstatic_obj,LPCSTRout_string);
//tab_select_item函数选择一个选项卡项目。
inttab_select_item(LPCSTRtab,LPCSTRitem);
//tbl_activate_cell函数在指定表单元格中
//按Enter键。
如果指定了列名,LoadRunner
//将直接从数据库中获取该名称。
inttbl_activate_cell(LPCSTRtable,LPCSTRrow,LPCSTRcolumn);
//tbl_get_cell_data函数根据
//单元格包含的数据类型获取表中
//指定单元格的内容。
如果指定了
//列名,将从数据库自身(而非应用
//程序)中获取该名称。
inttbl_get_cell_data(LPCSTRtable,LPCSTRrow,LPCSTRcolumn,LPCSTRout_text);
//tbl_get_selected_cell函数
//检索焦点所在的表单元格的行号和
//列名。
注意,列名取自数据库自身,
//而非应用程序。
inttbl_get_selected_cell(LPCSTRtable,char*out_row,char*out_column);
//tbl_press_zoom_button函数
//激活指定表单元格的缩放窗口。
inttbl_press_zoom_button(LPCSTRtable,LPCSTRrow,LPCSTRcolumn);
5
//tbl_set_cell_data函数根据单元格
//包含的数据类型使用指定数据设置单元格
//的值。
如果指定了列名,LoadRunner
//将直接从数据库中获取该名称。
inttbl_set_cell_data(LPCSTRtable,LPCSTRrow,LPCSTRcolumn,LPCSTRdata);
//tbl_set_selected_cell函数将焦点
//设置到表中的指定单元格上。
指定列名时,
//LoadRunner将直接从数据库中获取该名称。
inttbl_set_selected_cell(LPCSTRtable,LPCSTRrow,LPCSTRcolumn);
//tbl_set_selected_row函数选择表中的指定行。
inttbl_set_selected_row(LPCSTRtable,LPCSTRrow);
//tbl_set_selected_rows函数选择指定行范围。
inttbl_set_selected_rows(LPCSTRtable,LPCSTRfrom_row,LPCSTRto_row);
//tbl_wait_selected_cell函数等待
//表单元格显示后,再继续脚本执行。
inttbl_wait_selected_cell(LPCSTRtable,char*row,char*column,UINTtime);
//toolbar_button_press函数激活工具栏中的按钮。
inttoolbar_button_press(LPCSTRtoolbar,LPCSTRbutton);
//type函数描述发送给用于测试
//的应用程序的键盘输入。
inttype(LPCSTRkeyboard_input);
//win_activate函数通过向指定窗口
//授予焦点并将其升到显示器最上端,
//使其成为活动窗口(等价于单击窗口
//标题栏)。
所有后续输入都将提交给
//此窗口。
intwin_activate(LPCSTRwindow);
//win_close函数关闭指定窗口。
intwin_close(LPCSTRwindow);
//win_get_info函数检索指定属性的值
//并将其存储在out_value中。
intwin_get_info(LPCSTRwindow,LPCSTRproperty,char*out_value);
//win_get_text函数从指定窗口或
//窗口区域读取文本。
6
intwin_get_text(LPCSTRwindow,LPCSTRout_text);
//win_max函数将指定窗口
//最大化以充满整个屏幕。
intwin_max(LPCSTRwindow);
//win_min函数将指定窗口最小化为图标。
intwin_min(LPCSTRwindow);
//win_mouse_click函数在选中窗口
//的指定坐标处执行鼠标单击操作。
intwin_mouse_click(LPCSTRwindow,intx,inty,ButtonTbutton);
//win_mouse_dbl_click函数在选中窗口
//的指定坐标处执行鼠标双击操作。
intwin_mouse_dbl_click(LPCSTRwindow,intx,inty,ButtonTbutton);
//win_mouse_drag函数在窗口内执行
//鼠标拖动操作。
注意,指定的坐标是
//相对于窗口(而非屏幕)的左上角。
intwin_mouse_drag(LPCSTRwindow,intstart_x,intstart_y,intend_x,intend_y,ButtonT
button);
//win_move函数将窗口移动到新的绝对位置。
intwin_move(LPCSTRwindow,intx,inty);
//win_resize函数更改窗口的位置。
intwin_resize(LPCSTRwindow,intwidth,intheight);
//win_restore函数将窗口从图标化
//或最大化状态还原为其原始大小。
intwin_restore(LPCSTRwindow);
//win_wait_info函数等待窗口
//属性达到指定值,然后继续测试
//运行。
如果未达到指定值,则函数
//将一直等到时间到期,然后再继
//续测试。
intwin_wait_info(LPCSTRwindow,LPCSTRproperty,LPCSTRvalue,UINTtime);
//win_type函数指定keyboard_input
//将发送到的目标窗口。
intwin_type(LPCSTRwindow,LPCSTRkeyboard_input);
7
//ctrx_
//的值分配给值缓冲区。
ctrx_obj_get_info
//是一般函数,它可以适用于任何由录制器
//所标识为对象的对象。
intctrx_obj_get_info(constchar*window_name,longxpos,longypos,eObjAttributeattribute,
char*value,CTRX_LAST);
//ctrx_
//分配给值缓冲区。
ctrx_button_get_info
//获取命令按钮的信息。
intctrx_button_get_info(constchar*window_name,longxpos,longypos,eObjAttribute
attribute,char*value,CTRX_LAST);
//ctrx_
//分配给值缓冲区。
ctrx_edit_get_info
//获取文本框的信息。
intctrx_edit_get_info(constchar*window_name,longxpos,longypos,eObjAttributeattribute,
char*value,CTRX_LAST);
//ctrx_
//分配给值缓冲区。
ctrx_list_get_info
//获取列表框的信息。
intctrx_list_get_info(constchar*window_name,longxpos,longypos,eObjAttributeattribute,
char*value,CTRX_LAST);
//ctrx_connect_server将Citrix客户端连接到Citrix服务器。
intctrx_connect_server(char*server_name,char*user_name,char*password,char*domain);
//ctrx_disconnect_server断开客户端与Citrix服务器的连接。
intctrx_disconnect_server(char*server_name);
//ctrx_nfuse_connect使用NFUSE应用
//程序门户建立与Citrix服务器的连接。
在
//定义NFUSE门户的个性化规范的ICA文件
//中找到的规范将从服务器上下载,在此之后
//建立连接。
intctrx_nfuse_connect(char*url);
//使用ctrx_get_bitmap_value
//检索位图的哈希字符串值以用于您
//的自定义同步函数中。
位图坐标由
//前四个参数指定。
intctrx_get_bitmap_value(longx_start,longy_start,longwidth,longheight,char*buffer);
8
//ctrx_get_text将矩形中的文本分配到text_buffer
//中。
随后,文本可被用于关联。
intctrx_get_text(char*window_name,longxpos,longypos,longwidth,longheight,char*
filename,char*text_buffer,CTRX_LAST);
//ctrx_get_text_location在xpos、
//ypos、width和height指定区域中
//搜索指定文本。
如果找到字符串,当函数
//返回后,xpos和ypos即为找到文本的
//位置。
如果未找到字符串,xpos和ypos
//则为零。
intctrx_get_text_location(LPCSTRwindow_name,long*xpos,long*ypos,long*width,long
*height,LPSTRtext,longbMatchWholeWordOnly,LPCSTRfilename,CTRX_LAST);
//ctrx_get_waiting_time从运行时设置中获取当前等待
//时间,或者通过ctrx_set_waiting_time设置的值。
intctrx_get_waiting_time(long*time);
//使用ctrx_get_window_name检索
//当前获得焦点的窗口的名称。
intctrx_get_window_name(LPSTRbuffer);
//使用ctrx_get_window_position
//检索名为title变量值的窗口的位置。
//如果title为NULL,则函数将检索
//当前拥有焦点的窗口的位置。
intctrx_get_window_position(LPSTRtitle,long*xpos,long*ypos,long*width,long*height);
//ctrx_list_select_item函数从列表中选择项目。
//它支持ListBox或ComboBox类的列表。
intctrx_list_select_item(char*window_name,longxpos,longypos,char*item,CTRX_LAST);
//ctrx_menu_select_item突出显示
//菜单中的项目,但不激活它。
intctrx_menu_select_item(char*window_name,char*menu_path,CTRX_LAST);
//ctrx_mouse_click等待窗口window_name
//出现,然后执行鼠标单击操作。
intctrx_mouse_click(longx_pos,longy_pos,longmouse_button,longkey_modifier,char*
window_name);
//ctrx_obj_mouse_click等待窗口window_name
//出现,然后执行鼠标单击操作。
intctrx_obj_mouse_click(constcha
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- LoadRunner 函数 大全