[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-07-01 Thread basu
Hi Germo, If we are collecting all the links of a web page and navigating to each link via click, don't you think you are sending http request twice ? (via click and http.request_get) Instead cannot we figure out page is broken or not without sending the extra request? (dont want to verify page

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-05-20 Thread Paul Denize
Thanks for all the replys. At first I was quite excited then realized they would make additional calls - the cookies, session, conversation elements would all be a nightmare. Not to mention that the load balancer may give valid results sometimes and invalid the next (say if one server is bad).

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-24 Thread Jarmo Pertman
Oh, you're right! I forgot to think anything about sessions and cookies :/ In that way it should be indeed easier just to scan page html... But anyway, I don't see why such things are needed. Why won't you just create normal tests, which assert multiple things and they would fail for sure if

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-24 Thread marekj
Maybe we need to make some distinctions here. I view Watir as a 'browser driver' in the sense that it talks to the DocumentObjectModel of a browser and doesn't care how the browser deals with http protocol (well, we can maybe peek a bit). Watir API is talking to the final composition of html, js,

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-23 Thread Jarmo Pertman
I also wondered why this regular expression script was in Watir's source, since it is actually really easy to get status with Net::HTTP. Anyway, here are 2 examples I just did which could be used. First one returns response status code and response class. It will throw exception if web server

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-23 Thread Jarmo Pertman
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

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-23 Thread Jarmo Pertman
Sorry, you also need to replace require 'net/http' with require 'net/ https' Jarmo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-23 Thread Paul Rogers
can you get openssl to work on windows. I dont remember if this is easy or hard. Watir is different to net/http. If you did a watir request, and then a net/http request, thats 2 requests. And you need to get all the cookies etc from the browser into net/http. And you wont get any javascript or

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-22 Thread Tony
Hi Paul, Would suggest you use fiddler which is a free tool.(http:// www.fiddler2.com/fiddler2/) You could run fiddler while your scripts are executing and capture the status code, urls hit etc from a different process. You could also try httpwatch (not free) http://www.httpwatch.com/ This

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-04-22 Thread Paul Rogers
i could never find a way of getting the status code easily. If you look through the watir source it does something like use a regular expression against the page title to try and figure it out. At one point watir would raise an exception when the page finished loading if it was an error, I think