where there is a will,there is a way!

GetROProperty,GetTOProperties,GetTOProperty的区别

上一篇 / 下一篇  2008-06-12 15:29:36 / 个人分类:QTP

:fE&~ynN{:{0K0转自:http://bbs.51testing.com/thread-13554-1-1.html51Testing软件测试网7NFw'c"o'Ar\

2N`4? ?8a5rq:F0someone5:

:v1V/BdBztM_051Testing软件测试网:R5o"k,\6iZ,QF6efh

GetToProperty:Returns the value of the specified property from the test object descrīption.
9a k-a5|'Q j0GetTOProperties:Returns the collection of properties and values used to identify the object.51Testing软件测试网:dq)Cf9oK@F]
GetROProperty:Returns the current value of the test object property from the object in the application.
k,o9{ Bj0举个例子:51Testing软件测试网"S"C)x~*X:}6cK
假设在库中有一个对象"窗口A",用于识别该对象的属性有2个,
| H+{-CZ8kqPki(S0一个属性是"text",在库中记录的值是"QQQQ".
.}5afL h#gb:XH{0另一个属性是"name",记录的值是"MM"51Testing软件测试网T(n'Xzp9_)?f.d`
在实际运行脚本时属性"text"的值是"PPPP"而不是"QQQQ"
Z0Bw| mm$?0那么:51Testing软件测试网j,i:d;x1]q#z
Window("窗口A").GetToProperty("text")返回的是:"QQQQ"51Testing软件测试网"SzO0t zE+U |M
Window("窗口A").GetRoProperty("text")返回的是:"PPPP"
Lx5vn9u0Window("窗口A").GetToProperties("text")返回的是用于识别"窗口A"的两个属性和值的集合51Testing软件测试网*]I+f.H7j-]

h/Q'^%V3wT0
xalee:关键在于RO和TO,R,就是Runtime,T就是Testtime,O就是Object。因此顾名思义,RO就是在测试执行时的对象,TO就是录制/编写测试时的对象。是同一个类在不同的时间生成的不同的实例,一般来说TO是静态的,而RO是动态的(每次执行测试都会生成新的实例)。

TAG: QTP

 

评分:0

我来说两句

Open Toolbar