'Open a Google page and count the no of links and buttons in that page
If Browser("index:=0").Exist(1) then 'If Browser is already opened
a=Browser(index:=0").GetROProperty("hwnd")
Browser("hwnd:="&a).Navigate("http://www.google.com")
Browser("hwnd:="&a).Sync
wait(2)
Else 'If Browser is not opened
Systemutil.Run "IEXPLORE.exe"
a=Browser("index:=0").GetROProperty("hwnd")
Browser("hwnd:="&a).Navigate("http://www.google.com")
Browser("hwnd:="&a).Sync
wait(2)
End If
Set butObj=Description.Create ''''For Buttons
butObj("html tag").value="INPUT"
butObj("type").vlaue="submit"
Set linkObj=Description.Create ''''For Links
linkObj("html tag").value="A"
Set Buttons=browser("hwnd:=&a).page(title:=.*") .ChildObjects(butObj)
Set Links=browser("hwnd:=&a).page(title:=.*") .ChildObjects(linkObj)
msgbox "Total Button are: "&Buttons.count
msgbox " Total Links are: "&Links.count
Important Topics & Useful Scripts on QTP. Ask your QTP related questions at this id - asrajaputra@gmail.com
Saturday, May 31, 2008
Subscribe to:
Post Comments (Atom)
About Me
- RAJAPUTRA
- Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.
Subscribe to get updates on this blog
NOTE
Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.
No comments:
Post a Comment