Which option is good for web testing.

496 views
Skip to first unread message

kalyan

unread,
Jan 25, 2012, 9:14:51 AM1/25/12
to Cukes
I am trying to do test automation of web application developed in
J2EE. Tried capybara and watir-webdriver. Have more options listed on
the website. Which option is good. Is there any place where
comparision of these options are provided, when to use which and
more.....

aslak hellesoy

unread,
Jan 25, 2012, 10:11:11 AM1/25/12
to cu...@googlegroups.com
On Wed, Jan 25, 2012 at 2:14 PM, kalyan <solasa...@gmail.com> wrote:
> I am trying to do test automation  of web application developed in
> J2EE. Tried capybara and watir-webdriver.

How did that work for you?

> Have more options listed on
> the website.

What URL are you referring to?

> Which option is good.

All browser automation libraries have their strengths and weaknesses,
so it's hard to answer your question unless you're more specific.

> Is there any place where
> comparision of these options are provided, when to use which and
> more.....
>

Not that I'm aware of.

Aslak

> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>

kalyan

unread,
Jan 27, 2012, 5:55:50 AM1/27/12
to Cukes


On Jan 25, 8:11 pm, aslak hellesoy <aslak.helle...@gmail.com> wrote:
> On Wed, Jan 25, 2012 at 2:14 PM, kalyan <solasakal...@gmail.com> wrote:
> > I am trying to do test automation  of web application developed in
> > J2EE. Tried capybara and watir-webdriver.
>
> How did that work for you?
>
> > Have more options listed on
> > the website.
>
> What URL are you referring to?
https://github.com/cucumber/cucumber/wiki/ has options for web
application testing


> > Which option is good.
>
> All browser automation libraries have their strengths and weaknesses,
> so it's hard to answer your question unless you're more specific.
I am new and wanted to know how to approach the options. Which one to
use when?

Miguel Almeida

unread,
Jan 27, 2012, 9:43:56 AM1/27/12
to cu...@googlegroups.com
I haven't used any test automation frameworks/helpers yet. On our new project, we're trying out crawiling under the skin (essentially faking the request and session) and we'll see how that goes. The only thing excluded from this approach is the html and any business logic that might be in javascript.

Richard Lawrence

unread,
Jan 27, 2012, 10:13:41 AM1/27/12
to cu...@googlegroups.com
Selenium WebDriver seems to be the most widely-used web app driver, with Capybara the typical way to use WebDriver from Ruby. I've used Capybara against Rails, ASP.NET, and Java web apps, and it works great.

Richard


On Friday, January 27, 2012 at 5:55 AM, kalyan wrote:

