I'm using Faraday to check the browsers URL for SSL certifications. If the 
URL is SSL certified the status will be 200, if the URL is not SSL 
certified it gives me a Faraday::Error message. What I would like to do is 
count the amount of times the Faraday::Error message shows up. 

Here is my attempt:

***begin Ruby code***
      urls.map do |x|
        @browser.goto(x)
        *@count = 0*
        begin
          res = Faraday.get(@browser.url)
          puts "#{@browser.url} - status is: #{res.status}"
        rescue Faraday::Error::ConnectionFailed
          puts "#{@browser.url} - SSL needs to be verified."
          *@count +=1*
        end
        #@browser.close
      end
        puts "number of URLs that need to be verified are: #{*@count*}"

***end Ruby code***

Output: 

https://(url).com - SSL needs to be verified.
https://(url).com - status is: 200
https://(url).com - SSL needs to be verified.
https://(url).com - SSL needs to be verified.

*number of URLs that need to be verified are: 1*

***end output***

It seems @count is only counting the last run rescue attempt, where as my 
goal is to get the total number of rescue attempts. 

Any help would be great. 

Cheers 


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to