Facebook

Course Name Start Date Time Duration Registration Link
No Training Programs Scheduled ClickHere to Contact
Please mail To sudhakar@qtpsudhakar.com to Register for any training

Thursday, September 2, 2010

Description Object - Creating Object Descriptions

'###############################################
'           Description Object
'###############################################

'Purpose: To create a Description Object which can store the properties of an object
'      It is useful in Descriptive Programming

'1. Using Description Object in place of Properties
 
 Set oBrowser = Description.create
 oBrowser ("micclass").value="Browser"
 oBrowser ("name").value= "Google"
 
 Set oPage = Description.create
 oPage ("micclass").value="Page"
 oPage ("name").value= "Google"
 
 Set oLink = Description.create
 oLink ("name").value= "Login"
 oLink ("index").value= 1
 
 Browser(oBrowser).Page(oPage).Link(oLink).click
 
'2. Using Description to Get Child Objects
 
 Dim oLinkDescription
 Dim oLinks
 Dim lnkCount
 Set oLinkDescription=Description.Create
 oLinkDescription("name").value="signin"
 set oLinks=browser("micclass:=Browser").page("micclass:=Page").ChildObjects(oLinkDescription)
 
 if oLinks.count <> 0 then
  oLinks(0).click
 End If

No comments :

Post a Comment