GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 650 of 677    Print  
How do we count links on the web page displayed?
supposed there are some 2o links in web page how do we give count of them
if the links ar there in an weblist object.
can we use getrop(itemcount)
or how we vil put page check point,pls do me needful.
Thanks
sudha



  
Total Answers and Comments: 3 Last Update: July 03, 2008     Asked by: srisudha1846 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: srisudha1846
 

Set LinkDesc=Description.Create ()
LinkDesc("micclass").value="Link"
LinkDesc("html tag").value="A"
set Links=Browser("QTP - Google Search").Page("QTP - Google Search").ChildObjects(LinkDesc)
Msgbox Links.Count



Above answer was rated as good by the following members:
jitendramishra, venkatraj.banka
June 01, 2008 05:42:31   #1  
srisudha1846 Member Since: May 2008   Contribution: 3    

RE: How do we count links on the web page displayed?

Set LinkDesc=Description.Create ()

LinkDesc("micclass").value="Link"

LinkDesc("html tag").value="A"

set Links=Browser("QTP - Google Search").Page("QTP - Google Search").ChildObjects(LinkDesc)

Msgbox Links.Count


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
June 24, 2008 08:17:56   #2  
Dipak123 Member Since: June 2008   Contribution: 6    

RE: How do we count links on the web page displayed?
We can Count the number of links in a webpage in two ways

1) Using the Description Object and ChildObjects Method
Set oDesc = Description.Create()
oDesc("html tag").Value = "A"
Set mylinksColl = Browser().Page().ChildObjects(oDesc)
Msgbox mylinksColl.Count
Set mylinksColl = Nothing
Set oDesc = Nothing

2) Using the Object Property

Msgbox Browser().Page().Object.links.Count

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
July 03, 2008 04:37:30   #3  
venkatraj.banka Member Since: July 2008   Contribution: 2    

RE: How do we count links on the web page displayed?


Dim oLinks

Set oLink = Description.Create()
oLink("micclass").Value = "Link"
oLink("html tag").Value = "A"

Msgbox Browser("title:=.*").Page("title:=.*").ChildObjects(oLinks).Count

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape