Cucumber-JVM : what is advantage over TestNG

5,210 views
Skip to first unread message

Abhay Bharti

unread,
Jul 9, 2014, 10:30:09 AM7/9/14
to cu...@googlegroups.com
I am using Cucumber for writing automated regression test cases. I have automation framework designed using Selenium+TestNG+Maven etc. I have been asked to make a new automaton framework using Selenium+Cucumber+Java. I am curious to know - 

  1. what is advantage of Cucumber over TestNG
  2. Does cucumber feature like priorities, grouping, dependencies etc

aslak hellesoy

unread,
Jul 9, 2014, 11:10:53 AM7/9/14
to Cucumber Users
On Wed, Jul 9, 2014 at 3:30 PM, Abhay Bharti <abhay...@gmail.com> wrote:
I am using Cucumber for writing automated regression test cases. I have automation framework designed using Selenium+TestNG+Maven etc. I have been asked to make a new automaton framework using Selenium+Cucumber+Java. I am curious to know - 

  1. what is advantage of Cucumber over TestNG
Cucumber is a collaboration tool, which lets non-technical people write executable specifications. Those executable specifications test your app from the outside - like a black box. Cucumber is not meant to be used as a unit testing tool, where you test individual classes (such as TestNG and JUnit).


TestNG (and JUnit) are unit testing tools. They are great for testing individual classes, but not great for executable specifications that are readable (and writeable) by non-technical people.
  1. Does cucumber feature like priorities, grouping, dependencies etc
Sorry, I don't understand the question.

Aslak 

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Dinwiddie

unread,
Jul 9, 2014, 11:33:11 AM7/9/14
to cu...@googlegroups.com
Abhay,

On 7/9/14, 10:30 AM, Abhay Bharti wrote:
> I am using Cucumber for writing automated regression test cases. I have
> automation framework designed using Selenium+TestNG+Maven etc. I have
> been asked to make a new automaton framework using
> Selenium+Cucumber+Java. I am curious to know -
>
> 1. what is advantage of Cucumber over TestNG

You can implement your tests using the same language you use to discuss
them with the business.

> 2. Does cucumber feature like priorities, grouping, dependencies etc

You can group them using tags. I consider dependencies an anti-pattern,
no matter what the test runner. TestNG supports a lot of complicated
practices that can lead you astray.

- George

--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

Amir Mukeri

unread,
Jul 9, 2014, 1:48:23 PM7/9/14
to cu...@googlegroups.com
Hi Abhay,
Am curious to know why do you want to move existing regression tests in
TestNG to Cucmber, am assuming they are working fine? I believe you have
lot of code already developed for Selenium+TestNG...do you intend to
reuse it? How?

@Other,
Please also share your thoughts on this typical migration use case of
TestNG to Cucumber for legacy/regression tests.

Regards,
-Amir

David Kowis

unread,
Jul 9, 2014, 5:38:13 PM7/9/14
to cu...@googlegroups.com
On 07/09/2014 12:43 PM, Amir Mukeri wrote:
> Hi Abhay,
> Am curious to know why do you want to move existing regression tests in
> TestNG to Cucmber, am assuming they are working fine? I believe you have
> lot of code already developed for Selenium+TestNG...do you intend to
> reuse it? How?
>
> @Other,
> Please also share your thoughts on this typical migration use case of
> TestNG to Cucumber for legacy/regression tests.

I'd only do this if you need to improve communication around your
legacy/regression tests. It could be very valuable in determining if the
logic you're testing is even something you'd want to continue providing
as a feature.

Converting them for the sake of converting them, I'm not sure I'd do.
Cucumber adds the overhead of plain English (or other native language)
that is not code directly. This is great for communicating with
stakeholders and collaborating with them, not so great for just running
code.

--
David

Selenium Framework

unread,
Dec 29, 2014, 12:43:33 PM12/29/14
to cu...@googlegroups.com
I have been using TestNG+selenium+Maven for quite a while now , but it was in a Java (centric) project. In fact, we went ahead and built custom data structures that align with our application objects in page-objects or in test Data. The project has been doing well for quite many years and it is one happy "java" shop.

That said, since 2 years, I have been heavily invested in Ruby world and some start up projects. I cannot tell you how important and crucial was applying BDD (tdd/atdd) with Cucumber in projects where change is so constant that you have to get the change deployed extremely fast to production.
If you have a chance to use Cucumber in Ruby world, one is bound to fall in love with the overall experience (of course with Rubymine and general Ruby functional programming language). Yes it is a collaboration tool and it has a subset that addresses the testing part (feedback loop). After using Cucumber for a while and observing the "collaboration" between 3 amigos, we will NOT need as much time as we spend on Testing specifically in many projects.

All said, if we DO NOT want to add the complexity of more tools (Ruby, Rubymine...) over Maven/Gradle + Eclipse/IntelliJ + Junit/TestNG -- cucumber JVM is here too --- Yes we can now totally work with the same suite of Java tools.

There is not too much documentation  and help online (at this point) if you plan to use cucumber JVM +selenium java , so one would  have to dig through code examples. I wrote up one here for testing folks coming from Java background - http://www.seleniumframework.com/first-project/

D Tran

unread,
Nov 9, 2015, 1:11:41 PM11/9/15
to Cukes
Another key component for adopting CucumberJVM is that now you have executable documentation.  There is no longer the need to write manual test cases, maintaining the static content, and having a separate team that takes the manual test cases and automates.

kirubanand ramasamy

unread,
Nov 18, 2015, 7:27:29 AM11/18/15
to Cukes
hi please i need a help.... i need to run a junit test from windows command line?
Reply all
Reply to author
Forward
0 new messages