Ok, I played a little more so it would also work with https.
Just needed to add few extra lines to existing script:
def page_status url
url = URI.parse(url)
http = Net::HTTP.new(url.host, url.port)
if url.scheme.downcase == "https"
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.use_ssl = true
end
http.start do
http.request_get(url.path.empty? ? "/" : url.path) do |res|
return {:name => res.class, :code => res.code}
end
end
end
status = page_status("https://localhost")
puts status[:name]
puts status[:code]
Jarmo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---