A Fragment is an essential component of building the modern UI of an Android application. Every Fragment should be attached to an Activity that complicates the testing of Fragment in isolation. In this article, we will talk about how to test Fragments in isolation.