Validating HTML and checking for HTTP errors are vastly different things. Validating HTML is something that you can do by any number of means. Some Web development tools come with syntax validators and link checkers; there is a checker at validator.w3c.org that will ensure that your HTML is syntactically correct. This doesn't mean that there are no errors on your page; it just means that a browser can read it without getting confused, leaving something out, or barfing. And, by the way, WATIR doesn't do any of this, as far as I know. Checking for an HTTP error (which WATIR does do) essentially involves making sure that no problems have cropped up in the transportation or delivery of the page. The most common instance of an HTTP error is that a browser requests a page, and the server reports that it can find the page that you're asking for--HTTP Error 404. WATIR does this to make sure that it can continue to whatever its next step is.
WATIR is Web Application Testing (in Ruby), but that doesn't mean that WATIR does the testing, in the same way that a debugger neither finds nor fixes your bugs. WATIR is a tool that helps you to answer questions that you would like to ask about your application. You would be well-advised to read the WATIR User Guide and the sample tests if you haven't done so already. But the question "how do I catch any errors if they exist?" is the oracle problem. An oracle is a principle or mechanism that will help you to recognize a problem. WATIR is a tool that provides some mechanisms to support your principles. ---Michael B. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Schmechel Sent: January 30, 2006 11:34 AM To: [email protected] Subject: [Wtr-general] How do I validate HTML and Javascript? Hi, I'd like to validate the HTML (ie. check for HTTP errors) and the Javascript on a set of pages. My script currently visits the pages via ie.goto(site). I noticed a couple of different methods -- which do I want to call? add_checker() check_for_http_error() How do I catch any errors if they exist? Any examples scripts would be helpful. Thanks again, Chris Schmechel _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
