1.GetTOProperty()
● 基本含义:获取对象库中某个对象的某个属性的值。
● 公式:ReturnValue =对象.GetTOProperty("封装属性名")
● 基础示例:
ValueOfTo=Browser("百度一下,你就知道").Page("百度一下,你就知道").Link("新 闻").GetTOProperty("text")
msgbox ValueOfTo
2.GetTOProperties()
● 基本含义:获取对象库中某个对象的所有属性的值。
● 公式:ReturnValue =对象.GetTOProperties()。
● 基础示例:
set properties = Browser("百度一下,你就知道").Page("百度一下,你就知道").Image("logo").GetTOProperties
propertiesCount=properties.count
msgbox propertiesCount
For i = 0 To propertiesCount-1 Step 1
proname=properties(i).name
provalue=properties(i).value
print proname&"="&provalue
Next
3.SetTOProperty()
● 基本含义:设置对象库中某个对象的某个属性的值。
● 公式:对象.SetTOProperty“封装属性名”,“封装属性值”。
● 基础示例:
Browser("百度一下,你就知道").Page("百度一下,你就知道").WebButton("百度一下").SetTOProperty "name","百度一百万下"
MsgBox "时间停止,大家一起欣赏此时对象库中WebButton"百度一下"的name值!"
4.GetROProperty()
● 基本含义:获取实际在运行时的某个对象的某个属性的值(不是从对象库里面获取)。
● 公式:ReturnValue =对象.GetROProperty("封装属性名")。
● 基础示例:
Browser("百度一下,你就知道").Page("百度一下,你就知道").WebEdit("搜索关键字").Set "QTP"
value=Browser("百度一下,你就知道").Page("百度一下,你就知道").WebEdit("搜索关键字").GetROProperty("value")
msgbox value
TO&RO
最新推荐文章于 2021-05-25 22:57:53 发布