Automating simple web forms

What would be the best headless web testing/automation library to use,
given that:

  1. I want to automate filling in and submitting forms on one web site,
    which uses only a little JavaScript.
  2. I want something that balances ease of use and stability, and is
    reasonably actively maintained
    ?

I’ve been playing around with Watir and gotten it to do what I want,
but it involves a live browser; I would like something headless. When
I asked on IRC, I was told Capybara was good – and it does look good,
but I’m not sure if it has too many moving parts for my purposes.

Have you looked at Celerity?
On Mar 30, 2011 9:07 PM, “Eric C.”
[email protected]

Excerpts from Eric C.'s message of Thu Mar 31 04:06:32 +0200
2011:

What would be the best headless web testing/automation library to use,
given that:

  1. I want to automate filling in and submitting forms on one web site,
    which uses only a little JavaScript.
  2. I want something that balances ease of use and stability, and is
    reasonably actively maintained
    ?

The only headless browser supporting JS I know about is HTMLUnit
(written in Java). I remember having seen some libraries providing Ruby
interfaces for it.

If you don’t need JS mechanize etc are alternatives.

Marc W.

On Thu, Mar 31, 2011 at 5:35 PM, Marc W. [email protected] wrote:

(written in Java). I remember having seen some libraries providing Ruby
interfaces for it.

Yeah, I looked a little at that. Apparently you can use it from within
Selenium and Capybara, and probably others.

If you don’t need JS mechanize etc are alternatives.

I just discovered I really don’t need JS in this case, so I will try
mechanize. I’d still like to know the best route to go in the future
when I do need JS though.

On Thu, Mar 31, 2011 at 11:35 PM, Marc W. [email protected]
wrote:

The only headless browser supporting JS I know about is HTMLUnit
(written in Java). I remember having seen some libraries providing Ruby
interfaces for it.

Celerity.

It is also pretty good, and bloody fast. It also has some nice features
wrt
HTTPS and certificates (inherited from the HttpUnit library). The Ruby
API
is pretty good - a nice example of how to wrap a Java API with Ruby.

Capybara supports Celerity as a driver, but I think there is talk of
removing it.

On Fri, Apr 1, 2011 at 1:42 AM, Eric C. <
[email protected]> wrote:

mechanize. I’d still like to know the best route to go in the future
when I do need JS though.

There’s a non-Ruby headless browser with JavaScript I recently
discovered
called PhantomJS: http://www.phantomjs.org/

Eric C. wrote in post #990286:

I just discovered I really don’t need JS in this case, so I will try
mechanize.

I suggest you have a look at cucumber too (cukes.info) - this is a sort
of DSL which sits on top. I used it with webrat, but I expect it
supports capybara etc these days, and there are howtos on using it with
watir and so forth.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs