Hi all,
I am in a fix regarding a disabled select_list on my page. Though the
select_list gets disabled after I select a value the first time and
the "enabled?" statement returns me a false, the second time that I
try to select a value, the value gets selected. This should not have
happened as I was expecting the same error that I get on trying to
click on a disabled button.
### Error for clicking on the disabled button ###
ruby testdisabled.rb
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:57:in
`assert_enabled': object idmyButton and is disabled
(Watir::Exception::ObjectDisabledException)
Please find below the Html and Watir code for reference.
### WATIR CODE ###
require 'watir'
ie=Watir::IE.attach(:title,//)
#Check for Disabled Select_List
ie.select_list(:id => "Select").set('Audi')
puts ie.select_list(:id => "Select").enabled?
ie.select_list(:id => "Select").set('Saab')
### HTML CODE ###
<html>
<head>
<script type="text/javascript">
function disable()
{
document.getElementById("Select").disabled=true;
}
</script>
</head>
<body>
<form>
<select id="Select" onchange="disable()">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</form>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---