1. 使用watir的方法
require 'watir'
ie = Watir::IE.attach(:url,/daily/)
n = ie.document.invoke('parentWindow').navigator.appVersion
m = /MSIE\s(.*?);/.match(n)
if m[1]=="6.0" then
puts "IE version = 6.0"
else
puts "IE vesrion =7.0"
end
2. 是用ruby 直接查询注册表
run = ·reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\" \/v version"·
puts run