阿祖总结-Zu.Stone@QQ.com
LoadRunner 函数大全之中文解释
// button_press 函数激活指定的推按钮。
int button_press ( LPCSTR button );
// button_set 函数将按钮状态设置为 ON 或 OFF。
int button_set ( LPCSTR button, int state );
// close_session 函数关闭所有打开的窗口并结束
// 当前的 Baan 会话。在 Baan 模板中创建的此函数
// 出现在脚本的 vuser_end 部分中。
int close_session();
// edit_get_text 函数返回在指定 edit 对象中
// 找到的所有文本。若要从特定块中读取文本,
// 请使用 edit_get_block。
int edit_get_text ( LPCSTR edit, char *out_string );
// edit_set 函数使用指定的字符串设置 edit 对象的
// 内容。该字符串将替换任何现有字符串。
int edit_set ( LPCSTR edit, LPCSTR text );
// edit_set_insert_pos 函数将光标放置
// 在 edit 对象内的指定位置。
int edit_set_insert_pos (LPCSTR edit, int row, int column );
// edit_set_selection 函数突出显示指定文本。
int edit_set_selection ( LPCSTR edit, int start_row, int start_column, int end_row, int
end_column );
// edit_type 函数将文本字符串输入到 edit
// 对象中。该文本字符串不会替换现有字符串;
// 它替换的是位于当前光标位置的指定文本。
int edit_type ( LPCSTR edit, LPCSTR text );
// init_session 函数通过指定登录数据和配置
// 信息打开 Baan 连接。此函数向 Baan 服务器
// 呈现包含在 Baan Configuration 部分中
// 的信息。
int init_session ( char * host, char * user, char *password, char *BSE, char *Bshell_name, char
* settings );
// list_activate_item 函数双击列表中的项目。
1
阿祖总结-Zu.Stone@QQ.com
// 项目可由其逻辑名称指定。
int list_activate_item ( LPCSTR list, LPCSTR item );
// list_collapse_item 函数隐藏展开的 TreeView
// 列表中的子项,例如文件夹中的各个文件。
int list_collapse_item (LPCSTR list, LPCSTR item );
// list_expand_item 函数显示展开的
// TreeView 列表中所隐藏的子项,例如
// 文件夹中的各个文件。
int list_expand_item (LPCSTR list, LPCSTR item );
// list_get_selected 函数返回列表中的选定
// 项目。它既查找标准列表,也查找多选项列表。
int list_get_selected (LPCSTR list, LPCSTR out_item, LPCSTR out_num );
// list_select_item 函数从列表中选择项目
// (在项目上执行一次鼠标单击)。项目可由
// 其名称或数字索引指定。索引被指定为一个
// 字符串,并前置有字符 #。列表中的第一个
// 项目编号为 0。例如,列表中的第三个项目
// 将表示为 "#2"。
int list_select_item ( LPCSTR list, LPCSTR item );
// menu_select_item 函数根据菜单
// 的逻辑名称和项目名称从菜单中选择
// 项目。注意,菜单和项目表示为单个
// 字符串,并使用分号分隔。
int menu_select_item ( LPCSTR menu_item );
// obj_get_info 函数检索指定属性的值,
// 并将其存储在 out_value 中。
int obj_get_info ( LPCSTR object, LPCSTR property, char *out_value );
// obj_get_text 函数从指定的对象
// 或对象区域中读取文本。
int obj_get_text (LPCSTR object, LPCSTR out_text );
// obj_mouse_click 函数在对象内的
// 指定坐标处单击鼠标。
int obj_mouse_click ( LPCSTR object, int x, int y, [mouse_button] );
// obj_mouse_dbl_click 函数在对象内的
// 指定坐标处双击鼠标。
2
阿祖总结-Zu.Stone@QQ.com
int obj_mouse_dbl_click ( LPCSTR object, int x, int y, [mouse_button] );
// obj_mouse_drag 函数在 GUI
// 对象中执行鼠标拖动操作。指定的
// 坐标是相对于 GUI 对象(而非
// 屏幕)的左上角。
int obj_mouse_drag (LPCSTR object, int start_x, int start_y, int end_x, int end_y, [ ButtonT
mouse_button] );
// obj_type 函数指定将 keyboard_input
// 发送到的目标对象。
int obj_type ( LPCSTR object, unsigned char keyboard_input, [unsigned char modifier ] );
// obj_wait_info 函数等待对象
// 属性达到指定值,然后继续
// 测试运行。如果未达到指定
// 值,则函数将一直等到时间
// 到期,然后再继续测试。
int obj_wait_info (LPCSTR object, LPCSTR property, LPCSTR value, UINT time );
// scroll_drag_from_min 函数将滚动屏
// 移动到与最小位置相距指定距离的位置。
int scroll_drag_from_min ( LPCSTR object, [int orientation], int position );
// scroll_line 函数滚动指定行数。
// 此函数可用于滚动栏和滑块对象。
int scroll_line ( LPCSTR scroll, [ScrollT orientation], int lines );
// scroll_page 函数将滚动屏移动指定页数。
int scroll_page ( LPCSTR scroll, [ScrollT orientation], int pages );
// set_default_timeout 函数设置回放
// 期间 Baan Vuser 函数的超时期间段。
// 例如,当脚本执行 set_window 函数
// 时,如果窗口在指定超时时间段内没有
// 出现,则会生成错误。
void set_default_timeout ( long time );
// set_exception 函数指定在发生异常时
// 应执行的操作。应指定要调用以处理异常
// 窗口的函数。
void set_exception ( LPCSTR title, long function );
// set_think_time 函数指定脚本执行
3
阿祖总结-Zu.Stone@QQ.com
// 期间要使用的思考时间范围。运行脚本
// 时,LoadRunner 使用指定范围内的
// 随机思考时间,并在每个操作完成后
// 暂停该思考时间长度。
void set_think_time ( USHORT start_range, USHORT end_range );
// set_window 函数将输入定向到
// 当前应用程序窗口并在 GUI 图中
// 设置对象标识范围。
int set_window ( LPCSTR window [, int timeout ] );
// start_session 函数在 Baan
// 服务器上开始指定的会话。
int start_session ( LPCSTR session );
// static_get_text 函数返回在指定
// 静态 text 对象中找到的所有文本。
int static_get_text ( LPCSTR static_obj, LPCSTR out_string );
// tab_select_item 函数选择一个选项卡项目。
int tab_select_item ( LPCSTR tab, LPCSTR item );
// tbl_activate_cell 函数在指定表单元格中
// 按 Enter 键。如果指定了列名,LoadRunner
// 将直接从数据库中获取该名称。
int tbl_activate_cell (LPCSTR table, LPCSTR row, LPCSTR column );
// tbl_get_cell_data 函数根据
// 单元格包含的数据类型获取表中
// 指定单元格的内容。如果指定了
// 列名,将从数据库自身(而非应用
// 程序)中获取该名称。
int tbl_get_cell_data (LPCSTR table, LPCSTR row, LPCSTR column, LPCSTR out_text );
// tbl_get_selected_cell 函数
// 检索焦点所在的表单元格的行号和
// 列名。注意,列名取自数据库自身,
// 而非应用程序。
int tbl_get_selected_cell (LPCSTR table, char *out_row, char *out_column );
// tbl_press_zoom_button 函数
// 激活指定表单元格的缩放窗口。
int tbl_press_zoom_button ( LPCSTR table, LPCSTR row, LPCSTR column );
4
阿祖总结-Zu.Stone@QQ.com
// tbl_set_cell_data 函数根据单元格
// 包含的数据类型使用指定数据设置单元格
// 的值。如果指定了列名,LoadRunner
// 将直接从数据库中获取该名称。
int tbl_set_cell_data (LPCSTR table, LPCSTR row, LPCSTR column, LPCSTR data );
// tbl_set_selected_cell 函数将焦点
// 设置到表中的指定单元格上。指定列名时,
// LoadRunner 将直接从数据库中获取该名称。
int tbl_set_selected_cell (LPCSTR table, LPCSTR row, LPCSTR column );
// tbl_set_selected_row 函数选择表中的指定行。
int tbl_set_selected_row (LPCSTR table, LPCSTR row );
// tbl_set_selected_rows 函数选择指定行范围。
int tbl_set_selected_rows(LPCSTR table, LPCSTR from_row , LPCSTR to_row );
// tbl_wait_selected_cell 函数等待
// 表单元格显示后,再继续脚本执行。
int tbl_wait_selected_cell (LPCSTR table, char *row, char *column, UINT time );
// toolbar_button_press 函数激活工具栏中的按钮。
int toolbar_button_press (LPCSTR toolbar, LPCSTR button );
// type 函数描述发送给用于测试
// 的应用程序的键盘输入。
int type (LPCSTR keyboard_input );
// win_activate 函数通过向指定窗口
// 授予焦点并将其升到显示器最上端,
// 使其成为活动窗口(等价于单击窗口
// 标题栏)。所有后续输入都将提交给
// 此窗口。
int win_activate (LPCSTR window );
// win_close 函数关闭指定窗口。
int win_close ( LPCSTR window );
// win_get_info 函数检索指定属性的值
// 并将其存储在 out_value 中。
int win_get_info ( LPCSTR window, LPCSTR property, char *out_value );
// win_get_text 函数从指定窗口或
// 窗口区域读取文本。
5
阿祖总结-Zu.Stone@QQ.com
int win_get_text ( LPCSTR window, LPCSTR out_text );
// win_max 函数将指定窗口
// 最大化以充满整个屏幕。
int win_max (LPCSTR window );
// win_min 函数将指定窗口最小化为图标。
int win_min (LPCSTR window );
// win_mouse_click 函数在选中窗口
// 的指定坐标处执行鼠标单击操作。
int win_mouse_click (LPCSTR window, int x, int y, ButtonT button );
// win_mouse_dbl_click 函数在选中窗口
// 的指定坐标处执行鼠标双击操作。
int win_mouse_dbl_click (LPCSTR window, int x, int y, ButtonT button );
// win_mouse_drag 函数在窗口内执行
// 鼠标拖动操作。注意,指定的坐标是
// 相对于窗口(而非屏幕)的左上角。
int win_mouse_drag (LPCSTR window, int start_x, int start_y, int end_x, int end_y, ButtonT
button );
// win_move 函数将窗口移动到新的绝对位置。
int win_move ( LPCSTR window, int x, int y );
// win_resize 函数更改窗口的位置。
int win_resize ( LPCSTR window, int width, int height );
// win_restore 函数将窗口从图标化
// 或最大化状态还原为其原始大小。
int win_restore (LPCSTR window );
// win_wait_info 函数等待窗口
// 属性达到指定值,然后继续测试
// 运行。如果未达到指定值,则函数
// 将一直等到时间到期,然后再继
// 续测试。
int win_wait_info (LPCSTR window, LPCSTR property, LPCSTR value, UINT time );
// win_type 函数指定 keyboard_input
// 将发送到的目标窗口。
int win_type (LPCSTR window, LPCSTR keyboard_input );
6
阿祖总结-Zu.Stone@QQ.com
// ctrx__get_info 函数系列将属性
// 的值分配给值缓冲区。ctrx_obj_get_info
// 是一般函数,它可以适用于任何由录制器
// 所标识为对象的对象。
int ctrx_obj_get_info( const char * window_name, long xpos, long ypos, eObjAttribute attribute,
char *value, CTRX_LAST );
// ctrx__get_info 函数系列将属性的值
// 分配给值缓冲区。ctrx_button_get_info
// 获取命令按钮的信息。
int ctrx_button_get_info( const char * window_name, long xpos, long ypos, eObjAttribute
attribute, char *value, CTRX_LAST );
// ctrx__get_info 函数系列将属性的值
// 分配给值缓冲区。ctrx_edit_get_info
// 获取文本框的信息。
int ctrx_edit_get_info( const char * window_name, long xpos, long ypos, eObjAttribute attribute,
char *value, CTRX_LAST );
// ctrx__get_info 函数系列将属性的值
// 分配给值缓冲区。ctrx_list_get_info
// 获取列表框的信息。
int ctrx_list_get_info( const char * window_name, long xpos, long ypos, eObjAttribute attribute,
char *value, CTRX_LAST );
// ctrx_connect_server 将 Citrix 客户端连接到 Citrix 服务器。
int ctrx_connect_server (char * server_name, char * user_name, char * password, char * domain);
// ctrx_disconnect_server 断开客户端与 Citrix 服务器的连接。
int ctrx_disconnect_server (char * server_name);
// ctrx_nfuse_connect 使用 NFUSE 应用
// 程序门户建立与 Citrix 服务器的连接。在
// 定义 NFUSE 门户的个性化规范的 ICA 文件
// 中找到的规范将从服务器上下载,在此之后
// 建立连接。
int ctrx_nfuse_connect(char * url);
// 使用 ctrx_get_bitmap_value
// 检索位图的哈希字符串值以用于您
// 的自定义同步函数中。位图坐标由
// 前四个参数指定。
int ctrx_get_bitmap_value (long x_start, long y_start, long width, long height, char * buffer);
7
阿祖总结-Zu.Stone@QQ.com
// ctrx_get_text 将矩形中的文本分配到 text_buffer
// 中。随后,文本可被用于关联。
int ctrx_get_text( char *window_name, long xpos, long ypos, long width, long height, char *
filename, char * text_buffer, CTRX_LAST );
// ctrx_get_text_location 在 xpos、
// ypos、width 和 height 指定区域中
// 搜索指定文本。如果找到字符串,当函数
// 返回后,xpos 和 ypos 即为找到文本的
// 位置。如果未找到字符串,xpos 和 ypos
// 则为零。
int ctrx_get_text_location( LPCSTR window_name, long *xpos, long *ypos, long *width, long
*height, LPSTR text, long bMatchWholeWordOnly, LPCSTR filename, CTRX_LAST );
// ctrx_get_waiting_time 从运行时设置中获取当前等待
// 时间,或者通过 ctrx_set_waiting_time 设置的值。
int ctrx_get_waiting_time ( long * time );
// 使用 ctrx_get_window_name 检索
// 当前获得焦点的窗口的名称。
int ctrx_get_window_name (LPSTR buffer);
// 使用 ctrx_get_window_position
// 检索名为 title 变量值的窗口的位置。
// 如果 title 为 NULL,则函数将检索
// 当前拥有焦点的窗口的位置。
int ctrx_get_window_position (LPSTR title, long *xpos, long *ypos, long *width, long *height);
// ctrx_list_select_item 函数从列表中选择项目。
// 它支持 ListBox 或 ComboBox 类的列表。
int ctrx_list_select_item(char * window_name, long xpos, long ypos, char * item, CTRX_LAST );
// ctrx_menu_select_item 突出显示
// 菜单中的项目,但不激活它。
int ctrx_menu_select_item ( char * window_name, char * menu_path, CTRX_LAST) ;
// ctrx_mouse_click 等待窗口 window_name
// 出现,然后执行鼠标单击操作。
int ctrx_mouse_click (long x_pos, long y_pos, long mouse_button, long key_modifier, char *
window_name);
// ctrx_obj_mouse_click 等待窗口 window_name
// 出现,然后执行鼠标单击操作。
int ctrx_obj_mouse_click (const char * obj_desc, long x_pos, long y_pos, long mouse_button,
8