unittests/selectbox_xpath_test.rb in watir-1.9.0 vs unittests/selectbox_xpath_test.rb in watir-1.9.1.rc1
- old
+ new
@@ -37,12 +37,17 @@
def test_clearSelection
assert_raises(UnknownObjectException) { browser.select_list(:xpath, "//select[@name='NoName']/").clearSelection }
browser.select_list(:xpath, "//select[@name='sel1']/").clearSelection
- # the box sel1 has no ability to have a de-selected item
- assert_equal( ["Option 3" ] , browser.select_list(:xpath, "//select[@name='sel1']/").getSelectedItems)
-
+ if Watir::IE.version_parts[0].to_i >= 9
+ # ie9 allows you to clear a selected item even if it requires a selection
+ assert_equal( [] , browser.select_list(:xpath, "//select[@name='sel1']/").getSelectedItems)
+ else
+ # the box sel1 has no ability to have a de-selected item
+ assert_equal( ["Option 3" ] , browser.select_list(:xpath, "//select[@name='sel1']/").getSelectedItems)
+ end
+
browser.select_list(:xpath, "//select[@name='sel2']/").clearSelection
assert_equal( [ ] , browser.select_list(:xpath, "//select[@name='sel2']/").getSelectedItems)
end
def test_select_list_select