Ashish Anand has Published 213 Articles

How to Limiting the Number of Parallel Tests with ThreadCount in TestNG?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:48:45

162 Views

TestNG supports multi−threading i.e. a @Test methods can be invoked parallelly. A test or multiple test methods can be invoked from multiple threads. Therefore, multiVthread is useful if @Test methods need to be run asynchronously in parallel. Multi−threading can be achieved by using keyword − thread−count = at Testng.xml. Thread ... Read More

Junit vs TestNG vs Mockito

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:45:57

346 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 ... Read More

How to Invoke Junit Test Cases in TestNG?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:38:01

108 Views

TestNG can automatically recognize and run JUnit tests, so that you can use TestNG as a runner for all your existing tests and write new tests using TestNG. All you must do is to put JUnit library on the TestNG classpath, so it can find and use JUnit classes, change ... Read More

How to write a TestNG Listener that can List all Groups of a Test Method?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:36:03

86 Views

A TestNG class can have different tests like test1, test2, test3 etc. and these tests can be grouped based on different groups like unit, integration or both or any bug number. User may want to run the @Test method based on groups. And, it is always convenient to know which ... Read More

How to Write a TestNG Listener that can Fetch Name of Executing Test Method?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:23:48

103 Views

A TestNG class can have different tests like test1, test2, test3 etc. and these tests can be grouped based on different groups like unit, integration or both or any bug number. User may want to run the @Test method based on groups. And, it is always convenient to know which ... Read More

How to Stop Suite Execution after First Failure in TestNG?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:17:10

136 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, it skip remaining code of the @Test method and moves to the ... Read More

How to use Selenium with TestNG?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:08:30

110 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 ... Read More

What are Best Practices of Selenium Web Test Automation Framework?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:06:38

79 Views

The best practices for Selenium web test automation framework are listed below − Use of dynamic waits like implicit wait and explicit wait instead of using Thread.sleep() in the framework to handle sync issues in the application. Usage of Page Object Model framework design to segregate the test scripts ... Read More

How to do Selenium Testing on different Browsers using TestNG?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 11:04:57

173 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'. A website should be tested across multiple browsers like IE, Chrome, Firefox, Safari to validate the compatibility of website and functionality. ... Read More

How to Run a testng.xml File From Batch for a Maven Project?

Ashish Anand

Ashish Anand

Updated on 18-Aug-2023 10:58:43

845 Views

TestNG is a testing framework and can use Maven as build tool. It helps to maintain dependencies and their version at one place in pom.xml Maven provides flexibility to run using surefire plugin. If a user has multiple testng.xml files (please note one testng files contains only one test suite), ... Read More

Advertisements