Q1.What is TestNG?
TestNG is a Java testing framework inspired by JUnit but designed for a wider range of test categories — unit, integration, end-to-end, and functional. It's the default runner for enterprise Selenium suites in 2026.
28 real TestNG interview questions with senior-SDET answers and Java code — annotations, execution order, DataProvider, groups & priority, parallel runs, listeners, retry analyzers, and testng.xml suites.
TestNG is a Java testing framework inspired by JUnit but designed for a wider range of test categories — unit, integration, end-to-end, and functional. It's the default runner for enterprise Selenium suites in 2026.
The suite configuration file. Defines which classes/methods run, in which order, parallel mode, groups, and parameters.
<suite name="Regression" parallel="tests" thread-count="4">
<test name="Chrome">
<parameter name="browser" value="chrome"/>
<classes><class name="tests.LoginTest"/></classes>
</test>
</suite>If you can confidently answer the TestNG Basics questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
If you can confidently answer the Annotations & Lifecycle questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
If you can confidently answer the Groups, Priority & Dependencies questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
If you can confidently answer the DataProvider & Parameterization questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
- run: mvn -B test -DsuiteXmlFile=testng.xml
- uses: actions/upload-artifact@v4
if: always()
with: { name: reports, path: test-output/ }If you can confidently answer the Parallel, Listeners & XML questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
Behavioral, framework, coding — full interview prep.
Get 1000+ more with detailed model answers in our QA Interview Preparation Kit. Covers manual testing, automation, API, SQL, Selenium, Playwright, and framework concepts — everything asked in real QA interviews.
Get Interview Kit — ₹1,045Live, indexable TestNG openings — updated daily in Jobs Radar.
Loading current openings…