TestNG:TestNG is a testing framework inspired from JUnit and NUnit, but introducing some new functionalities that make it more powerful and easier to use. TestNG is an open source automated testing framework; where NG means Next Generation.
Cucumber:Cucumber is a tool based on Behavior Driven Development (BDD) framework which is used to write acceptance tests for a web application. It allows automation of functional validation in easily readable and understandable format (like plain English) to Business Analysts, Developers, Testers, etc.
- Well, support page object model (POM) automation design.
- There is no more need for a static main method in our tests. The sequence of actions is regulated by easy-to-understand annotations that do not require methods to be static.
- Useful when you have to automate a large number of test case.
- It is pretty easy to write your own listeners (which act in runtime) and reporters (which are invoked after the execution).
- TestNG can generate reports based on our Selenium test results.
- WebDriver has no native mechanism for generating reports.
- Embeds BeanShell for further flexibility.
- Default JDK functions for runtime and logging (no dependencies).
- Dependent methods for application server testing.
- No need to create own Thread objects! Use of rich library of annotations and that is it!
- Support of Data Driven Testing
- each test class (and method) can belong to multiple groups,
- it is pretty easy to run only selected group:
- g. you can run only tests from groups "smoke", or only "gui" tests,
- it is possible to define dependencies between methods/groups (see next slide).
- all done with annotations (e.g. @Test(groups = "smoke"))
- Run threads using multiple threads for faster test execution
- Passing test parameters
- TestNG offers well-thought @Before… and @After… annotations (on suite, class, group and method level).
- Fail Fast: Means that the feedback will be much quicker in case of failed tests
- Logical dependencies: gives you a much more realistic error information - you learn that 1 tests has failed and 99 has been skipped, which is much easier to fix than the information about 100 failed tests
- Uncaught exceptions are automatically handled by TestNG without terminating the test prematurely. These exceptions are reported as failed steps in the report.
- TestNG documentation is in very good shape, and always up-to-date
- run tests with Maven, Ant, Gradle, …
- execute tests with your IDE: Eclipse, IntelliJ IDEA, …
- use Jenkins, Sonar, Cobertura, Mockito, FEST Fluent Assertions, Hamcrest, …
- enjoy Spring support for testing,
- Cucumber is a tool based on Behavior Driven Development (BDD) framework
- Tool for mainly acceptance testing
- Cucumber helps facilitate the discovery and use of a ubiquitous language within the team, by giving the two sides of the linguistic divide a place where they can meet.
- Cucumber tests interact directly with the developers’ code, but they’re written in a medium and language that business stakeholders can understand.
- Initially, Cucumber was implemented in Ruby and then extended to Java framework
- Cucumber generates its own HTML format.
- Cucumber is used to test the system rather than testing the particular piece of code
- Cucumber can be used along with Selenium, Watir, and Capybara
- Cucumber supports many other languages like Perl, PHP, Python, Net
- Feature File:
- Feature files are essential part of cucumber which is used to write test automation steps or acceptance tests
- This can be used as live document
- The steps are the application specification.
- All the feature files ends with .feature extension.
- This gives information about the high-level business functionality (Refer to the previous example) and the purpose of Application under test
- Everybody should be able to understand the intent of feature file by reading the first Feature step
- Basically, a scenario represents a particular functionality which is under test
- By seeing the scenario user should be able to understand the intent behind the scenario and what the test is all about
- Each scenario should follow given, when and then format. This language is called as “gherkin”.
- Scenario Outline:
- Scenario outlines are used when the same test has to be performed with different data set
- Cucumber by default runs all scenarios in all the feature files. In real time projects there could be hundreds of feature file which are not required to run at all times.
Cucumber vs TestNG: Which is better?
| || |
What Oditek offers
Refer our Skills page:
We had a tough deadline to launch our .Net based application that processes a lot of data, and got very frustrated with our development agency we hired. Fortunately we got Oditek, and they took over seamlessly the product development, launched the app & continued feature development. Just awesome!
They were very attentive to our needs as clients and went out of the way to make sure our projects were taken care of. They were always able to get projects done in the specifications we requested. They are passionate about getting things done; I would definitely recommend them to lead any IT projects.
OdiTek has been very impressive in delivering a C++ based network security product migration from Linux to Windows. Honestly, we didn’t expect the speed and competencies to get the migration project delivered absolutely on time as the existing product was complex. Technically team is very experienced.
I worked with OdiTek on few high profile banking application projects. They did a fantastic job with web applications & manual testing on the VAS apps for two leading banks of UK that included rigorous UAT phases. I recommend them for any application development where security matters.
OdiTek is our extended team who works on our key software projects. They are dependable, good in collaboration and technically very much to the level what we expect a global team should be. They had transformed our web applications, CRM and added mobility to existing business platforms here.
It's been more than 4 years now that we are working with OdiTek on our cloud based web product development. It's been amazing working together, they are very competent on designing scalable, high performance apps. Their technical support is outstanding to say the least, even at odd hours.
I am a fan of Team OdiTek since 2014 and have worked on many product development projects together. Specially worth mentioning their deliveries on VAS Banking web application development & manual testing services for Smarta, UK. They are highly skilled & a professional team to work with.
OdiTek has been working on our Integrated Web-scale Mobile Platform i.e. Optimal Health since 2014. They are very professional and takes care of the requirements meticulously. They are technically very sound and sincere in ensuring quality & performance. Wonderful working with them!
You can trust the team, with minimum supervision you get the work done. They are honest, professional & committed to schedule & quality. I had been successfully running 3 business applications designed, developed and maintained by Oditek developers. It’s been a pleasure working with them.
OdiTek has been working in custom software development, including services for test automation. Many of them have worked with me in 2009-10 when I was R&D Manager in NetHawk India. They have great enthusiasm & a passion to excel in bringing customer success. Their work has been very impressive.
It's amazing to see these guys are turning their experience into a global delivery excellence at OdiTek. I am sure their past large scale product development experience will be handy to product companies. I would always recommend Oditek for software development, especially performance-driven solutions.