- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 161 Articles for Rest Assured
159 Views
JUnit and TestNG are the most popular testing frameworks for Java applications. Both frameworks are easy to use. So, when it comes to choose the testing framework for your application, it’s better to have a high−level idea of what features are present in one or the other and then take the informed decision based on your project requirements. In this article, we will compare and contrast the different features of TestNG and JUnit. JUnit vs TestNG The following table compares JUnit vs TestNG on different features. The table excludes very specific or common features that are present in both these ... Read More
237 Views
Testing is the process of checking the functionality of an application to ensure it works as per requirements. Unit testing comes into picture at the developer level where adequate measures are taken to test every single entity (class or method) to ensure the final product meets the requirements. What is Cucumber? Cucumber is a testing tool that supports Behaviour Driven Development (BDD) framework. It defines application behaviour using simple English text, defined by a language called Gherkin. Cucumber allows automation functional validation that is easily read and understood. Cucumber was initially implemented in Ruby and then extended to Java framework. ... Read More
83 Views
TestNG is a powerful testing framework, an enhanced version of JUnit which was in use for a long time before TestNG came into existence. NG stands for 'Next Generation'. TestNG framework provides the following features − Annotations help us organize the tests easily. Flexible test configuration. Test cases can be grouped more easily. Parallelization of tests can be achieved using TestNG. Support for data−driven testing. Inbuilt reporting. Selenium Webdriver allows to interact with webpages. It is an interface not a testing framework. To run any test or code only in selenium we must use java main method. TestNG ... Read More
178 Views
TestNG supports to group the test cases based on similar functionality or uses. Sometimes user has customized conditions to pick classes/methods/groups at run time based on conditions and use cases. TestNG supports simple frequently use scenarios but covering all expects are unnecessary. For Example, user may add multiple groups to single test. While running the group using syntax, TestNG runs all tests those are part of the group. It works as OR statement. Like if a test has 2 groups and only 1 is mentioned in tag it will run the test. But, when user wants ... Read More
56 Views
TestNG allows to run the test suites from IntelliJ IDE as well as command line. When user run the testing.xml either from IDE or command line, TestNG generates a default report. It saves all reports and respective html files in Project −>test−output folder. If folder is not present, TestNG creates the folder. Enable the Report Generation While running the testing.xml from IDE, the user has to enable the default reports generation at Add Configuration −> Listeners tab. The following screenshot shows how to enable default report generation in IntelliJ. If the user wants to generate report at customized path ... Read More
462 Views
TestNG file is a simple java class. IntelliJ supports TestNG class as simple java class. To create a TestNG class, user should create a java class first and then enter the desired TestNG annotations and respective code to execute. In this article, let’s follow the steps to create a TestNG file in IntelliJ. Approach/Algorithm to solve this problem Step 1: Go to the project where TestNG file needs to create. Step 2: Select a folder where to create a TestNG file either in src or test folder. We will create the file in src folder in this article. Step ... Read More
911 Views
A TestNG class can have different tests like test1, test2, test3 etc. There could be some failure while running the test suite and user may get failures in between of @Test methods. Once a test method gets failed, he wants to continue the execution so all failures can be found out at the time. By default, if a failure occurs in a @Test method, TestNG gets exit from the same @Test method and continue the execution from next @Test method. Here, the use case is to continue the execution of next line even if an assertion failed in same @Test ... Read More
537 Views
A TestNG class can have different tests like test1, test2, test3 etc. There could be some failure while running the test suite and user may get failures in between of @Test methods. Once a test method gets failed, he wants to continue the execution so all failures can be found out at the time. By default, if a failure occurs in a @Test method, TestNG gets exit from the same @Test method and continue the execution from next @Test method. Here, the use case is to continue the execution of next line even if an assertion failed in same @Test ... Read More
142 Views
testng.xml has a format as where we define what all test classes should be executed. There is no any specific way to provide regular expression in a class in . But there are work arounds those are useful to run specific @Test from a class. TestNG supports regular expression at include, exclude and package tags. Following are few ways those are handy to use regular expression in a test class run from a test suite. Mention all class names inside . And, inside the class use and . It will exclude all tests starting with name ... Read More
3K+ Views
TestNG supports multi-threading, i.e., a @Test method can be invoked multiple times in parallel. A test method should be invoked from multiple threads so that multiple invocation is also required. If we want to run a single @Test at multi-thread, it is of no use. Therefore, multi-thread is useful if a @Test method needs to be run multiple times asynchronously.Multi-threading can be achieved by using the keyword threadPoolSize = at @Test. However, to invoke a method multiple times, another keyword invocationCount = is required. Combining these two keywords, we can achieve multi-threading. For example, @Test(threadPoolSize=5, invocationCount = 10)In this example, ... Read More