From: alex fenton Date: 2003-12-11T07:22:07+09:00 Subject: Re: Testing web application, need assistance ... Hi I'm not sure what you mean by handling multi-stage POSTs - do you mean ones with data persisting in hidden fields that are sent back and forth a few times? If you're testing web apps, you might find you can use a mix of html-tools, http-access2, and rexml to automate stepping through a series of pages, including forms. http-access2 (similar to perl's LWP) handles the HTTP at a slightly higher level than raw HTTP::Request, html-tools parses the pages you get back, and rexml allows you to pick out and interact with bits of the page. At work, I use perl's WWW::Mechanize, to test multi-step form-filling (for a CMS), and I wrote something similar for Ruby without too much difficulty. You can write test scripts like: a = HTTP::Automaton.new() a.fetch('http://something.org') a.follow_link(/Nice things/) # follow a link with text =~ /Nice things/ a.submit_form('the_form', { 'name' => 'alex } ) # post/get a form I doubt it'd be hard to implement the handling of meta tags in a similar style. As a bonus, all the packages are on the RAA pure ruby and straightforward to install or come with the base install. cheers alex jrb3@eidogen.com wrote: > Hi all! > > I'm trying to test a web application using standard Ruby Net::HTTP, > thought you could help. > > The application server I'm testing provides a multi-stage reply to a > POST (not multi-part). All stages but the last are full pages, with a > simple META tag forcing a refresh to itself after a short interval; > the last stage is the intended full-page reply. The relevant header > element is > ---- > > ---- > > My sense, on reading net/http.rb and the HTTP RFC, is that if I tried > to repeat the Net::HTTP.post(), this would start a new POST instead of > getting the next stage. > > Has anyone successfully dealt with programmatically getting that last > stage's reply? As an added bonus, has anyone captured the > intermediate pages as well for later perusal? > > Thanks in advance for any insights. > > Joseph Beckenbach > lead XP tester, Eidogen Inc. > http://acceptor.tigris.org/ > > >