Facebook

For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
New Schedule in MindQ Systems, Madhapur By SUDHAKAR
Course Name Date Time Duration Type Branch
Selenium+Appium 16th October 2017 7.30 AM - 9.00 AM IST 45 Days ClassRoom + Online Mind Q Madhapur
Selenium+Appium 30th October 2017 9.30 AM - 11.00 AM IST 45 Days ClassRoom + Online Mind Q Madhapur

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

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