views:

1287

answers:

1

I want to know that how many checkboxes are present on the home page of www.gmail.com and also I want to check the checkbox is checked or not .....

My code is....

Set obj= Description.Create()
obj("name").value="PersistentCookie"
obj("html tag").value="INPUT"
obj("type").value="checkbox"

Set a = Browser("name:=Gmail.*","title:=Gmail.*").Page("title:=Gmail.*").Childobjects(obj)
MsgBox a.count

c =Browser("name:=Gmail.*", "title:=Gmail.*").Page("title:=Gmail.*").GetROProperty("checked")
MsgBox c

The value of c is always "OFF" even i checked the checkbox (Remember me on this computer) and execute the above code but value of c is always "OFF"

Please help me on this thanks in advance...

kindly reply on this..

+1  A: 

You're running the GetROProperty function on the Page object rather than the check-box you found (I don't know why Page has a checked property) but if you run on the test object returned by ChildObjects you will get the correct value (1 for true 0 for false).

c = a(0).GetROProperty("checked")
Motti