lib/watir-classic/ie-class.rb in watir-classic-3.5.0 vs lib/watir-classic/ie-class.rb in watir-classic-3.6.0

- old
+ new

@@ -128,12 +128,15 @@ # @return [String] the IE browser version number as a string. def version @ie_version ||= begin require 'win32/registry' ::Win32::Registry::HKEY_LOCAL_MACHINE.open("SOFTWARE\\Microsoft\\Internet Explorer") do |ie_key| - ie_key.read('Version').last + begin + ie_key['svcVersion'] + rescue ::Win32::Registry::Error + ie_key['Version'] + end end - # OR: ::WIN32OLE.new("WScript.Shell").RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Version") end end # @return [Array<String>] the IE browser version numbers split by "." in an Array. def version_parts