没有合适的资源?快使用搜索试试~ 我知道了~
WinRunner脚本语言——TSLonline
4星 · 超过85%的资源 需积分: 5 36 下载量 148 浏览量
2010-03-18
11:57:43
上传
评论 2
收藏 388KB DOC 举报
温馨提示
试读
31页
学习WinRunner必备的脚本语言锦囊
资源推荐
资源详情
资源评论
编者:hihihaha910
目 录
A、......................................................................................................................................................3
B、......................................................................................................................................................5
C、......................................................................................................................................................7
D、...................................................................................................................................................10
E、....................................................................................................................................................13
F、....................................................................................................................................................15
G、...................................................................................................................................................16
I、.....................................................................................................................................................18
J、.....................................................................................................................................................18
L、....................................................................................................................................................18
M、...................................................................................................................................................19
N、...................................................................................................................................................20
O、...................................................................................................................................................20
P、....................................................................................................................................................22
Q、...................................................................................................................................................22
R、....................................................................................................................................................22
S、....................................................................................................................................................23
T、....................................................................................................................................................25
U、...................................................................................................................................................29
V、...................................................................................................................................................29
W、...................................................................................................................................................29
TSL Online Reference (By hihihaha910)
A、
1. ActiveBar_combo_select_item ( band_tool , item_name );选择下拉菜单某一项,
例如:
set_window("Form1", 1);
ActiveBar_combo_select_item("Format;Font", "Arial");
WinRunner 选择 Format:Font 的第三项.
set_window("Form1", 1);
ActiveBar_combo_select_item("Format;Font", "#3");
2. ActiveBar_dump ( file_name );存储活动工具栏信息,包括标题、名称、ID 等。
file_name 参数包括路径,
例如:
set_window("Form1", 1);
ActiveBar_dump ("d:\\Bar\\dump.txt");
3. ActiveBar_select_menu ( band_tool [, events_only ] ) ;选择菜单某一项,
例如:
WinRunner 选择菜单 Edit 上的 Cut 选项。
set_window("Form1", 1);
ActiveBar_select_menu ("Edit;Cut",TRUE);
4. ActiveBar_select_tool (band_tool [, events_only ] ) ;选择工具栏里某一项,
例如:
set_window("Form1", 1);
ActiveBar_select_tool("Format; Center", TRUE);
5. ActiveX_activate_method ( object, ActiveX_method, return_value [,param4,……param8] );
激活一个 ActiveX 方法;
例如: 使用 GetText 方法,从一个快表中取数据;
Column = "1";
Row = "1";
set_window("Form1", 1);
rc=ActiveX_activate_method("FPSpread.Spread.1","GetText",retval,Column,Row,Text);
例如:使用 GetCellPos 方法得到 cell 的位置;
#This code retrieves position of the cell in the third column and fourth row
Column = "3";
Row = "4";
set_window("Form1", 1);
rc=ActiveX_activate_method("FPSpread.Spread.1","GetCellPos",retval,Column,Row,X,Y,Width,
Height);
6. ActiveX_get_info (ObjectName, PropertyName, OutValue [ , IsWindow ] );
ActiveX_get_info ( ObjectName, PropertyName ( X ) , OutValue [ , IsWindow ] );
ActiveX_get_info ( ObjectName, PropertyName ( X , Y ) , OutValue [ , IsWindow ] );
返回 ActiveX、VB 的属性值;
例如:在 LoanSheet 的 form 中返回 lblIntr(1).Caption 的标题给 label_caption;
ActiveX_get_info("LoanSheet", "lblIntr(1).Caption", label_caption, TRUE);
if (label_caption != "Minimum %")
report_msg ("The caption is incorrect");
7. ActiveX_set_info ( ObjectName, PropertyName , Value [ , Type [ , IsWindow ] ] );
3/31
TSL Online Reference (By hihihaha910)
ActiveX_set_info ( ObjectName, PropertyName ( X ) , Value [ , Type [ , IsWindow ] ] );
ActiveX_set_info ( ObjectName, PropertyName ( X , Y ) , Value [ , Type [ , IsWindow ] ] );
设置 ActiveX、VB 的属性值;
例如:设置数组 item(6)的 Vector 控件给 New Value.
ActiveX_set_info("Vector", "Item(6)", "NewValue");
8. add_cust_record_class ( MSW_class, dll_name [ , rec_func [ , log_name_func ]);把用户录制
的函数或者命名的函数与用户定义的 GUI 类联合起来,
例如:将录制的 SpinRec 函数、逻辑命名的 vb_ln 与用户 GUI 的 SpinButton 联合起来
add_cust_record_class("SpinButton", M_Root&"\\arch\\vb_util.dll", "SpinRec ", "vb_ln");
9. add_dlph_obj ( MSW_class, class, oblig_attr, optional_attr, default _check_prop, item ); 增加
一个 delphi 对象;
10. add_record_attr ( attr_name, dll_name, query_func_name, verify_func_name );注册一个用户
属性
例如:注册用户属性 vb_name,其中查询函数名是_ole_name_query。
add_record_attr("vb_name",m_root&"\\arch\\ole_ifs.dll","_ole_name_query","string_verify");
11. add_record_message ( message_number );在 windows 消息列表中增加一条消息
例如:WM_MOUSEMOVE
add_record_message ( 512 );
12. ascii ( string );返回字符串第一个字符的 ascii 码
例如:str=”mercury”; code=ascii(str);
#因为 M 的 ascii 码是 77 所以 code=77;
13. atan2 ( y, x );返回 y/x(正切)的弧度
4/31
TSL Online Reference (By hihihaha910)
B、
1. button_check_info ( button, property, property_value );检查按钮属性的值
例如:打开 Buger 应用程序和 Order-Entry box 窗口,判断 Sub 按钮是不是 enable,是则报
“Error occurred”。
# Call the Burger application.
call load_aut ("Burger",0);
set_window ("Burger", 1);
# Open the Order-Entry box.
menu_select_item ("Order;Create order box...");
set_window ("Order-Entry Box");
# Check if the Sub button is disabled.
if (button_check_info("Sub","enabled",0)!=E_OK)
report_msg("Error occurred");
# Press the Add button.
button_press ("Add");
2. button_check_state ( button, state );检查单选框或复选框的状态
例如:
if (button_check_state ("Ketchup",OFF) != E_OK|| button_check_state ("Medium", ON) !=
E_OK)
report_msg ("Reset doesn't reset the check/radio buttons");
3. button_get_info ( button, property, out_value );返回按钮属性的值
例如:返回 Sub 按钮的 enable 值给 val;
if (button_get_info("Sub","enabled",val)!=E_OK)
if (val!=0) report_msg("Sub button is enabled although it shouldn't be");
4. button_get_state ( button, out_state );返回单选框或复选框的状态
5. button_press ( button );点击按钮
6. button_set ( button, state );设置单选框或复选框的状态
7. button_wait_info ( button, property, value, time );等待按钮的属性值变化
例如:等待 7 秒使 Sub 按钮的 enable 属性为 1 或 0
# Press Add button.
button_press ("Add");
button_wait_info("Sub","enabled",1,7);#enable
# Press the Sub button.
button_press("Sub");
button_wait_info("Sub","enabled",0,7);
# Check the Value displayed in the Drink Quantity field.
static_get_info("Drink Quantity","value",val);
if (val!=0)
report_msg("Problems with buttons functionality");
else
report_msg("Buttons static is OK");
5/31
剩余30页未读,继续阅读
资源评论
- 开心的蛋蛋哥2012-06-25看不太懂,有更多说明就好了
- 异常异长2014-08-08很少的资源啊。
- richman20002014-10-06比较不好找的资源呀
fangfang052
- 粉丝: 4
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功