An Extent Report is a detailed and visually rich report generated after running Selenium tests. It helps testers see which tests passed, failed, or were skipped, along with logs and screenshots.
Click to reveal answer
beginner
How can you change the report title in Extent Reports?
You can customize the report title by using the config().setDocumentTitle("Your Title") method on the ExtentHtmlReporter object before attaching it to ExtentReports.
Click to reveal answer
intermediate
Which method is used to add system information like OS or tester name in Extent Reports?
Use extent.setSystemInfo("Key", "Value") to add system details such as OS, browser, or tester name to the report.
Click to reveal answer
intermediate
How do you change the theme of an Extent Report?
You can set the theme using config().setTheme(Theme.STANDARD) or config().setTheme(Theme.DARK) on the ExtentHtmlReporter object.
Click to reveal answer
beginner
What is the purpose of attaching an ExtentHtmlReporter to ExtentReports?
Attaching ExtentHtmlReporter to ExtentReports tells the framework where and how to generate the HTML report file with all test results and customizations.
Click to reveal answer
Which method sets the document title in Extent Reports?
AsetTitle()
Bconfig().setDocumentTitle()
CsetReportName()
DsetTheme()
✗ Incorrect
The method config().setDocumentTitle() sets the title of the HTML report document.
How do you add system information like 'OS' or 'Browser' to an Extent Report?
Aextent.setSystemInfo()
Bextent.addInfo()
Creport.addSystemDetails()
DhtmlReporter.setSystemInfo()
✗ Incorrect
The method extent.setSystemInfo() adds key-value pairs of system info to the report.
Which theme options are available by default in Extent Reports?
AStandard and Dark
BBlue and Red
CClassic and Modern
DLight and Dark
✗ Incorrect
Extent Reports supports Theme.STANDARD (light) and Theme.DARK by default.
What is the role of ExtentHtmlReporter in Extent Reports?
AIt logs test steps
BIt runs the Selenium tests
CIt generates the HTML report file
DIt manages test data
✗ Incorrect
ExtentHtmlReporter handles the creation and customization of the HTML report.
To customize the report name shown on the report page, which method is used?
AsetSystemInfo()
BsetDocumentTitle()
CsetTheme()
Dconfig().setReportName()
✗ Incorrect
config().setReportName() changes the visible report name on the page header.
Explain how to customize the title, theme, and system info in an Extent Report.
Think about the ExtentHtmlReporter and ExtentReports objects and their configuration methods.
You got /3 concepts.
Describe the steps to attach an ExtentHtmlReporter to ExtentReports and generate a customized report.
Focus on the order of creating reporter, configuring, attaching, and flushing.
You got /5 concepts.
Practice
(1/5)
1. What is the main purpose of customizing an Extent report in Selenium Java?
easy
A. To make test results clearer and easier to understand
B. To increase the speed of test execution
C. To reduce the size of the test scripts
D. To automatically fix test failures
Solution
Step 1: Understand Extent report role
Extent reports show test results in a readable format.
Step 2: Identify customization benefits
Customization helps make these results clearer and more useful.
Final Answer:
To make test results clearer and easier to understand -> Option A
2. Which code snippet correctly sets the theme of an Extent report to DARK in Selenium Java?
easy
A. extentHtmlReporter.config().setTheme(Theme.DARK);
B. extentHtmlReporter.setTheme("dark");
C. extentHtmlReporter.config().theme = "dark";
D. extentHtmlReporter.setConfigTheme(Theme.DARK);
Solution
Step 1: Recall ExtentReports theme setting syntax
Use config() method and setTheme with Theme enum.
Step 2: Match correct method and enum usage
Only extentHtmlReporter.config().setTheme(Theme.DARK); uses config().setTheme(Theme.DARK) correctly.
Final Answer:
extentHtmlReporter.config().setTheme(Theme.DARK); -> Option A
Quick Check:
Use config().setTheme(Theme.DARK) [OK]
Hint: Remember: config() then setTheme with Theme enum [OK]
Common Mistakes:
Using setTheme directly without config()
Passing theme as string instead of Theme enum
Using incorrect method names
3. Given the following code snippet, what will be the title of the generated Extent report?
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("testReport.html");
htmlReporter.config().setDocumentTitle("My Test Report");
ExtentReports extent = new ExtentReports();
extent.attachReporter(htmlReporter);
medium
A. Extent Report
B. testReport.html
C. My Test Report
D. Default Title
Solution
Step 1: Identify method setting report title
config().setDocumentTitle("My Test Report") sets the HTML page title.
Step 2: Understand effect on report
The report's browser tab will show "My Test Report" as title.
Final Answer:
My Test Report -> Option C
Quick Check:
setDocumentTitle sets report title [OK]
Hint: Look for setDocumentTitle method for report title [OK]
Common Mistakes:
Confusing file name with report title
Assuming default title is used
Ignoring config() method effects
4. Identify the error in the following code that prevents the Extent report from saving properly:
ExtentHtmlReporter reporter = new ExtentHtmlReporter("report.html");
ExtentReports extent = new ExtentReports();
extent.attachReporter(reporter);
// Missing flush call
medium
A. ExtentHtmlReporter should be initialized after ExtentReports
B. Incorrect file name extension, should be .txt
C. attachReporter method is deprecated and should not be used
D. Missing call to extent.flush() to save the report
Solution
Step 1: Check report saving process
Extent report requires extent.flush() to write data to file.
Step 2: Identify missing flush call
The code does not call extent.flush(), so report is not saved.
Final Answer:
Missing call to extent.flush() to save the report -> Option D
Quick Check:
Always call extent.flush() to save report [OK]
Hint: Remember to call extent.flush() after tests [OK]
Common Mistakes:
Forgetting to call flush()
Changing file extension incorrectly
Misunderstanding attachReporter usage
5. You want to add system information like OS and Java version to your Extent report. Which code snippet correctly adds this info before flushing the report?
ExtentReports extent = new ExtentReports();
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("sysInfoReport.html");
extent.attachReporter(htmlReporter);
// Add system info here
extent.flush();
hard
A. htmlReporter.setSystemInfo("OS", System.getProperty("os.name"));
htmlReporter.setSystemInfo("Java Version", System.getProperty("java.version"));
B. extent.addSystemInfo("OS", System.getProperty("os.name"));
extent.addSystemInfo("Java Version", System.getProperty("java.version"));
C. extent.setSystemInfo("OS", System.getProperty("os.name"));
extent.setSystemInfo("Java Version", System.getProperty("java.version"));
D. htmlReporter.addSystemInfo("OS", System.getProperty("os.name"));
htmlReporter.addSystemInfo("Java Version", System.getProperty("java.version"));
Solution
Step 1: Identify correct method to add system info
ExtentReports class has addSystemInfo method to add info.
Step 2: Confirm usage on ExtentReports instance
System info is added on extent, not on htmlReporter.
Final Answer:
extent.addSystemInfo("OS", System.getProperty("os.name"));
extent.addSystemInfo("Java Version", System.getProperty("java.version")); -> Option B
Quick Check:
Use extent.addSystemInfo() before flush [OK]
Hint: Add system info on extent, not htmlReporter [OK]
Common Mistakes:
Calling setSystemInfo on htmlReporter instead of extent
Using setSystemInfo which does not exist
Adding system info after flush()
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.