O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time test

While running tests there can be cases where certain tests get stuck or may take much more time than expected. In such a case you may need to mark the said test case as fail and then continue. TestNG allows user to configure a time period to wait for a test to completely execute. This can be configured in two ways:

  • At suite level: This will be applicable for all the tests in the said TestNG test suite
  • At each test method level: This will be applicable for the said test method and will override the time period if configured at the suite level

Let's go ahead and create a sample project to see how this feature works.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required