Browse files

IE9 deprecated #value so you need to get the value from the attribute…

…. I changed def_wrap_guard to try this if calling the normal method fails. The changes are compatible with IE8
  • Loading branch information...
1 parent 1c0c63a commit 56bbd9a98e4fefd3899382a9cc018915ee639f66 @hmcgowan hmcgowan committed Jan 31, 2012
Showing with 14 additions and 10 deletions.
  1. +14 −10 watir/lib/watir/element.rb
View
24 watir/lib/watir/element.rb
@@ -56,20 +56,24 @@ def inspect
private
def self.def_wrap(method_name, ole_method_name=nil)
class_eval "def #{method_name}
- assert_exists
- ole_object.invoke('#{ole_method_name || method_name}')
- end"
+ assert_exists
+ ole_object.invoke('#{ole_method_name || method_name}')
+ end"
end
def self.def_wrap_guard(method_name, ole_method_name = nil)
class_eval "def #{method_name}
- assert_exists
- begin
- ole_object.invoke('#{ole_method_name || method_name}')
- rescue
- ''
- end
- end"
+ assert_exists
+ begin
+ ole_object.invoke('#{ole_method_name || method_name}')
+ rescue
+ begin
+ ole_object.getAttribute('#{ole_method_name || method_name}') || ''
+ rescue
+ ''
+ end
+ end
+ end"
end

0 comments on commit 56bbd9a

Please sign in to comment.