Re:Mechanize 0.2.0 released
by iamelgringo on Saturday April 24, 2010 @12:58PM
(#1291145)
Have you looked at Selenium? It might have more of what you're looking for.
[ Parent
| on HN ]
Things like Mechanize and HTMLUnit are what I call "HTTP-only protocol drivers" and are not a true-fidelity simulation of the HTML+JavaScript environment. This is exactly the reason I created Selenium in the first place. I had regression bugs in IE and Mozilla that I needed to verify were fixed in the actual browsers. An emulated browser environment like Mechanize or HTMLUnit isn't a real browser that users actually use, so it doesn't solve the regression testing problem I had.
Best of both worlds these days is in driving a headless WebKit (a true browser driver that includes the JS interaction), which will be coming in Selenium 2.
Thanks, Selenium can replay user interaction sessions, but I need to set e.g. form fields programmatically, is that possible? Maybe CPAN/Gtk2::WebKit is also an option.
Yes, it is possible, and fairly routine in Selenium. Also, you can execute arbitrary Javascript for whatever else you may need.
Re:Mechanize 0.2.0 released
by aaronblohowiak on Saturday April 24, 2010 @06:49PM
(#1291712)
you can even use your recorded sessions to spit out the code that you can then use as a template for your code
Yes, along the same lines, you could use Waitr.
http://www.layeredthoughts.com/automation/how-to-write-your-...