Try this: assert(@is.checkbox(:value, "other_offers).isSet?)

 

A good resource for examples like this are the unittests, which are installed with WATIR.

 

Hope this helps,

 

--Mark


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Terry Peppers
Sent: Wednesday, October 26, 2005 6:36 AM
To: [email protected]
Subject: [Wtr-general] Testing If a Checkbox is Checked by Default

 

Is there anyway in Watir to test a webpage to see if a Checkbox is checked by default?

I can access the checkbox name and verfy that there's a value with the following:

------------- BEGIN CODE -------------------

assert(@ie.checkbox(:name, "other_offers"))
assert(@is.checkbox(:value, "other_offers).exists?)

------------- END CODE -------------------

But how can I tell if the box is checked? I tried using 'set' - but I don't think that's correct. Can this be tested?

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to