Setting Up Base Framework Class For Reusability
What is a Base Class?
A Base Test class holds common setup and teardown logic — like configuring the base URI or reading environment settings — that every other test class extends.
public class BaseTest {
@BeforeClass
public void setup() {
RestAssured.baseURI = ConfigReader.get("base_url");
}
}
public class UserApiTest extends BaseTest {
@Test
public void getUser() { ... }
}
Why This Matters
A shared base class eliminates repeated setup code across every test class, and makes global changes (like switching environments) a one-line update.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.
.png)