Dear ,

Thanks for your Quick reply. i did it from  below code but i have a doubt which 
is how can we check it is showing right link or Image or edit page.
and can we disply all these link and store these link in our table(.xls)



Systemutil.Run "Iexplore.exe","http://www.google.co.in/";
wait(10)
Function GetAllSpecificControls(Page, MicClass)
    Set Desc = Description.Create()
'Description object contains collection of properties, which identify any UI 
object such as a browser, a page, a dialog, a list, a button etc.
   

 Desc("micclass").Value = MicClass
    Set GetAllSpecificControls = Page.ChildObjects(Desc)
End Function
Function GetAllEdits(Page)
    Set GetAllEdits = GetAllSpecificControls(Page, "WebEdit")
End Function
Function GetAllButtons(Page)
    Set GetAllButtons = GetAllSpecificControls(Page, "WebButton")
End Function
Function GetAllLinks(Page)
    Set GetAllLinks = GetAllSpecificControls(Page, "Link")
End Function
Function GetAllImages(Page)
    Set GetAllImages = GetAllSpecificControls(Page, "Image")
End Function

Set oPage = Browser("name:=Google").Page("title:=Google")
MsgBox "Number of Edits: " & GetAllEdits(oPage).Count
MsgBox "Number of Buttons: " & GetAllButtons(oPage).Count
MsgBox "Number of Links: " & GetAllLinks(oPage).Count
MsgBox "Number of Images: " & GetAllImages(oPage).Count

 



________________________________
From: Anish Pillai <[email protected]>
To: [email protected]
Sent: Wed, 2 June, 2010 12:33:37 PM
Subject: Re: link count

Hi Rahul,

Try this code - 

Systemutil.Run "iexplore","http://in.yahoo.com/";
wait(10)
Set DescEdit = Description.Create()
DescEdit("micclass").Value = "WebEdit"
Set DescLink = Description.Create()
DescLink("micclass").Value = "Link"
Set DescImg = Description.Create()
DescImg("micclass").value = "Image"
'Set Edits =Browser("name:=Yahoo! India").page("title:=Yahoo! 
India").ChildObjects(DescLink)
'Set Link =Browser("name:=Yahoo! India").page("title:=Yahoo! 
India").ChildObjects(DescLink)
'Set Image = Browser("name:=Yahoo! India").page("title:=Yahoo! 
India").ChildObjects(DescImg)
Msgbox  "Number of Image: " & Browser("name:=Yahoo! India").page("title:=Yahoo! 
India").ChildObjects(DescImg).Count
MsgBox  "Number of Edits: " & Browser("name:=Yahoo! India").page("title:=Yahoo! 
India").ChildObjects(DescEdit).Count
MsgBox  "Number of Link: " & Browser("name:=Yahoo! India").page("title:=Yahoo! 
India").ChildObjects(DescLink).Count

Regards,
Anish
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to