>
>
> On Jan 25, 8:11 pm, aslak hellesoy <aslak.helle...@gmail.com (http://gmail.com)> wrote:


> > On Wed, Jan 25, 2012 at 2:14 PM, kalyan <solasakal...@gmail.com (http://gmail.com)> wrote:
> > > I am trying to do test automation of web application developed in
> > > J2EE. Tried capybara and watir-webdriver.
> >
> >
> >
> > How did that work for you?
> >
> > > Have more options listed on
> > > the website.
> >
> >
> >
> > What URL are you referring to?
> https://github.com/cucumber/cucumber/wiki/ has options for web
> application testing
>
>
> > > Which option is good.
> >
> > All browser automation libraries have their strengths and weaknesses,
> > so it's hard to answer your question unless you're more specific.
>
>
> I am new and wanted to know how to approach the options. Which one to
> use when?
>
>
>
> > > Is there any place where
> > > comparision of these options are provided, when to use which and
> > > more.....
> >
> >
> >
> > Not that I'm aware of.
> >
> > Aslak
> >
> > > --
> > > You received this message because you are subscribed to the Google Groups "Cukes" group.

> > > To post to this group, send email to cu...@googlegroups.com (mailto:cu...@googlegroups.com).
> > > To unsubscribe from this group, send email to cukes+un...@googlegroups.com (mailto:cukes+un...@googlegroups.com).


> > > For more options, visit this group athttp://groups.google.com/group/cukes?hl=en.
> >
>
>
>

> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.

> To post to this group, send email to cu...@googlegroups.com (mailto:cu...@googlegroups.com).
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com (mailto:cukes+un...@googlegroups.com).

bis

unread,
Jan 27, 2012, 10:24:06 AM1/27/12
to cu...@googlegroups.com
I personally prefer watir-webdriver or selenium-webdriver over capybara, I think the key to making it work is to create a good page object framework around your application, there are a few gems out there that help you do this. and plenty of stuff on the web.

Thanks
Oscar

To post to this group, send email to cu...@googlegroups.com.
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.

Max

unread,
Jan 28, 2012, 4:18:16 AM1/28/12
to Cukes
> there are a few gems out there that help you do
> this. and plenty of stuff on the web.

Would you be able to list few here? Thanks


On Jan 27, 7:24 am, bis <bis...@gmail.com> wrote:
> I personally prefer watir-webdriver or selenium-webdriver over capybara, I
> think the key to making it work is to create a good page object framework
> around your application, there are a few gems out there that help you do
> this. and plenty of stuff on the web.
>
> Thanks
> Oscar
>
> On Fri, Jan 27, 2012 at 10:13 AM, Richard Lawrence <
>
>
>
>
>
>
>
> rich...@humanizingwork.com> wrote:
> > Selenium WebDriver seems to be the most widely-used web app driver, with
> > Capybara the typical way to use WebDriver from Ruby. I've used Capybara
> > against Rails, ASP.NET, and Java web apps, and it works great.
>
> > Richard
>
> > On Friday, January 27, 2012 at 5:55 AM, kalyan wrote:
>
> > > On Jan 25, 8:11 pm, aslak hellesoy <aslak.helle...@gmail.com (
> >http://gmail.com)> wrote:
> > > > On Wed, Jan 25, 2012 at 2:14 PM, kalyan <solasakal...@gmail.com (
> >http://gmail.com)> wrote:
> > > > > I am trying to do test automation of web application developed in
> > > > > J2EE. Tried capybara and watir-webdriver.
>
> > > > How did that work for you?
>
> > > > > Have more options listed on
> > > > > the website.
>
> > > > What URL are you referring to?
> > >https://github.com/cucumber/cucumber/wiki/has options for web

bis

unread,
Jan 30, 2012, 1:37:50 PM1/30/12
to cu...@googlegroups.com
of course ill mention
Taza https://github.com/hammernight/taza


these are some other dont know if they are still applicable or not
watir-page-helper https://github.com/alisterscott/watir-page-helper
page-object https://github.com/cheezy/page-object
watirloo https://github.com/marekj/watirloo
seleniumFury https://github.com/scottcsims/SeleniumFury

Matt Wynne

unread,
Jan 30, 2012, 5:06:40 PM1/30/12
to cu...@googlegroups.com
For me, choosing a browser automation library is quite simple:

If I'm writing step definitions in Ruby, I choose Capybara. If I need to, I can reach down beneath Capybara's sweet DSL to the underlying Selenium Webdriver API.
If I'm writing step definitions in C#, I choose Coypu. If I need to, I can reach down beneath Coypu's sweet DSL to the underlying Selenium Webdriver API.

The underlying Selenium Libraries are amazingly powerful, but also result in more verbose test code. Capybara and Coypu are well tested, robust and well maintained libraries, and I love using them.

I don't know about Java - is there an equivalent library to Capybara for Java?
cheers,
Matt


Aslak Hellesøy

unread,
Jan 30, 2012, 5:52:52 PM1/30/12
to cu...@googlegroups.com




On Jan 30, 2012, at 22:06, Matt Wynne <ma...@mattwynne.net> wrote:

For me, choosing a browser automation library is quite simple:

If I'm writing step definitions in Ruby, I choose Capybara. If I need to, I can reach down beneath Capybara's sweet DSL to the underlying Selenium Webdriver API.
If I'm writing step definitions in C#, I choose Coypu. If I need to, I can reach down beneath Coypu's sweet DSL to the underlying Selenium Webdriver API.

The underlying Selenium Libraries are amazingly powerful, but also result in more verbose test code. Capybara and Coypu are well tested, robust and well maintained libraries, and I love using them.

I don't know about Java - is there an equivalent library to Capybara for Java?


Absolutely. It's called Selenium WebDriver and it's rock solid.

Aslak

Matt Wynne

unread,
Jan 31, 2012, 12:19:38 AM1/31/12
to cu...@googlegroups.com
On 30 Jan 2012, at 22:52, Aslak Hellesøy wrote:





On Jan 30, 2012, at 22:06, Matt Wynne <ma...@mattwynne.net> wrote:

For me, choosing a browser automation library is quite simple:

If I'm writing step definitions in Ruby, I choose Capybara. If I need to, I can reach down beneath Capybara's sweet DSL to the underlying Selenium Webdriver API.
If I'm writing step definitions in C#, I choose Coypu. If I need to, I can reach down beneath Coypu's sweet DSL to the underlying Selenium Webdriver API.

The underlying Selenium Libraries are amazingly powerful, but also result in more verbose test code. Capybara and Coypu are well tested, robust and well maintained libraries, and I love using them.

I don't know about Java - is there an equivalent library to Capybara for Java?


Absolutely. It's called Selenium WebDriver and it's rock solid.

But is there a sweeter DSL on top of it?

Aslak Hellesøy

unread,
Jan 31, 2012, 2:06:17 AM1/31/12
to cu...@googlegroups.com




On Jan 31, 2012, at 5:19, Matt Wynne <ma...@mattwynne.net> wrote:


On 30 Jan 2012, at 22:52, Aslak Hellesøy wrote:





On Jan 30, 2012, at 22:06, Matt Wynne <ma...@mattwynne.net> wrote:

For me, choosing a browser automation library is quite simple:

If I'm writing step definitions in Ruby, I choose Capybara. If I need to, I can reach down beneath Capybara's sweet DSL to the underlying Selenium Webdriver API.
If I'm writing step definitions in C#, I choose Coypu. If I need to, I can reach down beneath Coypu's sweet DSL to the underlying Selenium Webdriver API.

The underlying Selenium Libraries are amazingly powerful, but also result in more verbose test code. Capybara and Coypu are well tested, robust and well maintained libraries, and I love using them.

I don't know about Java - is there an equivalent library to Capybara for Java?


Absolutely. It's called Selenium WebDriver and it's rock solid.

But is there a sweeter DSL on top of it?


Not that I know of, and I'm mot sure I see the need for it.

Adrian Longley

unread,
Jan 31, 2012, 2:05:00 PM1/31/12
to cu...@googlegroups.com
On 31 Jan 2012, at 07:06, Aslak Hellesøy wrote:





On Jan 31, 2012, at 5:19, Matt Wynne <ma...@mattwynne.net> wrote:


On 30 Jan 2012, at 22:52, Aslak Hellesøy wrote:





On Jan 30, 2012, at 22:06, Matt Wynne <ma...@mattwynne.net> wrote:

For me, choosing a browser automation library is quite simple:

If I'm writing step definitions in Ruby, I choose Capybara. If I need to, I can reach down beneath Capybara's sweet DSL to the underlying Selenium Webdriver API.
If I'm writing step definitions in C#, I choose Coypu. If I need to, I can reach down beneath Coypu's sweet DSL to the underlying Selenium Webdriver API.

The underlying Selenium Libraries are amazingly powerful, but also result in more verbose test code. Capybara and Coypu are well tested, robust and well maintained libraries, and I love using them.

I don't know about Java - is there an equivalent library to Capybara for Java?


Absolutely. It's called Selenium WebDriver and it's rock solid.

But is there a sweeter DSL on top of it?


I am working on a Java port of Coypu (little way off still)


Not that I know of, and I'm mot sure I see the need for it.

I suppose this depends on the nature of the site you are testing to some degree, but my experiences using both Capybara and native Selenium WebDriver against ajax-heavy sites was that I got to working, robust tests so much faster and with so much less code with Capybara.

In my experience of teams using WebDriver is that while what WebDriver can do is an utterly awesome, it's API is rather low level and test code tends to end up littered with xpath expressions, element ids and explicit (or implicit) waits and retries to map user lanuguage - such as you might find in cucumber steps - to the actual HTML/JS implementation of the UX.

In particular tests end up being coupled to the structure of the markup/css. Capybara's API helps you express your tests in a language much closer to the way a real user would making tests more tolerant of changes to the structure of the markup, ids etc. For example the forms API is awesome in how it uses label text to identify elements:

choose("Radio button label text")
fill_in("Label text").with("your value")
select("Option text / option value").from("Label text / name / id")

While WebDriver does have implicit waits, Capybara and Coypu also go a bit further to make tests robust. If you follow the WebDriver list you will see countless emails from users struggling with inconsistent stale element exceptions, or element not visible exceptions which are not handled by implicit waits. Everyone has their own strategy for dealing with this.

Coypu in particular will catch and retry on any WebDriver exception up to the defined timeout, making it very tolerant of changes to the DOM such as areas of the page reloading in response to AJAX requests, async javascript animating things in/out and so on.

I'm sure excellent test suites can be written with native WebDriver, but not in my opinion without solving these issues one way or another, and Capybara & Coypu certainly offer you a good head start in that direction.

Adrian



Aslak

On 30 Jan 2012, at 18:37, bis wrote:

of course ill mention
Taza https://github.com/hammernight/taza


these are some other dont know if they are still applicable or not
watir-page-helper https://github.com/alisterscott/watir-page-helper
page-object https://github.com/cheezy/page-object
watirloo https://github.com/marekj/watirloo
seleniumFury https://github.com/scottcsims/SeleniumFury

On Sat, Jan 28, 2012 at 4:18 AM, Max <max....@gmail.com> wrote:
> there are a few gems out there that help you do
> this. and plenty of stuff on the web.

Would you be able to list few here? Thanks


On Jan 27, 7:24 am, bis <bis...@gmail.com> wrote:
> I personally prefer watir-webdriver or selenium-webdriver over capybara, I
> think the key to making it work is to create a good page object framework
> around your application,


A good page object framework is certainly going to make your steps more readable, but it is still less than ideal to have page objects that are coupled directly to the UX in any case, no matter how well factored they are. I'm pretty sure Capybara would still help you implement your page objects more easily and give you more loosely coupled, more robust tests.

Matt Wynne

unread,
Feb 1, 2012, 6:28:55 AM2/1/12
to cu...@googlegroups.com
On 31 Jan 2012, at 19:05, Adrian Longley wrote:

I am working on a Java port of Coypu (little way off still)

Interesting! Great work on Coypu by the way, I've used it with a couple of .NET teams and we all love it.

Miguel Almeida

unread,
Feb 4, 2012, 10:46:44 AM2/4/12
to cu...@googlegroups.com
Do you guys use web testing frameworks extensively though?

I tend to agree with Gojko Adzic (http://gojko.net/2010/04/13/how-to-implement-ui-testing-without-shooting-yourself-in-the-foot-2/): it's very easy to create very bad UI tests that become brittle and a nightmare to maintain on the long run, especially if they are written in a script format (eg: 1. login 2. go to products page 3. write "playstation" in the search box 4. confirm result has at least 1 product).

On our most recent project we have avoided UI tests and test under the skin of the application.
I am interested in knowing if you guys disagree with this, and if you regularly write tests "above the skin" that don't shoot yourself in the foot and make you want to disable them when you decide to change your interface.


Miguel Almeida

Matt Wynne

unread,
Feb 6, 2012, 1:32:21 PM2/6/12
to cu...@googlegroups.com
On 4 Feb 2012, at 15:46, Miguel Almeida wrote:

Do you guys use web testing frameworks extensively though?

I tend to agree with Gojko Adzic (http://gojko.net/2010/04/13/how-to-implement-ui-testing-without-shooting-yourself-in-the-foot-2/): it's very easy to create very bad UI tests that become brittle and a nightmare to maintain on the long run, especially if they are written in a script format (eg: 1. login 2. go to products page 3. write "playstation" in the search box 4. confirm result has at least 1 product).

On our most recent project we have avoided UI tests and test under the skin of the application.
I am interested in knowing if you guys disagree with this, and if you regularly write tests "above the skin" that don't shoot yourself in the foot and make you want to disable them when you decide to change your interface.

Richard Paul

unread,
Feb 7, 2012, 5:17:46 PM2/7/12
to Cukes
For those looking for sweet DSLs on top of WebDriver, Geb provides a
pretty nice jQuery-ish DSL for Groovy. It also supports the page
object pattern.
http://www.gebish.org/

On Feb 7, 7:32 am, Matt Wynne <m...@mattwynne.net> wrote:
> On 4 Feb 2012, at 15:46, Miguel Almeida wrote:
>
> > Do you guys use web testing frameworks extensively though?
>
> > I tend to agree with Gojko Adzic (http://gojko.net/2010/04/13/how-to-implement-ui-testing-without-shoot...it's very easy to create very bad UI tests that become brittle and a nightmare to maintain on the long run, especially if they are written in a script format (eg: 1. login 2. go to products page 3. write "playstation" in the search box 4. confirm result has at least 1 product).
Reply all
Reply to author
Forward
0 new messages