Micro Focus QTP (UFT) Forums
VB Script to count number of links in a web page. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: VB Script to count number of links in a web page. (/Thread-VB-Script-to-count-number-of-links-in-a-web-page)



VB Script to count number of links in a web page. - Suma Parimal - 01-26-2014

How to count number of links in a web page using VB Script in QTP/UFT? Please let me know the logic.


RE: VB Script to count number of links in a web page. - vinod123 - 01-27-2014

Code:
Set Des_Obj = Description.Create
Des_Obj("micclass").Value = "Link"
Set link_col = Browser("name:=Google").Page("title:=Google").ChildObjects(Des_Obj)
msgbox link_col.count



RE: VB Script to count number of links in a web page. - Suma Parimal - 01-27-2014

Thank you Vinod,

Just wanted to know can we use the same logic to count the number of objects in a page? Is it possible to count the number of objects?


RE: VB Script to count number of links in a web page. - vinod123 - 06-18-2014

Yes you can use same logic to count the number of objects in a page?


RE: VB Script to count number of links in a web page. - govind - 07-01-2015

Code:
systemutil.Run"iexplore.exe","http://www.google.com"
set aa=description.create
aa(html tag).value="A"
set bb=Browser("title:=google.*").page("title:=google.*").childobjects(aa)
cc=bb.count
msgbox cc