Tap Mechanize
A task library for submitting http requests using Tap and Mechanize
Description
Tap::Mechanize provides tasks and controllers to automate interaction with websites, and in particular with web applications. Tap::Mechanize provides a Ubiquity command to redirect and capture HTTP requests as YAML. The resulting request configuration files can be edited and resubmitted using a Request task. Multi-step actions, file uploads, and actions that require the use of HTTPS may all be automated in this way.
Usage
Tap::Mechanize submits HTTP requests using the Tap::Mechanize::Submit task. Headers and parameters may be specified, but only a uri is required.
r = Tap::Mechanize::Submit.new
r.process(:uri => 'http://www.google.com')[0, 80]
# => "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859"
Capturing Web Forms
HTTP requests from web forms may be captured and resubmitted using a combination of tools. First start a tap server from the command line:
% tap server
Now open a browser and work through the tutorial: localhost:8080/capture/tutorial
The current capture scripts redirect via the onsubmit and onclick events in a web page. This works in most cases, but is known to fail in some circumstances (ex Java Server Pages). A workaround exists using the Live HTTP Headers addon. Start a web server and see localhost:8080/capture/http.
Installation
Tap::Mechanize is available as a gem on RubyForge. Use:
% gem install tap-mechanize
Note this package was once called tap-http.
Info
Copyright © 2008-2009, Regents of the University of Colorado.
- Developer
- Support
-
CU Denver School of Medicine Deans Academic Enrichment Fund
- Licence