Pages

Wednesday, 19 October 2011

QTP Script: Register a procedure with an object class


' add GetItemsCount as a method of the WebList class
RegisterUserFunc "WebList""GetItemsCount""GetItemsCountFunction"

' =============================================================
' function : GetItemsCountFunction
' desc : Returns the number of items from a weblist
' =============================================================
Function GetItemsCountFunction(objWebList)

If (objWebList = NothingThen
    GetItemsCount = 0
Else
    GetItemsCount = objWebList.GetROProperty("Items Count")
End If

End Function


0 comments:

Post a Comment