GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 620 of 684    Print  
How to count the no of web links in a web page?
How to count the no of web links in a web page?
I used the following script but i am getting zero as output.
plz help me out.

Dim objlink
systemutil.Run"iexplore.exe","www.yahoo.com"

Set objlink=description.Create
objlink("micclass").value="webLink"
Set i=desktop.ChildObjects(objlink)
msgbox i.count

thanks in advance



  
Total Answers and Comments: 5 Last Update: April 18, 2008     Asked by: kishchilukuri 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 15, 2008 05:01:32   #1  
kumar2309 Member Since: April 2008   Contribution: 1    

RE: How to count the no of web links in a web page?
Check its working
Set objLink description.Create
objLink("micclass").value "Link"
Set webLink Desktop.ChildObjects(objLink)
linkCount webLink.count
msgbox linkCount

 
Is this answer useful? Yes | No
April 16, 2008 01:27:29   #2  
NawabShaikh Member Since: January 2007   Contribution: 238    

RE: How to count the no of web links in a web page?
Set OLink Browser().Page().Frame().childObjects(OLinkDesc)

Msgbox OLink.Count


Regards
Nawab

 
Is this answer useful? Yes | No
April 16, 2008 03:56:24   #3  
janaki.bayya Member Since: February 2008   Contribution: 5    

RE: How to count the no of web links in a web page?
hi check this once
set odesc description.create()
odesc("micclass").value "web link"
set rc browser("title: .*").page("title: .*").childobjects(odesc)
linkcount rc.count()
msg box linkcount

 
Is this answer useful? Yes | No
April 16, 2008 13:26:15   #4  
kishchilukuri Member Since: April 2008   Contribution: 17    

RE: How to count the no of web links in a web page?
Hey I am getting "General Run Error" while trying the above script.
Could you plz help me out.

Thanks
kishore

 
Is this answer useful? Yes | No
April 18, 2008 09:45:53   #5  
goldvels Member Since: April 2008   Contribution: 2    

RE: How to count the no of web links in a web page?

Eg:

set objLnks Br("...").Page("...").Object.GetElementsByTagName("A")

'get the collections of links


msgbox objlnks.length '\ It will display the total no.of links in that page


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape