这里有成长的点滴记录,经验的逐步积累,等待最后的美丽绽放。
QTP中的CheckProperty()方法
上一篇 /
下一篇 2014-08-11 18:37:39
/ 个人分类:QTP
描述:
用于检查真实对象的属性与期望的属性是否一致。
语法:
object.CheckProperty (PropertyName,
PropertyValue, [TimeOut])
对象.checkPorperty(属性名,属性值,[超时])
示例:
Sub
CheckProperty_Example() Browser("Nested Lists").Page("Page").WebEdit("Name").Set "Mercury" Browser("Nested Lists").Page("Page").WebEdit("Name").CheckProperty "value",
"Mercury"
End Sub
Sub
CheckProperty_Example() Browser("Fill-Out Form.
Example").Page("Fill-Out Form.
Example").WebList("what-to-do").CheckProperty
"items count", 15, TimeLimitation Item_Count =
Browser("Fill-Out Form. Example").Page("Fill-Out Form. Example").WebList("what-to-do").GetROProperty("items
count") If Item_Count = 15
Then
Browser("Fill-Out Form.
Example").Page("Fill-Out Form.
Example").WebButton("Remove Item From
List").Click Browser("Fill-Out Form.
Example").Page("Fill-Out Form.
Example").WebList("what-to-do").CheckProperty
"items count", 14, TimeLimitation
Else
Reporter.ReportEvent micFail, "Number Of List Items", "The item count
in the list should be 15, not " & Item_Count & "." End If End Sub
|
|
收藏
举报
TAG: