Tuesday, 29 April 2014

UFT - QTP - How do you find the number of links in a page





 Assume we are want to find all links on "Uftquestions.Blogspot.in" page.

Set objPage = Browser("name:=UFTquestions.*").page("title:=UFTquestions.*")
Set objLink = Description.Create
objLink("micclass").value = "Link"
Set objChildLink = objPage.ChildObjects(objLink)
msgbox objChildLink.count


You may try for any other pages by Replacing the "UFTquestions.*" with any other Page title where ".*" represents regular expression.

Message box will show you the number of links on the page.

Regards,
Sreenu Babu

No comments:

Post a Comment