为大家提供测试基本方法,通信系统相关技术,测试人员职业规划等方面的收集,给大家提供一个交流学习的平台。

TSLonline Reference (A-J)

上一篇 / 下一篇  2007-06-01 10:17:28 / 个人分类:自动化测试

A

GRe)L(z\{)V0

 

Y&J+}Gta|1s0

 51Testing软件测试网9P7N-Iy2?*H

1.      ActiveBar_combo_select_item ( band_tool , item_name );选择下拉菜单某一项,

tDw|4b0

例如:51Testing软件测试网{H GgM

set_window("Form1", 1);

`Q/ln:x0

ActiveBar_combo_select_item("Format;Font", "Arial");

8R+F:J"I^X0

WinRunner选择Format:Font的第三项.

*l#znF B^U3h!@0

set_window("Form1", 1);

!L\'w)f`n0

ActiveBar_combo_select_item("Format;Font", "#3");51Testing软件测试网1Tm1F'z8`

 

5Y:F5Hi1IGw8f0

2.      ActiveBar_dump ( file_name );存储活动工具栏信息,包括标题、名称、ID等。51Testing软件测试网3fI_]3R4B Z

file_name参数包括路径,

A3[| F8N v#[ fh IA;~0

例如:51Testing软件测试网(PJ5x}(xKD/}\D0Pm

set_window("Form1", 1);

9no#zs$W f0

ActiveBar_dump ("d:\\Bar\\dump.txt");

%O-}Z8i1s,M0

 

Qbq8O*hr0

3.      ActiveBar_select_menu ( band_tool [, events_only ] ) ;选择菜单某一项,51Testing软件测试网mJ7d7K8mC

例如:51Testing软件测试网d A:X&uX

WinRunner选择菜单Edit上的Cut选项。51Testing软件测试网a2r)x"Od*Ah

