getTOProperties是获取属性数量,例如一个对象,在对象库中已添加的属性有name, type, class三种,则该对象返回值为3。
请看如下例子(测试前请将Google首页加入对象库)
Set oWebEdit=Browser("Google").page("Google").webedit("q") '首先设置对象
Set TOProps=oWebEdit.getTOProperties() '把这个对象的所有属性设置到TOProps之中。
Dim i, iCount
iCount=TOProps.Count-1 '获取属性数量
For i=0 to Icount
Sname=TOProps(i).Name
sValue=TOProps(i).Value
isRegularexpression=ToProps(i).Regularexpression '判断该属性是否被正则
Msgbox sName& "->" & sValue & "->" & isRegularexpression '输出属性值
Next
评论