Are there any advantages of using Testng with cucumber?

Viewed 7113

When creating automated tests with selenium, I thought one would use easier cucumber with selenium or testng with selenium or just junit with selenium although using only junit is not very popular. I have recently found out that you could use cucumber with testng but I don't see what is the gain of doing this. If someone is using both of them together can you tell me why ?

EDIT: Using Testng over junit has many advantages. My question is if i use cucumber does it still make a difference or not anymore.

P.S I am not trying to start this tool vs this tool war

3 Answers

Yes.. I understand your question. Even I had the same doubt as below: We use selenium for automation testing. Since they don't provide proper reports, we add TestNG to it (and also for other features). But now, we have cucumber, which gives proper reports. So why do we need TestNG?

I realized, though we get proper results with cucumber, TestNG provides us with many other features which cucumber cannot; like setting priority, setting method dependency, timeouts, grouping , etc.

Though cucumber provides a tag feature, it does not provide all the features provided by TestNG. Maybe when cucumber incorporates all those features, we can eliminate TestNG.

Related