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

Chapter 12. Unit and Functional Testing

In the previous chapter we learned about how to run existing tests of JUnit through TestNG and how to migrate from JUnit to TestNG. We also covered different points considered for migration and the changes that are required to be done as a part of the migration. In this chapter we will cover topics related to unit and functional testing using TestNG.

In this chapter we'll cover the following topics:

  • Unit testing with TestNG
  • Mocking and different mocking techniques
  • Mocking with TestNG
  • Functional testing
  • TestNG with Selenium

Unit testing with TestNG

Before we go ahead with unit testing with TestNG, let’s get a brief idea of what unit testing is. Unit testing refers to the practice/process of testing units, parts, ...

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