set_window("Form1", 1);51Testing软件测试网A(rjf$sJ"e5C

ActiveBar_select_menu ("Edit;Cut"TRUE);51Testing软件测试网&j`f&V2V/J#YeMJ

 

S&ul5Ks0raRH0

4.      ActiveBar_select_tool (band_tool [, events_only ] ) ;选择工具栏里某一项,51Testing软件测试网UP!rh3]*|

例如:51Testing软件测试网l%u7}$p p;j Q

set_window("Form1", 1);

6k U A;PG0

ActiveBar_select_tool("Format; Center", TRUE);51Testing软件测试网0z(rog2X

 

S"Jm5V$D,J.u0

5.      ActiveX_activate_method ( object, ActiveX_method, return_value [,param4,……param8] );激活一个ActiveX方法;51Testing软件测试网mbj9l.b

例如:使用GetText方法,从一个快表中取数据;

+GN J}S'd&f5cE0

Column = "1";

)W*I`|p6zv0

Row = "1";51Testing软件测试网9loH*^i:t*t/H![

set_window("Form1", 1);

` |])uR n|@0

rc=ActiveX_activate_method("FPSpread.Spread.1","GetText",retval,Column,Row,Text);

m/yh$T J beb0

例如:使用GetCellPos方法得到cell的位置;51Testing软件测试网nBT(Tmm3V2I9p

#This code retrieves position of the cell in the third column and fourth row

/p5r(k(OAXe0

Column = "3";51Testing软件测试网B5E U~(\D

Row = "4";51Testing软件测试网7lN}1XOW F

set_window("Form1", 1);51Testing软件测试网:Q&c?E1tq&a

rc=ActiveX_activate_method("FPSpread.Spread.1","GetCellPos",retval,Column,Row,X,Y,Width,Height);

a5Zb/o Ved0

 51Testing软件测试网O9M~,de+i

6.      ActiveX_get_info (ObjectName, PropertyName, OutValue [ , IsWindow ] );

FS7|&Ae{0

ActiveX_get_info ( ObjectName, PropertyName ( X ) , OutValue [ , IsWindow ] );51Testing软件测试网8I*y8F*LqAf&o e1c

ActiveX_get_info ( ObjectName, PropertyName ( X , Y ) , OutValue [ , IsWindow ] );

5Kb#v6x9]"@(u0

返回ActiveXVB的属性值;

_&M)M4j0OM a"VC0

例如:在LoanSheetform中返回lblIntr(1).Caption的标题给label_caption51Testing软件测试网(U U__|{w

ActiveX_get_info("LoanSheet", "lblIntr(1).Caption", label_caption, TRUE);

Z7yo7}&ZFL7u0

if (label_caption != "Minimum %")51Testing软件测试网 RRn-fL"u @(y

             report_msg ("The caption is incorrect");51Testing软件测试网 t4cn+Q,l*V

 

$P7KWUSR$V I0

7.      ActiveX_set_info ( ObjectName, PropertyName , Value [ , Type [ , IsWindow ] ] );

c @T:a/iIq0

ActiveX_set_info ( ObjectName, PropertyName ( X ) , Value [ , Type [ , IsWindow ] ] );51Testing软件测试网PT{Lgze

ActiveX_set_info ( ObjectName, PropertyName ( X , Y ) , Value [ , Type [ , IsWindow ] ] );51Testing软件测试网*DuV/p$G+mn

设置ActiveXVB的属性值;

sv&oY@N0B0

例如:设置数组item(6)Vector控件给New Value.

7rv Wk-og0

ActiveX_set_info("Vector", "Item(6)", "NewValue");

$g4^ m9pJ~o#X2t0

 

f2j-m.G;J_G z0

8.      add_cust_record_class ( MSW_class, dll_name [ , rec_func [ , log_name_func ]);把用户录制的函数或者命名的函数与用户定义的GUI类联合起来,

Z#k7c:h)K0

例如:将录制的SpinRec函数、逻辑命名的vb_ln与用户GUISpinButton联合起来51Testing软件测试网'oM8Y?(W SQ5?8U

add_cust_record_class("SpinButton", M_Root&"\\arch\\vb_util.dll", "SpinRec ", "vb_ln");51Testing软件测试网R ^+t#U,l

 51Testing软件测试网wdOf:r[&`iu

9.      add_dlph_obj ( MSW_class, class, oblig_attr, optional_attr, default _check_prop, item );增加一个delphi对象;51Testing软件测试网FXs"A1z

10.  add_record_attr ( attr_name, dll_name, query_func_name, verify_func_name );注册一个用户属性

W/Wzr-z0

例如:注册用户属性vb_name,其中查询函数名是_ole_name_query

9Qi"Li/Y;w jdt0

add_record_attr("vb_name",m_root&"\\arch\\ole_ifs.dll","_ole_name_query","string_verify");

1nIvl \ qk W0

 

$J$v,oZ@e3DV0

11.  add_record_message ( message_number );windows消息列表中增加一条消息

)U/AQ&\7Y RHA`0

例如:WM_MOUSEMOVE

)S:LA%d*hi3M9v0

add_record_message ( 512 );51Testing软件测试网 c2s|nAq)]

 51Testing软件测试网]z&Q-czh d

12.  ascii ( string );返回字符串第一个字符的ascii

5Ee!qlAL0

例如:str=”mercury”; code=ascii(str);

l*]7ln0e!d0

#因为Mascii码是77所以code=77

^;]-sc8o+Pi3Io0

 51Testing软件测试网4UCC;h,t\/g

13.  atan2 ( y, x );返回y/x(正切)的弧度

eK3[3h qV0

 51Testing软件测试网q,x [(X]q[$X

 51Testing软件测试网(J`_WT&?x E l

 

_G0Sp%S,|0s+? o0

 51Testing软件测试网2^Iw"@&|

 

9hjd K6J7rl X T*c0

 

[la,pJ{|0

 51Testing软件测试网`/iKR s$\qcO'r


 51Testing软件测试网:L"_4V:R r1],M

B

.b)V7VpRT,G0

1.      button_check_info ( button, property, property_value );检查按钮属性的值

$L!{'J/F^9E[CXa}0

例如:打开Buger应用程序和OrderEntry box窗口,判断Sub按钮是不是enable,是则报“Error occurred”。51Testing软件测试网@\j }J+~6pc'R

# Call the Burger application.

$^y$|lp1IX0

call load_aut ("Burger",0);

\ [R"j3[6`0

set_window ("Burger", 1);51Testing软件测试网5m ve+t&}$i3w'f8]

# Open the Order-Entry box.51Testing软件测试网8L(F-x C6J.R

menu_select_item ("Order;Create order box...");

S&D*`s#U|%OIJ0

set_window ("Order-Entry Box");

;a5C~iW)~!M~q~0

# Check if the Sub button is disabled.51Testing软件测试网 N[Fh2Y B

if (button_check_info("Sub","enabled",0)!=E_OK)

9g1~s Q!o)G(] {xf[0

report_msg("Error occurred");51Testing软件测试网.v4hDc.@'Rb0Y

# Press the Add button.51Testing软件测试网A;|Gq d

button_press ("Add");

hP[2Yy l/[&\0

 51Testing软件测试网3jVK"VMG6A)w1~

2.      button_check_state ( button, state );检查单选框或复选框的状态

AB/|&Ec!XC]0

例如:51Testing软件测试网^7][(G1@h/H

if (button_check_state ("Ketchup",OFF) != E_OK|| button_check_state ("Medium", ON) != E_OK)

c-n1i/Rh"A0

report_msg ("Reset doesn't reset the check/radio buttons");

(ZZ/DO I ]1yO*Kj0

 

w b l {/E0

3.      button_get_info ( button, property, out_value );返回按钮属性的值

oRa!s6N+i `0

例如:返回Sub按钮的enable值给val51Testing软件测试网&@2Zq;^CP"X/l

if (button_get_info("Sub","enabled",val)!=E_OK)51Testing软件测试网F.N"^{Uf

      if (val!=0) report_msg("Sub button is enabled although it shouldn't be");

u,eb9Ze5k'`8Y0

 

1op7ufK0

4.      button_get_state ( button, out_state );返回单选框或复选框的状态51Testing软件测试网T0wC;grE'RU

5.      button_press ( button );点击按钮

2O}x,g#zN&m!Ia0

6.      button_set ( button, state );设置单选框或复选框的状态

1O8T7b2DQ^{9f0

7.      button_wait_info ( button, property, value, time );等待按钮的属性值变化

3e~Jq5z]0

例如:等待7秒使Sub按钮的enable属性为10

| e.c3|$x"Rx0

# Press Add button.

gm9R\rX~j0

button_press ("Add");51Testing软件测试网 xANWelU

button_wait_info("Sub","enabled",1,7);#enable51Testing软件测试网T\}R Q T.VS

# Press the Sub button.

,Gx'k*m/L0

button_press("Sub");51Testing软件测试网/YuFDG%s\{?&d]

button_wait_info("Sub","enabled",0,7);

4X9BF8}a;Y0

