Saturday, December 6, 2008

To check/Uncheck all the checkboxes present on a web page

Systemutil.Run"IExplore","www.yahoomail.com"
wait(10)

Dim obj_DescChk

Set obj_DescChk=Description.Create
obj_DescChk("html tag").value="INPUT"
obj_DescChk("type").value="checkbox"

'obj_DescChk.remove "html tag" '''''''''''''''''''Would delete the html tag property from the collections
'If obj_DescChk("html tag").value=empty then ''''''''To Know the property is exists or not in the collection
'obj_DescChk("html tag").value="INPUT" '''''''''''''''''If not then add it to the collection
'end if

Dim AllChkBoxes, SingleChkBox
Set AllChkBoxes=Browser("title:=Yahoo! Mail: The best web-based email!").Page("title:=Yahoo! Mail: The best web-based email!").ChildObjects(obj_DescChk)
msgbox AllChkBoxes.count
For i=0 to AllChkBoxes.count-1
AllChkBoxes(i).set "ON"
Next

2 comments:

Unknown said...

Thanks ...it is very useful

madhu suthanan said...

I have done this but it is not selecting all the check boxes in the mailbox of yahoo for me. Any help appreciated.

About Me

My photo
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

Enter your email address:

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.