Get No of links in a page- Descriptive programming

Share this post
FaceBook  Twitter     

There are two ways to identify a object using descriptive programming :

A) Create an Object with all related properties and get all items meeting with the criteria and Then identify your required object

Set oDesc = Description.Create()

' Retrieve HTML tag <A>
oDesc("html tag").Value = "A"

Set obj = Browser("title:=Google.*").Page("title:=Google.*").ChildObjects(oDesc)

Itemcount = obj.Count() 'get the number of  link in a page

For i=0 to Itemcount-1
    msgbox (obj(i).GetROProperty("name"))



B) Provide all related properties criteria with the object as shown below

Browser("google").page("google").webbutton("name:=Google Search","type:= Submit").click