# Check the Value displayed in the Drink Quantity field.51Testing软件测试网S,Y4IWa

static_get_info("Drink Quantity","value",val);

W]6Y5SZS0

if (val!=0)51Testing软件测试网Rd7J!J%X"FEA#_

      report_msg("Problems with buttons functionality");51Testing软件测试网7Nw'z3|8W)jc

else

?YN _&[N J e2t&r0

      report_msg("Buttons static is OK");51Testing软件测试网P yX,z4a&b

 

"pFG;G-z0

 

y'D @b#f*DC0X0

 

2o%SN%YbTZ0

 

6Y(bM,U2Na5Um:B4f1}0

 51Testing软件测试网O4k[ ^IDJp

 

F'H0|8R%GG I#x0

 

!I:l$D[nND E0

 51Testing软件测试网*|+j2ez,gBzn6L }3[

 

su4zU)i'j O,h0

 

!j!e)@s"_E.~ Jo0

 

!K GkVHQ0

C

+s Z*e2iXo'{0

1.      calendar_activate_date ( calendar, date );双击日历某个日期51Testing软件测试网(j.\;? |F8{1I$VZ2hb8{

例如calendar_activate_date ("CSCAL.CSCalCtrl.1", "17/7/1997");

1fr+l/](BO*B7E`0

 51Testing软件测试网DdJw;[w9c

2.      calendar_get_selected ( calendar, selected_dates, selected_dates_count [ ,selected_time] );恢复及计算所选择的日期51Testing软件测试网v-e [.KOP0_n c

例如:calendar_get_selected ("CSCAL.CSCalCtrl.1",dates, count);51Testing软件测试网 w0qVY*O2W7jMn

 51Testing软件测试网$|8e(p0h(Gy9`4\"X?$Hm

3.      calendar_get_status ( calendar, selection_status );恢复日历状态51Testing软件测试网%h5B-c$^"z A

例如:if (status == 1)  calendar_select_date ("Date_Time" , "4-Dec-1998");

dk+_"["\ie Lt0

 

2| G/t~vB0

4.      calendar_get_valid_range(calendar,in_range_type,allowed_min_time,allowed_max_time);恢复日历的有效范围。51Testing软件测试网&V)Ud\1S Gj

例如:print ( "The range of dates in this calendar are" & calendar_get_valid_range ("MonthCalendar", 1));

qqJzP6T0

TAG: 自动化测试

 

评分:0

我来说两句

日历

« 2024-04-17  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 15918
  • 日志数: 23
  • 文件数: 2
  • 书签数: 8
  • 建立时间: 2007-05-30
  • 更新时间: 2009-05-15

RSS订阅

Open Toolbar