一个人不应该依附在其他人身上,一个人应该首先自力更生。你应该自己能够独立,能够安顿你自己,那你就不会害怕了。你爱你自己的话,别人不能不爱你吧。

tsl脚本命令(转贴)一

上一篇 / 下一篇  2007-07-21 11:08:16 / 个人分类:WR

tsl脚本命令(转贴)一51Testing软件测试网'e2P?*E,x0U f]!v
51Testing软件测试网(FqQX X*WT"OV
Winrunner Context Sensitive命令列表51Testing软件测试网0C0\ nm/dHx k s
51Testing软件测试网!x v2[ G2f];Nw7n0w

9l_+T x-T#D:I051Testing软件测试网8b ibzYN4Srp%@1W
51Testing软件测试网8y!^(TNX'D mSIm
1.ActiveBar_combo_select_item ( band_tool , item_name );选择下拉菜单某一项,例如:51Testing软件测试网&I k6z,L*Z2I;tRs

Lg7a:ul(K'iu0
5Id6p0t2z3@;n0set_window("Form1", 1);51Testing软件测试网 p_zZ2~;Omz
51Testing软件测试网D&G C#QBAc%O#I
51Testing软件测试网fWuHu7D0^"L
ActiveBar_combo_select_item("Format;Font", "Arial");
n8c&mtS!p2\051Testing软件测试网*Oh4l8rE:g0qjU#r

W1rj lNC6v0In the following example, WinRunner selects the third item in the Format:Font tool.51Testing软件测试网7{,qS6@}/}eO

d}R@w6tt0
4FJ6^o9R2YS7O0set_window("Form1", 1);
`Z_.cG$@0
At.fX$YacAL w051Testing软件测试网jQ,IO4qR j
ActiveBar_combo_select_item("Format;Font", "#3");
uE ha`0
`[5y%Uo0
#c M4GuWuYXo02.ActiveBar_dump ( file_name );存储活动工具栏信息,包括标题、名称、ID等。51Testing软件测试网-o,YY0Xn!}9B^ s4[

U4t `:q.HW0file_name            参数包括路径,例如:
(Pp)jEY\z#J051Testing软件测试网(u8M/X'\Q^
set_window("Form1", 1);51Testing软件测试网 Y I8SL"zJ'Q
51Testing软件测试网,N\N/a6djB |
ActiveBar_dump ("d:Bardump.txt");51Testing软件测试网D/F w \it
51Testing软件测试网O HU2KdK\
3、ActiveBar_select_menu ( band_tool [, events_only ] ) ;选择菜单某一项,例如:
/A!{ i_vGu:tQ3J2W4i0
fIYhe&`)[0in the following example, WinRunner selects the Cut menu item in the Edit toolbar.
I0Ae,mDk051Testing软件测试网Iw#_ tG$G~6h$`
set_window("Form1", 1);
,p3m+|^ HTR0
D4iT%VT&\cJ0ActiveBar_select_menu ("Edit;Cut",TRUE);51Testing软件测试网(T0ud\0` G

F9f` l;nT;tAyc04、ActiveBar_select_tool (band_tool [, events_only ] ) ;选择工具栏里某一项,例如:51Testing软件测试网VFgl t4n

}t~g:l0set_window("Form1", 1);
z_h hnX6h3Q051Testing软件测试网)[$e"SsA L9M0R r
ActiveBar_select_tool("Format;Center", TRUE);51Testing软件测试网fb1|il o `?@

m~N#xlD `05、win_check_bitmap ( window, bitmap, time [, x, y, width, height ] );比较窗口位图,
0n(P1D L4n ^ B v$F051Testing软件测试网wy/N0R Ry6Yf
6、obj_check_bitmap ( object, bitmap, time [, x, y, width, height] );比较对象位图,
q#tc hHOv0
[[oN$x07、button_check_info ( button, property, property_value );检查按钮属性的值51Testing软件测试网qbtl t}I

N,V+nn3HpDxD08、button_check_state ( button, state );检查单选框或复选框的状态51Testing软件测试网 J h&[ n'xn

)Im&|2t7{'q09、button_get_info ( button, property, out_value );返回按钮属性的值51Testing软件测试网9xi4Vb^Y&u3h?
51Testing软件测试网%q)T0?{/~;d%{$\ MvsU
10、button_get_state ( button, out_state );返回单选框或复选框的状态51Testing软件测试网"tV;`M] m
51Testing软件测试网 i*z {"K(DFw
11、button_press ( button );点击按钮51Testing软件测试网 t {Zg UL6G7Ny
51Testing软件测试网s,]{o5Z4B
12、button_set ( button, state );设置单选框或复选框的状态
0p5X}]V$z051Testing软件测试网,tIt6}%oQs*z} {"i
13、button_wait_info ( button, property, value, time );等待按钮的属性值变化51Testing软件测试网$L T"W3o1hj$_9W y9f
51Testing软件测试网S Ex{"L FE
14、calendar_activate_date ( calendar, date );双击日历某个日期51Testing软件测试网M*s*CfW{ Db I
51Testing软件测试网{-Nt\-l-u4[E%f
15、db_check ( checklist, expected_results_file [ , max_rows [ , parameter_array ] ] );比较当前数据库数据和期待的数据库数据
B8p\fe Hywvs0
R;Oz9O!e016、db_connect ( session_name, connection_string );建立一个数据库session并建立odbc连接51Testing软件测试网9PY E F6T:B^D5\P:w

f(t`3o(v%VF;f017、db_disconnect ( session_name );断开连接结束session51Testing软件测试网+dN]9sV M)V,l
51Testing软件测试网A P9H!En3G {;i
18、db_execute_query ( session_name, SQL, record_number );执行sql语句返回记录集51Testing软件测试网,`BM7i{\"F2a
51Testing软件测试网E6? Y/m/hh%Hw3Mhp
19、db_get_field_value ( session_name, row_index, column );返回数据库特定区域的值
d/TcM vjoA w051Testing软件测试网%T$L!~x5g x5e
20、db_get_headers ( session_name, header_count, header_content );返回数据库session的列的数量及列的内容并以tab分组51Testing软件测试网J z;VB.k2b;a_+N"W@l

Bi1K|8X5Ke021、db_get_last_error ( session_name, error );返回最后一条数据库session错误信息
9mD+Q*pX2q051Testing软件测试网bv O#\q5y:N g
22、db_get_row ( session_name, row_index, row_content );返回特定行内容
7]7K${ X qx$c#J$_0
%E-B`/lb5B023、db_record_check ( ChecklistFileName , SuccessConditions, RecordNumber ); Compares information that appears in the application under test during a test run with the current values in the corresponding record(s) in your database.51Testing软件测试网n `-A+^3HU/x G c
51Testing软件测试网C!_Ey#e1xTq
24、db_write_records ( session_name, output_file [ , headers [ , record_limit ] ] );把结果记录集写到一个文本文件
5`XE2j ~ K5QJ051Testing软件测试网7g.Q%B,r7T$[)g+hCC
25、ddt_close ( data_table_name );关闭数据表文件51Testing软件测试网#yJN4] ]_DF

Z\ K(CG:^RxE026、ddt_close_all_tables();关闭全部数据表51Testing软件测试网;^;a{ h;U

}!@]rt y027、ddt_export ( data_table_namename1, data_table_namename2 );把一个数据表信息导到另一个数据表文件
9[G d(}1q$]'{051Testing软件测试网 fQO)r$C
28、ddt_get_current_row ( data_table_name, out_row );返回数据表当前所在行
,W(F,Bu:QN C$Z+Ue#X0
6X*`6|v2V7d029、ddt_get_parameters ( table, params_list, params_num );返回数据表的参数和参数的个数
%N!LD3u ]051Testing软件测试网+C%L|T^/T+A!X
30、ddt_get_row_count ( data_table_name, out_rows_count );返回数据表行数
:K^$gc6Z0
;v[3~{aFAb031、ddt_is_parameter ( data_table_name, parameter );返回一个参数是否在数据表里有效
}S1I)R3{wSj'h0
;j9c)zwX Q!p?J aD032、ddt_next_row ( data_table_name );指向数据表中到当前行的下一行51Testing软件测试网P m%PU L6W/o[!M4J

]7| yQX$C_033、ddt_open ( data_table_name [ , mode ] );打开或创建一个可以访问的数据表51Testing软件测试网/w#t\ t k!}t9VL4[

j(wF p])ECP034、ddt_report_row ( data_table_name );报告当前行到测试结果
gct:N,S)Zel"qWi0
W;y:Vl-u-qt035、ddt_save ( data_table_name );保存数据表信息51Testing软件测试网^c5PI4W

E~O] [J036、ddt_set_row ( data_table_name, row );设置当前行为第几行
$Chk[U1[0
6w\e&[Z7oJ ye037、ddt_set_val ( data_table_name, parameter, value );插入parameter列一个新值value51Testing软件测试网$Y%Q a D&ba;q6c$j|

E7hPQ&T,V%i038、ddt_set_val_by_row ( data_table_name, row, parameter, value  );插入特定行的parameter列一个新值value
k/p/H,I!iB0
Q5{*Kd!Zw(Sy039、ddt_show ( data_table_name [ , show_flag ] );显示或隐藏数据表,1是显示,0是隐藏
gD&dL%`7oo6@p+p051Testing软件测试网q.{ a-mhc+D
40、ddt_sort ( table_file, row1, col1, row2, col2, sort_by_rows, key1 [ , key2, key3 ]  );根据关键字将数据表特定区域的值排序,sort_by_rows            参数1是按行,0是按列
?{2\"^'LZ%G$J2^ N#N051Testing软件测试网?{[z*[8LW5p
41、ddt_update_from_db ( data_table_name, file, out_row_count [ , max_rows ] );从数据库往数据表里导数据;51Testing软件测试网&p0L%u {e:\$GM c0W

\cI.d4qs042、ddt_val ( data_table_name, parameter );返回数据表当前行的参数的值
+`ld |1E$C0
)hW(L4Z;l043、ddt_val_by_row ( data_table_name, row_number, parameter );返回数据表特定行的参数的值51Testing软件测试网!m/_)ZO3^kqkN h jN

/c'W#lRTY b6qnh044、date_age_string ( date, years, month, days, new_date );将日期相应改变返回新值
d(m~:P"vx0
P1Ul)hc045、date_align_day ( align_mode, day_in_week );指定特定的日期给某天
,d4cp&T/o.c!I051Testing软件测试网;Nm G } }%I@(n
46、date_calc_days_in_field ( field_name1, field_name2 );计算两个日期间的天数
D tcZf1~Q0
4s8s{|9Yxhy[1en7k047、date_calc_days_in_string ( string1, string2 );计算字符串格式的日期间的天数51Testing软件测试网B,X#z-rz,|}p)G/p
51Testing软件测试网 C.i'c"^b(hgA
48、edit_check_info ( edit, property, property_value );检查对象属性的值
XK)na/e} B051Testing软件测试网&kj4]kH-T\|C
49、edit_check_selection ( edit, selected_string );检查选择的字符串是否存在51Testing软件测试网6Q&A(av{,mO

U;pFNw$K5HU050、edit_check_text (edit, text, case_sensitive );检查编辑对象的文本内容51Testing软件测试网w7H-g2Uc DO)U/W7}
51Testing软件测试网.z+_#T d@ G%@
51、edit_delete ( edit, start_column, end_column );删除编辑对象的文本内容
aU)si/b!o6N0
^-h b+xs(W-dz*vs052、edit_delete_block ( edit, start_row, start_column, end_row, end_column );删除文本区51Testing软件测试网+Tq8O\i&u1w5E+A

*W\&lH~$R053、edit_get_block ( edit, start_row, start_column, end_row, end_column, out_string );返回文本区51Testing软件测试网n8l:?A8udK*A'[
51Testing软件测试网t7SM+fq Aq-\ dK2Xzq
54、edit_get_info ( edit, property, out_value );返回编辑对象的属性值51Testing软件测试网5l d&ZJ+_%s

(I5Hf,y0{%VC/X055、edit_get_row_length ( edit, row, out_length );返回编辑对象里行的长度51Testing软件测试网*^S7d.SV){&n(b8@
51Testing软件测试网l^&?.X{0B;],^ K*P'Ls
56、edit_get_rows_count ( edit, out_number );返回编辑对象里行数51Testing软件测试网8s5}e"\~V6Q

[ W8@ Xf4[{-d057、edit_get_selection ( edit, out_string );返回编辑对象的选定字符串51Testing软件测试网D:t'B;c5nd
51Testing软件测试网 D@rmaf(`
58、edit_get_selection_pos ( edit, out_start_row, out_start_column, out_end_row, out_end_column );返回选定区域的开始和结束位置
BQs;gL0cB8Q0
_4KN{&{059、edit_get_text ( edit, out_string );返回编辑对象的文本51Testing软件测试网jD$F.`!o O9g
51Testing软件测试网MPl`2{;?OW
60、edit_insert ( edit, text, columnI );在编辑对象第一行插入文本
T%?4DJk,JO(f)m2X0
3s5Z2AS&C b@7Ng061、edit_insert_block ( edit, text, row, column );在一个多行编辑对象插入文本51Testing软件测试网-ZF9|Pan_;_u

{V#q.v u8q2ISq iQ062、edit_replace ( edit, text, start_column, end_column );替换一个编辑对象的内容51Testing软件测试网0u p;?.i(Y${ W$l#JW
51Testing软件测试网&J3U?Cz's3z*B&Wr
63、edit_replace_block ( edit, text, start_row, start_column, end_row, end_column );替换一个编辑对象的多行内容51Testing软件测试网T6eg m%Z
51Testing软件测试网:O@%t(E}[2J K(X1ND`m
64、edit_set ( edit, text );替换编辑对象的全部内容
4f/_2Y(\NO0
yY1Bn ~XS'A065、edit_set_insert_pos ( edit, row, column );把鼠标指针放到编辑对象特定位置51Testing软件测试网 f*Rw6_ Z
51Testing软件测试网9k#~*LuT{zx
66、edit_set_selection ( edit, start_row, start_column, end_row, end_column );选择编辑对象的文本
2{ kza?.g ?051Testing软件测试网)Vnxx&i K~x7f
67、edit_type ( edit, text );在编辑对象敲入字符串51Testing软件测试网;^*\|.G gB
51Testing软件测试网&Gd&Oq7pG
68、edit_wait_info ( edit, property, value, time );等待编辑对象属性的值
U$[&c.xU6SV0z0
)Er-vx,h \\ P,p069、obj_check_gui ( object, checklist, expected_results_file, time );比较当前的gui对象数据51Testing软件测试网9[ r ^`/ON V4Z

2@'Z&Xz1l-}#z?_r070、win_check_gui ( window, checklist, expected_results_file, time );对一个窗口比较当前的gui对象数据51Testing软件测试网 TH%qzd
51Testing软件测试网s*^mU;F+Aa.P
71、get_class_map ( custom_class, out_standard_class );返回和一个自定义的类相关的标准类
2d#C#G!N;`ii:C8X0
^y xu ~3{0y-ohL072、get_record_attr ( class, out_obligatory, out_optional, out_selector );从一个对象类返回属性
U0YG%^r Y}c`$_051Testing软件测试网b7ii.B]~ pE-O-U
73、get_record_method ( class, out_method );返回一个对象类的方法51Testing软件测试网%N3zNs!i [/X}
51Testing软件测试网;o T1W JyTP
74、set_class_map ( custom_class, standard_class );关联一个自定义类和一个标准类
Zc5IO"ln,?^k051Testing软件测试网o W|h/}je:[)N
75、set_record_attr ( class, oblig_prop, optional_prop, selector );设置一个对象类的属性
v(jZI W2`l4o G.]051Testing软件测试网BD%Y2eb(W M
76、set_record_method ( class, method );设置对一个类的记录方法51Testing软件测试网9NbTF d4y&q
51Testing软件测试网#EFqzXY:w
77、unset_class_map ( custom_class );解开一个自定义类和标准类的关联关系
v2yi(U ? o(h0
r(l S0?q o078、GUI_add ( file path, window, object, physical_desc );往gui map文件里加一个对象51Testing软件测试网pjEc L!kx w'b.h

)X ^ p~(^2d&[079、GUI_buf_get_desc ( file, window, object, out_desc );返回guimap文件里对象的物理描述
p4A#B*B)[$Uf051Testing软件测试网Vu)[S7ZGJc
80、GUI_buf_get_desc_attr ( file, window, object, property, out_prop_value ); 返回guimap文件里对象的属性的值51Testing软件测试网{D6| zxI:z
51Testing软件测试网{#o"}5lP-_}Z[#M
81、GUI_buf_get_logical_name ( file, physical_desc, window, out_name ); 返回guimap文件里对象的逻辑名称51Testing软件测试网V+_ T8A3xp/@_k
51Testing软件测试网C?(h@}^bd
82、GUI_buf_new ( file );创建新的gui对象文件51Testing软件测试网0j {U+L:H|

E!_m Iw;K2c083、GUI_buf_set_desc_attr ( file, window, object, property, value );设置guimap文件里对象的属性的值
%hS#R/m N"k%s.p051Testing软件测试网+X+v"iIzc5?
84、GUI_close ( file );关闭guimap文件51Testing软件测试网H"k-J`&inJW#^

:is9}t*Q"xW085、GUI_close_all ();关闭全部guimap文件
.Ja@Yt dx/Q0
o)AR,f-`Z*h:f086、GUI_delete ( file, window, obj  );从guimap文件里删除一个对象51Testing软件测试网)X HD?]a k0t

#K2g7`:b.yg_9~087、GUI_desc_compare ( desc_1, desc_2 );比较两个物理描述51Testing软件测试网4oi3fQ x7n'{T

} Z0_`EC#V088、GUI_desc_get_attr ( physical_desc, property, out_attr_value );从物理描述得到属性的值
M1OAu2QXn051Testing软件测试网U,epxmj+T#g
89、GUI_desc_set_attr ( physical_desc, property, value );设置属性的值51Testing软件测试网)y)Q|)OVz5}4G-@

'?u soA090、GUI_get_name ( out_name, out_version );返回测试程序下gui对象的类型51Testing软件测试网x4V] M;i&[K

!Dl9Us a091、GUI_get_window ( );在guimap里返回当前窗口51Testing软件测试网.E1]`$^2xCE4H#W,[i

3m.G b#F"\L5d092、GUI_list_buf_windows ( file, out_windows, out_number );列举出guimap文件里所有的窗口51Testing软件测试网7E;dT qw$L/t

y4B4xu6w)R8` G093、GUI_list_buffers ( out_files, out_number );列举所有打开的guimap文件
*D$b*y m7h051Testing软件测试网e`0N,sH9aIpQ
94、GUI_list_desc_attrs ( physical_desc, out_array );列举一个gui对象的属性值51Testing软件测试网 FuIn,T:y

Y r/r1Fu b!L5W095、GUI_list_map_buffers ( out_file, out_number );列举所有载入的guimap文件
uf SN9b w D$o`8@051Testing软件测试网/DWn$B H;E5~n
96、GUI_list_win_objects ( file, window, out_objects, out_number );列举一个窗口的全部对象51Testing软件测试网(ze8}n.nS

PFR@ Q uHS097、GUI_load ( file_name );载入一个guimap文件51Testing软件测试网W8SZS&l Q
51Testing软件测试网 p"Uc J[2M8f
98、GUI_map_get_desc ( window, object, out_desc, out_file );返回guimap里对象的物理描述
l G,J6xqS?7Yr7v0
5V:aMKZn%b?xb099、GUI_map_get_logical_name ( physical_desc, window, out_obj, out_file );返回guimap里对象的逻辑名称
6j~bZj051Testing软件测试网1bh$c$|#Bt@6?
100、GUI_open ( file_name );打开guimap文件
 

TAG: WR

 

评分:0

我来说两句

Open Toolbar