top | item 2451608

(no title)

AndrewO | 15 years ago

First off, I think this is pretty well-reasoned. This part struck me as interesting:

"I believe tests should be written in the language most natural for the problem... I have never coded my way through a surfing session." 

To take that a step farther, we usually don't write prose-form descriptions of surfing sessions either. Following that, it seems the language most natural to describe a user interacting with an application through a browser is a straight recording of clicks and form interactions (if I understand correctly, this is what Selenium IDE tries to accomplish, although I've had problems with that particular tool), rather than Cucumber's descriptions, which compared to that, are more like code.

This is why I abandoned Cucumber: it seemed to be another way of writing code and left me on the wrong side of the gap between specification and actual interaction. I don't fault anyone who has found it to be valuable—as the poster said, it's possible to write good tests with any tool. Choose one you like.

discuss

order

3am|15 years ago

Surprised that the Robot framework didn't come up here.

Cucumber's domains specific business language approach is great to when you have a larger group of people, and you want to give non-technical staff (product managers) a way to write tests directly instead of requirement documents. Ideally it provides the non-technical people a vocabulary to describe a test, and mapping that vocabulary to the AUT is up to a test engineer.

Selenium can be that lower level of implementation for cucumber, or can describe the test cases itself. As you noted, Selenium provides a simplifying api for DOM parsing and JS execution, which is a pretty reasonable language for describing a test (if not a little low level and requiring the technical chops that cucumber seeks to avoid).

Robot allows the test designer to compound low level actions into higher level ones in a way that is transparent. I think it strikes a pretty good compromise between high level (cucumber) and low level (direct Selenium API calls).

TL;DR'ing myself: you last paragraph makes me think you'd like the robot framework.

glenjamin|15 years ago

Do bear in mind that just writing tests using business language in cucumber doesn't make then run. You still have to use some sort of test library underneath it to power the steps. In my current work I'm using the selenium API to do this, which hopefully is creating readable tests which re-use test execution code that makes updating them to UI changes far easier than just using a recording tool.