In this let us see a script to count number of links in a web page.This will help to understand the descriptive programing better and will help to solve many practical requirements like finding the broken links.
Let us count the number of links in google’s home page
Set mygooglesearch = Description.Create()
Then you declare the property name and value pair for that object,here since we are counting the link,we have to use micclass property of type link.
Now use childobjects to get the properties into link_count objects,this will give all the child objects of that page of type link.
Set link_count = Browser(“name:=google”).Page(“title:=google”).childobjects(mygooglesearch)
Now we get the object count using count method.