Hi, I have made an ant task for a few http activites like, http request, getting reference to a form/link in the resultant page, submitting it, etc. I have used httpunit package (http://httpunit.sourceforge.net) for this task.
An example usage is as follows:
<target name="http_activity">
<httpresponse>
<httprequest method="get" url="http://www.yahoo.com"/>
<getlink linkid="news_link" withText="news"/>
</httpresponse>
<httpresponse>
<httprequest linkid="news_link"/>
</httpresponse>
</target>
This was a trivial example showing how to follow a
link. You can follow a form too similarly.
Using httpunit enables to maintain a session
transparently.
This task would be helpful in a http testing scenario.
You can also automate certain internet transactions
with this task.
I have attached a zip file with source code and the
build.xml file. The build.xml file + java files
is the only documentation for now. More documentation
if this task is accepted ;-)
Cheers,
Gurdev.
<<attachment: httptask.zip>>
