Here are multiple-choice questions (MCQs) focused on TestNG reports, which provide detailed information about test execution results, including passed, failed, and skipped tests.
1. What is the default report format generated by TestNG?
A) HTML
B) XML
C) PDF
D) CSV
Answer: A) HTML
2. Which TestNG listener is responsible for generating detailed HTML reports?
A) ITestListener
B) IReporter
C) IResultListener
D) IExecutionListener
Answer: B) IReporter
3. Where are the default TestNG reports saved after the execution of tests?
A) output/ directory
B) test-output/ directory
C) reports/ directory
D) results/ directory
Answer: B) test-output/ directory
4. Which of the following reports are automatically generated by TestNG after a test suite execution?
A) testng-results.xml
B) index.html
C) emailable-report.html
D) All of the above
Answer: D) All of the above
6. Which report provides a summary of the entire test suite execution in a single, readable format?
A) testng-results.xml
B) emailable-report.html
C) index.html
D) junitreports.xml
Answer: B) emailable-report.html
7. What is the purpose of the testng-failed.xml file generated by TestNG?
A) It lists all failed tests for re-execution
B) It contains logs of all skipped tests
C) It includes a summary of passed tests
D) It is used to rerun all passed tests
Answer: A) It lists all failed tests for re-execution
9. How can you view TestNG reports after test execution in Eclipse?
A) Right-click on the project > Refresh > Open test-output folder
B) Run View > TestNG > Results
C) Run File > Open > Reports
D) Use the command line to open HTML files
Answer: A) Right-click on the project > Refresh > Open test-output folder
10. Which listener would you use to create a report with additional details like screenshots in TestNG?
A) IConfigurationListener
B) ISuiteListener
C) ITestListener
D) IAnnotationTransformer
Answer: C) ITestListener
11. Which of the following tools can be used to enhance TestNG reporting?
A) TestNG HTML Report Plugin
B) Allure
C) ReportNG
D) Both B and C
Answer: D) Both B and C
15. How do you include custom information, like environment details, in the TestNG report?
A) By modifying testng.xml
B) By using ITestContext to add details in onStart() or onFinish() methods
C) By editing the test-output directory manually
D) By setting environment variables
Answer: B) By using ITestContext to add details in onStart() or onFinish() methods
No comments:
Post a Comment