Quality is delighting customers
hi,
using qtp, how could we find how many links are there in a web page.
eg. i have opened some web page which contains five hyper links in it. but in actual i dint know that five hyper links exists in that web page. so could you tell me, how to find it out.
Tags:
Hi,
set a= description.create
a("micclass").value="links"
set b=b().p().childobjects(a)
c=b.count
msgbox c
for i= 0 to c-1
d=b.getroproperty("name")
msgbox d
hi vijay,
thank you very much for your response. but i dont understand the program. i am not a programmatic geek. but then thank you for your work.
the line which you had used in between set b=b().p().childobjects(a)
b() and p() --> are they functions. if so, then where is the code related to those functions and if you could provide me the explanation, that would be a lot helpful to me.
prithvi
Hi Jayanthi,
Thank you and it would be help full to me if you could give me some explanation.
With Regards,
Prithvi
Hi anand
thank you and you gave me an comprehensive idea of what it is
Hi Prithvi,
Simple steps to get number of links on a page are as below..
simple code satisfying above points:
set linkobject=Description.Create --> This line is used to create description object
linkobject("Micclass").value="link" --> This line is used to identify the property.( In our case its link)
set a=Browser("Google").Page("Google").ChildObjects(linkobject) --> This line is used to return the childobjects having 'Linkobject' description.
linkcount= a.Count ---> This line is used get number of links on a webpage
MsgBox linkcount
I hope that with above information you will get idea to get the number of links on a webpage
Regards,
Madhuri
hi madhuri
thank you for giving me an crystal clear idea
© 2021 Created by Quality Testing.
Powered by