0
0
Selenium Javatesting~15 mins

Extent report customization in Selenium Java - Deep Dive

Choose your learning style9 modes available
Overview - Extent report customization
What is it?
Extent report customization means changing how the test report looks and what information it shows. It helps testers create reports that are easier to read and understand. You can add colors, logos, and extra details about tests. This makes it simple to see which tests passed or failed and why.
Why it matters
Without customizing reports, test results can be hard to read and understand quickly. This slows down fixing problems and sharing results with others. Custom reports help teams spot issues faster and communicate clearly. They make testing more effective and save time in real projects.
Where it fits
Before learning this, you should know how to write basic Selenium tests and generate simple Extent reports. After this, you can learn advanced reporting tools or integrate reports with continuous integration systems like Jenkins.
Mental Model
Core Idea
Customizing Extent reports tailors test results presentation to make test outcomes clearer and more useful for everyone.
Think of it like...
It's like decorating a photo album: you choose the cover, add captions, and arrange photos so your story is easy and fun to follow.
┌─────────────────────────────┐
│       Extent Report         │
├─────────────┬───────────────┤
│ Raw Test    │ Customization │
│ Results     │ Options       │
│ (Pass/Fail) │ - Colors      │
│             │ - Logos       │
│             │ - Extra Info  │
└─────────────┴───────────────┘
Build-Up - 7 Steps
1
FoundationBasics of Extent Reports Setup
🤔
Concept: Learn how to create a simple Extent report in Selenium with Java.
To start, add ExtentReports library to your project. Then create an ExtentReports object and an ExtentTest object for each test. Log test steps and results. Finally, flush the report to write it to a file. Example: ExtentReports extent = new ExtentReports(); ExtentTest test = extent.createTest("My Test"); test.pass("Step passed"); extent.flush();
Result
A basic HTML report file is created showing test names and pass/fail status.
Understanding the basic setup is essential before adding any customization.
2
FoundationUnderstanding Report Structure
🤔
Concept: Know the parts of an Extent report you can customize: title, theme, system info, and test logs.
An Extent report has a header (title and logo), a summary (pass/fail counts), system info (environment details), and detailed test logs. Each part can be changed to fit your needs.
Result
You can identify where to apply changes to make reports clearer and more informative.
Knowing the report's anatomy helps target your customization effectively.
3
IntermediateChanging Report Title and Theme
🤔Before reading on: do you think changing the report title requires editing the HTML file manually or can it be done via code? Commit to your answer.
Concept: Learn how to set a custom report title and choose a theme (dark or standard) programmatically.
Use ExtentSparkReporter to set the report file path, then call methods to set the document title and theme. Example: ExtentSparkReporter spark = new ExtentSparkReporter("report.html"); spark.config().setDocumentTitle("My Test Report"); spark.config().setTheme(Theme.DARK); ExtentReports extent = new ExtentReports(); extent.attachReporter(spark);
Result
The generated report shows the new title and uses the dark color theme.
Knowing you can customize appearance via code saves time and avoids manual edits.
4
IntermediateAdding System and Environment Info
🤔Before reading on: do you think system info is added automatically or must be set explicitly in code? Commit to your answer.
Concept: Add details like OS, browser, and tester name to the report for better context.
Use extent.setSystemInfo(key, value) to add environment details. Example: extent.setSystemInfo("OS", "Windows 10"); extent.setSystemInfo("Browser", "Chrome 114"); extent.setSystemInfo("Tester", "Alice");
Result
The report displays these details in a dedicated section, helping readers understand test conditions.
Explicitly adding system info makes reports more useful for debugging and audits.
5
IntermediateEmbedding Screenshots in Reports
🤔Before reading on: do you think screenshots are added automatically on failure or require manual code? Commit to your answer.
Concept: Learn how to capture and attach screenshots to test steps in the report.
Capture screenshots using Selenium's TakesScreenshot interface. Save the image file and add it to the report with test.addScreenCaptureFromPath(path). Example: File src = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); String path = "screenshots/img.png"; FileUtils.copyFile(src, new File(path)); test.fail("Step failed", MediaEntityBuilder.createScreenCaptureFromPath(path).build());
Result
Failed test steps show screenshots in the report, making issues easier to understand.
Attaching screenshots visually explains failures, speeding up troubleshooting.
6
AdvancedCustomizing Logs and Categories
🤔Before reading on: do you think test categories and custom logs are set automatically or require explicit code? Commit to your answer.
Concept: Add categories (like 'Smoke' or 'Regression') and custom log messages to organize and clarify tests.
Use test.assignCategory("Smoke") to tag tests. Use test.log(Status.INFO, "message") to add detailed logs. Example: test.assignCategory("Regression"); test.log(Status.INFO, "Starting login test");
Result
Reports group tests by category and show detailed logs for each step.
Organizing tests by category helps filter and focus on relevant tests in large suites.
7
ExpertAdvanced Report Customization with CSS and JS
🤔Before reading on: do you think Extent reports allow injecting custom CSS/JS for styling and behavior? Commit to your answer.
Concept: Learn how to add your own CSS and JavaScript to Extent reports to change styles and add interactive features.
You can modify the ExtentSparkReporter configuration to include custom CSS or JS files by extending the reporter or post-processing the HTML file. This allows changing fonts, colors beyond themes, or adding dynamic filters. Example approach: After report generation, inject CSS styles or JS scripts into the HTML file to customize appearance and behavior.
Result
Reports can have unique branding, interactive filters, or animations beyond default options.
Knowing how to extend reports with CSS/JS unlocks full control over report presentation and user experience.
Under the Hood
ExtentReports works by collecting test logs and metadata during test execution. It stores this data in memory and then writes it to an HTML file using ExtentSparkReporter. The reporter uses templates and configuration settings to format the report with HTML, CSS, and JavaScript. Customization changes these templates or adds extra data before writing the file.
Why designed this way?
The design separates test logging from report generation to keep tests simple and flexible. Using HTML allows reports to be viewed in any browser without extra tools. The modular reporter design lets users customize appearance without changing core logic. This approach balances ease of use with powerful customization.
┌───────────────┐       ┌─────────────────────┐
│ Test Code     │       │ ExtentReports API   │
│ (Selenium)   ───────▶│ Collect Logs & Info  │
└───────────────┘       └─────────┬───────────┘
                                    │
                                    ▼
                         ┌─────────────────────┐
                         │ ExtentSparkReporter │
                         │ Format & Write HTML │
                         └─────────┬───────────┘
                                   │
                                   ▼
                          ┌───────────────────┐
                          │ Final HTML Report │
                          └───────────────────┘
Myth Busters - 4 Common Misconceptions
Quick: Do you think Extent reports automatically capture screenshots on test failure without extra code? Commit to yes or no.
Common Belief:Extent reports automatically capture and attach screenshots when a test fails.
Tap to reveal reality
Reality:You must write code to capture screenshots and attach them to the report manually.
Why it matters:Assuming automatic screenshots leads to missing visual evidence in reports, making debugging harder.
Quick: Do you think changing the report theme affects test results or only appearance? Commit to your answer.
Common Belief:Changing the report theme can affect how tests run or their results.
Tap to reveal reality
Reality:Themes only change the report's look; they do not affect test execution or outcomes.
Why it matters:Confusing appearance with test logic can cause wasted effort troubleshooting non-issues.
Quick: Do you think system info like OS and browser is added automatically to Extent reports? Commit yes or no.
Common Belief:System and environment info is automatically included in Extent reports without extra code.
Tap to reveal reality
Reality:You must explicitly add system info using setSystemInfo calls in your test code.
Why it matters:Missing environment details can cause confusion when tests behave differently on various setups.
Quick: Do you think you can fully customize Extent reports by only changing Java code without touching HTML or CSS? Commit your answer.
Common Belief:All report customization can be done purely through Java code APIs.
Tap to reveal reality
Reality:Some advanced customizations require editing or injecting CSS/JS into the generated HTML report.
Why it matters:Expecting full control via code alone limits report design and misses powerful customization options.
Expert Zone
1
Custom categories can be combined with test metadata to create dynamic filters in reports, improving navigation in large test suites.
2
Using ExtentReports in parallel test execution requires thread-safe handling of ExtentTest objects to avoid log mix-ups.
3
Post-processing the generated HTML report with scripts allows adding features like auto-refresh or custom analytics not supported natively.
When NOT to use
Extent report customization is less suitable when tests run in highly restricted environments without file system access or when real-time reporting is needed. In such cases, consider using cloud-based reporting tools or continuous integration dashboards that update live.
Production Patterns
In real projects, teams integrate Extent reports with Jenkins pipelines to archive reports and send email notifications. They use custom themes and logos for branding and attach screenshots on failures. Categories help run subsets of tests like smoke or regression. Advanced users inject JavaScript to add interactive filters and export options.
Connections
Continuous Integration (CI) Pipelines
Builds-on
Knowing how to customize Extent reports helps integrate clear test results into CI pipelines, improving automated quality feedback.
User Interface (UI) Design
Similar pattern
Customizing report themes and layouts shares principles with UI design, like color contrast and information hierarchy, enhancing report readability.
Data Visualization
Builds-on
Understanding how to present test data visually in reports connects to data visualization concepts, helping communicate complex results simply.
Common Pitfalls
#1Assuming screenshots attach automatically on failure.
Wrong approach:test.fail("Test failed");
Correct approach:test.fail("Test failed", MediaEntityBuilder.createScreenCaptureFromPath("path/to/screenshot.png").build());
Root cause:Misunderstanding that screenshot capture and attachment require explicit code.
#2Setting report title by editing the HTML file after generation.
Wrong approach:Manually opening report.html and changing tag in a text editor.</span></div><div class="dlm-pitfall-right"><span class="dlm-pitfall-label"><span class="new-material-symbols icon-hw-20"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span>Correct approach:</span><span>spark.config().setDocumentTitle("Custom Title");</span></div><div class="dlm-pitfall-root"><span class="dlm-pitfall-label"><span class="new-material-symbols icon-hw-20"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#3B82F6"><path d="M400-320q100 0 170-70t70-170q0-100-70-170t-170-70q-100 0-170 70t-70 170q0 100 70 170t170 70Zm-28.5-131.5Q360-463 360-480v-200q0-17 11.5-28.5T400-720q17 0 28.5 11.5T440-680v200q0 17-11.5 28.5T400-440q-17 0-28.5-11.5Zm-140 0Q220-463 220-480v-120q0-17 11.5-28.5T260-640q17 0 28.5 11.5T300-600v120q0 17-11.5 28.5T260-440q-17 0-28.5-11.5Zm280 0Q500-463 500-480v-80q0-17 11.5-28.5T540-600q17 0 28.5 11.5T580-560v80q0 17-11.5 28.5T540-440q-17 0-28.5-11.5ZM400-240q-134 0-227-93T80-560q0-134 93-227t227-93q134 0 227 93t93 227q0 56-17.5 106T653-363l199 199q11 11 11 28t-11 28q-11 11-28 11t-28-11L597-307q-41 32-91 49.5T400-240Z"></path></svg></span>Root cause:</span><span>Not knowing ExtentSparkReporter provides API for title customization.</span></div></div></div><div class="dlm-pitfall-item"><div class="dlm-pitfall-header"><span class="dlm-pitfall-number">#<!-- -->3</span><span class="dlm-pitfall-title">Not calling extent.flush() at the end of tests.</span></div><div class="dlm-pitfall-body"><div class="dlm-pitfall-wrong"><span class="dlm-pitfall-label"><span class="new-material-symbols icon-hw-20"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#EF4444"><path d="m480-433.33 124.67 124.66Q614.33-299 628-299q13.67 0 23.33-9.67Q661-318.33 661-332q0-13.67-9.67-23.33L526.67-480l124.66-124.67Q661-614.33 661-628q0-13.67-9.67-23.33Q641.67-661 628-661q-13.67 0-23.33 9.67L480-526.67 355.33-651.33Q345.67-661 332-661q-13.67 0-23.33 9.67Q299-641.67 299-628q0 13.67 9.67 23.33L433.33-480 308.67-355.33Q299-345.67 299-332q0 13.67 9.67 23.33Q318.33-299 332-299q13.67 0 23.33-9.67L480-433.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span>Wrong approach:</span><span>Creating tests and logging but forgetting extent.flush();</span></div><div class="dlm-pitfall-right"><span class="dlm-pitfall-label"><span class="new-material-symbols icon-hw-20"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span>Correct approach:</span><span>Calling extent.flush(); after all tests to write the report file.</span></div><div class="dlm-pitfall-root"><span class="dlm-pitfall-label"><span class="new-material-symbols icon-hw-20"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#3B82F6"><path d="M400-320q100 0 170-70t70-170q0-100-70-170t-170-70q-100 0-170 70t-70 170q0 100 70 170t170 70Zm-28.5-131.5Q360-463 360-480v-200q0-17 11.5-28.5T400-720q17 0 28.5 11.5T440-680v200q0 17-11.5 28.5T400-440q-17 0-28.5-11.5Zm-140 0Q220-463 220-480v-120q0-17 11.5-28.5T260-640q17 0 28.5 11.5T300-600v120q0 17-11.5 28.5T260-440q-17 0-28.5-11.5Zm280 0Q500-463 500-480v-80q0-17 11.5-28.5T540-600q17 0 28.5 11.5T580-560v80q0 17-11.5 28.5T540-440q-17 0-28.5-11.5ZM400-240q-134 0-227-93T80-560q0-134 93-227t227-93q134 0 227 93t93 227q0 56-17.5 106T653-363l199 199q11 11 11 28t-11 28q-11 11-28 11t-28-11L597-307q-41 32-91 49.5T400-240Z"></path></svg></span>Root cause:</span><span>Missing the step that finalizes and saves the report.</span></div></div></div></div></div></article><article class="content-card dlm-card"><div class="code-articles-card-header"><span class="card-icon summary"><span class="new-material-symbols icon-hw-24"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="M186.67-120q-27.5 0-47.09-19.58Q120-159.17 120-186.67v-586.66q0-27.5 19.58-47.09Q159.17-840 186.67-840h192.66q7.67-35.33 35.84-57.67Q443.33-920 480-920t64.83 22.33Q573-875.33 580.67-840h192.66q27.5 0 47.09 19.58Q840-800.83 840-773.33v586.66q0 27.5-19.58 47.09Q800.83-120 773.33-120H186.67Zm0-66.67h586.66v-586.66H186.67v586.66ZM313.33-280H522q14.17 0 23.75-9.62 9.58-9.61 9.58-23.83 0-14.22-9.58-23.72-9.58-9.5-23.75-9.5H313.33q-14.16 0-23.75 9.62-9.58 9.62-9.58 23.83 0 14.22 9.58 23.72 9.59 9.5 23.75 9.5Zm0-166.67h333.34q14.16 0 23.75-9.61 9.58-9.62 9.58-23.84 0-14.21-9.58-23.71-9.59-9.5-23.75-9.5H313.33q-14.16 0-23.75 9.61-9.58 9.62-9.58 23.84 0 14.21 9.58 23.71 9.59 9.5 23.75 9.5Zm0-166.66h333.34q14.16 0 23.75-9.62 9.58-9.62 9.58-23.83 0-14.22-9.58-23.72-9.59-9.5-23.75-9.5H313.33q-14.16 0-23.75 9.62-9.58 9.61-9.58 23.83 0 14.22 9.58 23.72 9.59 9.5 23.75 9.5ZM503.5-804.5q9.83-9.83 9.83-23.5t-9.83-23.5q-9.83-9.83-23.5-9.83t-23.5 9.83q-9.83 9.83-9.83 23.5t9.83 23.5q9.83 9.83 23.5 9.83t23.5-9.83ZM186.67-186.67v-586.66 586.66Z"></path></svg></span></span><span class="codefly-card-title">Key Takeaways</span></div><div class="code-articles-card-body"><div class="summary-list"><div class="summary-item"><span class="new-material-symbols icon-hw-26"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span><span class="summary-text">Extent report customization makes test results clearer and easier to understand for all stakeholders.</span></div><div class="summary-item"><span class="new-material-symbols icon-hw-26"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span><span class="summary-text">You can change report titles, themes, add system info, categories, and screenshots through simple Java APIs.</span></div><div class="summary-item"><span class="new-material-symbols icon-hw-26"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span><span class="summary-text">Advanced customization may require injecting CSS or JavaScript into the generated HTML report.</span></div><div class="summary-item"><span class="new-material-symbols icon-hw-26"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span><span class="summary-text">Misunderstandings about automatic features like screenshots or system info can cause incomplete reports.</span></div><div class="summary-item"><span class="new-material-symbols icon-hw-26"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#10B981"><path d="m422-395.33-94-94q-9.67-9.67-24-9.67t-24.67 10.33q-9.66 9.67-9.66 24 0 14.34 9.66 24l119.34 120q10 10 23.33 10 13.33 0 23.33-10L680-555.33q10.33-10.34 10.33-24.67 0-14.33-10.33-24.67-10.33-9.66-25-9.33-14.67.33-24.33 10L422-395.33ZM480-80q-82.33 0-155.33-31.5-73-31.5-127.34-85.83Q143-251.67 111.5-324.67T80-480q0-83 31.5-156t85.83-127q54.34-54 127.34-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82.33-31.5 155.33-31.5 73-85.5 127.34Q709-143 636-111.5T480-80Z"></path></svg></span><span class="summary-text">Integrating customized reports into CI pipelines and using categories improves test management in real projects.</span></div></div></div></article></div></div></main><div style="position:fixed;bottom:24px;right:24px;z-index:50"><button style="background:rgba(255,255,255,0.95);border:1px solid rgba(108,99,255,0.18);border-radius:10px;padding:10px 16px;color:#5f56fe;font-size:14px;cursor:pointer;display:flex;align-items:center;gap:7px;backdrop-filter:blur(12px);box-shadow:0 2px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(108,99,255,0.06);transition:all 0.2s"><span style="font-size:14px">⚑</span>Report Issue</button></div></div> <script src="/_next/static/chunks/webpack-fd24bd8e19d2841a.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/b133bdac07c7940e.css\",\"style\"]\n2:HL[\"/_next/static/css/837a603cb1a59856.css\",\"style\"]\n3:HL[\"/_next/static/css/725c7861d1898ba8.css\",\"style\"]\n4:HL[\"/_next/static/css/caf3ca742c7945f9.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"5:I[95751,[],\"\"]\n8:I[39275,[],\"\"]\ne:I[61343,[],\"\"]\nf:I[84080,[\"8726\",\"static/chunks/8726-583188341cbc1496.js\",\"3185\",\"static/chunks/app/layout-7a1373330f6a4c98.js\"],\"\"]\n10:I[88726,[\"8726\",\"static/chunks/8726-583188341cbc1496.js\",\"3185\",\"static/chunks/app/layout-7a1373330f6a4c98.js\"],\"Toaster\"]\n11:I[20154,[\"8422\",\"static/chunks/66ec4792-a0fc378024be0c7b.js\",\"6648\",\"static/chunks/6648-fff0cf0e0a1f8d25.js\",\"9160\",\"static/chunks/app/not-found-c4181ddc3e64e5f3.js\"],\"default\"]\n12:I[70548,[\"8726\",\"static/chunks/8726-583188341cbc1496.js\",\"3185\",\"static/chunks/app/layout-7a1373330f6a4c98.js\"],\"default\"]\n14:I[76130,[],\"\"]\n9:[\"lang\",\"en\",\"d\"]\na:[\"subject\",\"selenium-java\",\"d\"]\nb:[\"part\",\"part-3\",\"d\"]\nc:[\"pattern\",\"selenium-java-extent-report-customization\",\"d\"]\nd:[\"mode\",\"deep\",\"oc\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b133bdac07c7940e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L5\",null,{\"buildId\":\"hN8t5By7h5nzsrdSose07\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/en/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/deep\",\"initialTree\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"selenium-java\",\"d\"],{\"children\":[[\"part\",\"part-3\",\"d\"],{\"children\":[[\"pattern\",\"selenium-java-extent-report-customization\",\"d\"],{\"children\":[[\"mode\",\"deep\",\"oc\"],{\"children\":[\"__PAGE__\",{}]}]}]}]}]}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"selenium-java\",\"d\"],{\"children\":[[\"part\",\"part-3\",\"d\"],{\"children\":[[\"pattern\",\"selenium-java-extent-report-customization\",\"d\"],{\"children\":[[\"mode\",\"deep\",\"oc\"],{\"children\":[\"__PAGE__\",{},[[\"$L6\",\"$L7\"],null],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\",\"$b\",\"children\",\"$c\",\"children\",\"$d\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/837a603cb1a59856.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/725c7861d1898ba8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/caf3ca742c7945f9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\",\"$b\",\"children\",\"$c\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\",\"$b\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#5f56fe\"}],[\"$\",\"meta\",null,{\"name\":\"msapplication-TileColor\",\"content\":\"#5f56fe\"}],[\"$\",\"$Lf\",null,{\"src\":\"https://www.googletagmanager.com/gtag/js?id=G-N2NY2DMMDW\",\"strategy\":\"afterInteractive\"}],[\"$\",\"$Lf\",null,{\"id\":\"google-analytics\",\"strategy\":\"afterInteractive\",\"children\":\"\\n window.dataLayer = window.dataLayer || [];\\n function gtag(){dataLayer.push(arguments);}\\n gtag('js', new Date());\\n gtag('config', 'G-N2NY2DMMDW', {\\n page_path: window.location.pathname,\\n });\\n \"}],[\"$\",\"script\",null,{\"async\":true,\"src\":\"https://www.googletagmanager.com/gtag/js?id=AW-17928224938\"}],[\"$\",\"$Lf\",null,{\"children\":\"\\n window.dataLayer = window.dataLayer || [];\\n function gtag() {\\n dataLayer.push(arguments);\\n }\\n gtag('js', new Date());\\n gtag('config', 'AW-17928224938');\\n \"}],[\"$\",\"script\",null,{\"data-grow-initializer\":\"\",\"suppressHydrationWarning\":true,\"dangerouslySetInnerHTML\":{\"__html\":\"!(function(){window.growMe||((window.growMe=function(e){window.growMe._.push(e);}),(window.growMe._=[]));var e=document.createElement(\\\"script\\\");(e.type=\\\"text/javascript\\\"),(e.src=\\\"https://faves.grow.me/main.js\\\"),(e.defer=!0),e.setAttribute(\\\"data-grow-faves-site-id\\\",\\\"U2l0ZTo0MGIxZDBlZC0wNzdlLTQ0NjgtOThmOC1kNDYyZGMwM2IwMWY=\\\");var t=document.getElementsByTagName(\\\"script\\\")[0];t.parentNode.insertBefore(e,t);})();\"}}],[\"$\",\"$Lf\",null,{\"src\":\"//scripts.scriptwrapper.com/tags/40b1d0ed-077e-4468-98f8-d462dc03b01f.js\",\"strategy\":\"afterInteractive\",\"data-noptimize\":\"1\",\"data-cfasync\":\"false\"}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"suppressHydrationWarning\":true,\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"WebApplication\\\",\\\"name\\\":\\\"Leyaa.ai\\\",\\\"description\\\":\\\"Leyaa.ai builds learning intelligence that understands how you learn - guiding what to study, how to practice, and when to move forward.\\\",\\\"url\\\":\\\"https://leyaa.ai\\\",\\\"applicationCategory\\\":\\\"EducationalApplication\\\",\\\"operatingSystem\\\":\\\"Web\\\",\\\"offers\\\":{\\\"@type\\\":\\\"Offer\\\",\\\"price\\\":\\\"0\\\",\\\"priceCurrency\\\":\\\"USD\\\"},\\\"creator\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"Leyaa.ai\\\"}}\"}}],[\"$\",\"link\",null,{\"href\":\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css\",\"rel\":\"stylesheet\",\"integrity\":\"sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"$Lf\",null,{\"id\":\"clarity-script\",\"strategy\":\"afterInteractive\",\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function(c,l,a,r,i,t,y){\\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\\n t=l.createElement(r);t.async=1;t.src=\\\"https://www.clarity.ms/tag/\\\"+i;\\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\\n })(window, document, \\\"clarity\\\", \\\"script\\\", \\\"w4gxh6rdmh\\\");\\n \"}}]]}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L10\",null,{\"containerStyle\":{\"top\":70}}],[\"$\",\"div\",null,{\"className\":\"bg-grid\"}],[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[\"$\",\"$L11\",null,{}],\"notFoundStyles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/250d3fff07338fa3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],\"styles\":null}],[\"$\",\"$L12\",null,{}],\" \"]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]]\n"])</script><script>self.__next_f.push([1,"17:I[51766,[\"8422\",\"static/chunks/66ec4792-a0fc378024be0c7b.js\",\"522\",\"static/chunks/94730671-fd9628eddbd5107b.js\",\"7240\",\"static/chunks/53c13509-506edbde2b5b3f55.js\",\"7699\",\"static/chunks/8e1d74a4-a085c2fbc868135a.js\",\"5706\",\"static/chunks/9c4e2130-11ecd4bfc78e4568.js\",\"1779\",\"static/chunks/0e762574-6b3bda54d2fd2e14.js\",\"6648\",\"static/chunks/6648-fff0cf0e0a1f8d25.js\",\"3463\",\"static/chunks/3463-09ee572e3d7819a2.js\",\"4889\",\"static/chunks/4889-956a916919971629.js\",\"9985\",\"static/chunks/9985-b39235669d2563e2.js\",\"7627\",\"static/chunks/7627-224bb765a4decf1d.js\",\"7652\",\"static/chunks/7652-412e201fe52797ee.js\",\"8935\",\"static/chunks/8935-c1c159349bf7da40.js\",\"9663\",\"static/chunks/9663-fdcd080af3916e3e.js\",\"7029\",\"static/chunks/app/%5Blang%5D/codefly/learn/%5Bsubject%5D/%5Bpart%5D/%5Bpattern%5D/%5B%5B...mode%5D%5D/page-1fc9c577a9450e06.js\"],\"default\"]\n16:T423,{\"@context\":\"https://schema.org\",\"@type\":\"LearningResource\",\"name\":\"Extent report customization in Selenium Java - Deep Dive\",\"description\":\"Go deep on Extent report customization in Selenium Java. Internals, mental models, under-the-hood mechanics, misconceptions, common pitfalls, and production patterns. For serious learners.\",\"url\":\"https://leyaa.ai/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization\",\"learningResourceType\":\"Tutorial\",\"programmingLanguage\":\"Selenium Java\",\"inLanguage\":\"en\",\"isAccessibleForFree\":true,\"teaches\":\"Extent report customization in Selenium Java - Deep Dive\",\"provider\":{\"@type\":\"Organization\",\"url\":\"https://leyaa.ai\"},\"educationalLevel\":\"Beginner to Advanced\",\"breadcrumb\":{\"@type\":\"BreadcrumbList\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https://leyaa.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extent report customization in Selenium Java - Deep Dive\",\"item\":\"https://leyaa.ai/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization\"}]}}"])</script><script>self.__next_f.push([1,"7:[[[\"$\",\"script\",\"0\",{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"$16\"}}]],[\"$\",\"$L17\",null,{\"subject\":\"selenium-java\",\"dbSubject\":\"selenium_java\",\"part\":\"part-3\",\"pattern\":\"selenium_java_extent_report_customization\",\"modeSlug\":\"deep\",\"lang\":\"en\",\"internalLinks\":[{\"code\":\"LMC\",\"slug\":\"\",\"label\":\"📖 Learn\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization\",\"active\":false},{\"code\":\"LMCWHY\",\"slug\":\"why\",\"label\":\"💡 Why Learn This\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/why\",\"active\":false},{\"code\":\"DLM\",\"slug\":\"deep\",\"label\":\"💡 Deep Learn Mode\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/deep\",\"active\":true},{\"code\":\"TMC\",\"slug\":\"try\",\"label\":\"✏️ Try It\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/try\",\"active\":false},{\"code\":\"VMC\",\"slug\":\"visualize\",\"label\":\"👁 Visualize\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/visualize\",\"active\":false},{\"code\":\"TCM\",\"slug\":\"complexity\",\"label\":\"⏱ Complexity\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/complexity\",\"active\":false},{\"code\":\"CMC\",\"slug\":\"challenge\",\"label\":\"🏆 Challenge\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/challenge\",\"active\":false},{\"code\":\"PMC\",\"slug\":\"project\",\"label\":\"📁 Project\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/project\",\"active\":false},{\"code\":\"RMC\",\"slug\":\"review\",\"label\":\"🧠 Quick Review\",\"href\":\"/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/review\",\"active\":false}],\"isLoggedIn\":false,\"seoH1\":\"Extent report customization in Selenium Java - Deep Dive\",\"contentData\":{\"pattern_id\":\"selenium_java_extent_report_customization\",\"metadata\":{\"slot_map\":{\"LMCWHY\":\"LMCWHY\",\"LMC\":\"LMC\",\"TMC\":\"TMC\",\"CMC\":\"CMC\",\"RMC\":\"RMC\",\"VMC\":\"EXC\",\"TCM\":\"TFW\",\"PMC\":\"AUT\",\"DLM\":\"DLM\"}},\"modes\":{\"DLM\":{\"topic\":\"Extent report customization\",\"mode\":\"DLM_v1\",\"language\":\"selenium_java\",\"content_type\":\"Software Testing \u0026 QA\",\"overview\":{\"what\":\"Extent report customization means changing how the test report looks and what information it shows. It helps testers create reports that are easier to read and understand. You can add colors, logos, and extra details about tests. This makes it simple to see which tests passed or failed and why.\",\"why_it_matters\":\"Without customizing reports, test results can be hard to read and understand quickly. This slows down fixing problems and sharing results with others. Custom reports help teams spot issues faster and communicate clearly. They make testing more effective and save time in real projects.\",\"where_it_fits\":\"Before learning this, you should know how to write basic Selenium tests and generate simple Extent reports. After this, you can learn advanced reporting tools or integrate reports with continuous integration systems like Jenkins.\"},\"mental_model\":{\"core_idea\":\"Customizing Extent reports tailors test results presentation to make test outcomes clearer and more useful for everyone.\",\"analogy\":\"It's like decorating a photo album: you choose the cover, add captions, and arrange photos so your story is easy and fun to follow.\",\"visual\":\"┌─────────────────────────────┐\\n│ Extent Report │\\n├─────────────┬───────────────┤\\n│ Raw Test │ Customization │\\n│ Results │ Options │\\n│ (Pass/Fail) │ - Colors │\\n│ │ - Logos │\\n│ │ - Extra Info │\\n└─────────────┴───────────────┘\"},\"build_up\":[{\"level\":\"foundation\",\"title\":\"Basics of Extent Reports Setup\",\"concept\":\"Learn how to create a simple Extent report in Selenium with Java.\",\"content\":\"To start, add ExtentReports library to your project. Then create an ExtentReports object and an ExtentTest object for each test. Log test steps and results. Finally, flush the report to write it to a file.\\n\\nExample:\\nExtentReports extent = new ExtentReports();\\nExtentTest test = extent.createTest(\\\"My Test\\\");\\ntest.pass(\\\"Step passed\\\");\\nextent.flush();\",\"result\":\"A basic HTML report file is created showing test names and pass/fail status.\",\"insight\":\"Understanding the basic setup is essential before adding any customization.\"},{\"level\":\"foundation\",\"title\":\"Understanding Report Structure\",\"concept\":\"Know the parts of an Extent report you can customize: title, theme, system info, and test logs.\",\"content\":\"An Extent report has a header (title and logo), a summary (pass/fail counts), system info (environment details), and detailed test logs. Each part can be changed to fit your needs.\",\"result\":\"You can identify where to apply changes to make reports clearer and more informative.\",\"insight\":\"Knowing the report's anatomy helps target your customization effectively.\"},{\"level\":\"intermediate\",\"title\":\"Changing Report Title and Theme\",\"self_check\":\"Before reading on: do you think changing the report title requires editing the HTML file manually or can it be done via code? Commit to your answer.\",\"concept\":\"Learn how to set a custom report title and choose a theme (dark or standard) programmatically.\",\"content\":\"Use ExtentSparkReporter to set the report file path, then call methods to set the document title and theme.\\n\\nExample:\\nExtentSparkReporter spark = new ExtentSparkReporter(\\\"report.html\\\");\\nspark.config().setDocumentTitle(\\\"My Test Report\\\");\\nspark.config().setTheme(Theme.DARK);\\nExtentReports extent = new ExtentReports();\\nextent.attachReporter(spark);\",\"result\":\"The generated report shows the new title and uses the dark color theme.\",\"insight\":\"Knowing you can customize appearance via code saves time and avoids manual edits.\"},{\"level\":\"intermediate\",\"title\":\"Adding System and Environment Info\",\"self_check\":\"Before reading on: do you think system info is added automatically or must be set explicitly in code? Commit to your answer.\",\"concept\":\"Add details like OS, browser, and tester name to the report for better context.\",\"content\":\"Use extent.setSystemInfo(key, value) to add environment details.\\n\\nExample:\\nextent.setSystemInfo(\\\"OS\\\", \\\"Windows 10\\\");\\nextent.setSystemInfo(\\\"Browser\\\", \\\"Chrome 114\\\");\\nextent.setSystemInfo(\\\"Tester\\\", \\\"Alice\\\");\",\"result\":\"The report displays these details in a dedicated section, helping readers understand test conditions.\",\"insight\":\"Explicitly adding system info makes reports more useful for debugging and audits.\"},{\"level\":\"intermediate\",\"title\":\"Embedding Screenshots in Reports\",\"self_check\":\"Before reading on: do you think screenshots are added automatically on failure or require manual code? Commit to your answer.\",\"concept\":\"Learn how to capture and attach screenshots to test steps in the report.\",\"content\":\"Capture screenshots using Selenium's TakesScreenshot interface. Save the image file and add it to the report with test.addScreenCaptureFromPath(path).\\n\\nExample:\\nFile src = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\\nString path = \\\"screenshots/img.png\\\";\\nFileUtils.copyFile(src, new File(path));\\ntest.fail(\\\"Step failed\\\", MediaEntityBuilder.createScreenCaptureFromPath(path).build());\",\"result\":\"Failed test steps show screenshots in the report, making issues easier to understand.\",\"insight\":\"Attaching screenshots visually explains failures, speeding up troubleshooting.\"},{\"level\":\"advanced\",\"title\":\"Customizing Logs and Categories\",\"self_check\":\"Before reading on: do you think test categories and custom logs are set automatically or require explicit code? Commit to your answer.\",\"concept\":\"Add categories (like 'Smoke' or 'Regression') and custom log messages to organize and clarify tests.\",\"content\":\"Use test.assignCategory(\\\"Smoke\\\") to tag tests. Use test.log(Status.INFO, \\\"message\\\") to add detailed logs.\\n\\nExample:\\ntest.assignCategory(\\\"Regression\\\");\\ntest.log(Status.INFO, \\\"Starting login test\\\");\",\"result\":\"Reports group tests by category and show detailed logs for each step.\",\"insight\":\"Organizing tests by category helps filter and focus on relevant tests in large suites.\"},{\"level\":\"expert\",\"title\":\"Advanced Report Customization with CSS and JS\",\"self_check\":\"Before reading on: do you think Extent reports allow injecting custom CSS/JS for styling and behavior? Commit to your answer.\",\"concept\":\"Learn how to add your own CSS and JavaScript to Extent reports to change styles and add interactive features.\",\"content\":\"You can modify the ExtentSparkReporter configuration to include custom CSS or JS files by extending the reporter or post-processing the HTML file. This allows changing fonts, colors beyond themes, or adding dynamic filters.\\n\\nExample approach: After report generation, inject CSS styles or JS scripts into the HTML file to customize appearance and behavior.\",\"result\":\"Reports can have unique branding, interactive filters, or animations beyond default options.\",\"insight\":\"Knowing how to extend reports with CSS/JS unlocks full control over report presentation and user experience.\"}],\"under_the_hood\":{\"mechanism\":\"ExtentReports works by collecting test logs and metadata during test execution. It stores this data in memory and then writes it to an HTML file using ExtentSparkReporter. The reporter uses templates and configuration settings to format the report with HTML, CSS, and JavaScript. Customization changes these templates or adds extra data before writing the file.\",\"why_designed_this_way\":\"The design separates test logging from report generation to keep tests simple and flexible. Using HTML allows reports to be viewed in any browser without extra tools. The modular reporter design lets users customize appearance without changing core logic. This approach balances ease of use with powerful customization.\",\"diagram\":\"┌───────────────┐ ┌─────────────────────┐\\n│ Test Code │ │ ExtentReports API │\\n│ (Selenium) ───────▶│ Collect Logs \u0026 Info │\\n└───────────────┘ └─────────┬───────────┘\\n │\\n ▼\\n ┌─────────────────────┐\\n │ ExtentSparkReporter │\\n │ Format \u0026 Write HTML │\\n └─────────┬───────────┘\\n │\\n ▼\\n ┌───────────────────┐\\n │ Final HTML Report │\\n └───────────────────┘\"},\"misconceptions\":[{\"self_check\":\"Quick: Do you think Extent reports automatically capture screenshots on test failure without extra code? Commit to yes or no.\",\"belief\":\"Extent reports automatically capture and attach screenshots when a test fails.\",\"reality\":\"You must write code to capture screenshots and attach them to the report manually.\",\"why_it_matters\":\"Assuming automatic screenshots leads to missing visual evidence in reports, making debugging harder.\"},{\"self_check\":\"Quick: Do you think changing the report theme affects test results or only appearance? Commit to your answer.\",\"belief\":\"Changing the report theme can affect how tests run or their results.\",\"reality\":\"Themes only change the report's look; they do not affect test execution or outcomes.\",\"why_it_matters\":\"Confusing appearance with test logic can cause wasted effort troubleshooting non-issues.\"},{\"self_check\":\"Quick: Do you think system info like OS and browser is added automatically to Extent reports? Commit yes or no.\",\"belief\":\"System and environment info is automatically included in Extent reports without extra code.\",\"reality\":\"You must explicitly add system info using setSystemInfo calls in your test code.\",\"why_it_matters\":\"Missing environment details can cause confusion when tests behave differently on various setups.\"},{\"self_check\":\"Quick: Do you think you can fully customize Extent reports by only changing Java code without touching HTML or CSS? Commit your answer.\",\"belief\":\"All report customization can be done purely through Java code APIs.\",\"reality\":\"Some advanced customizations require editing or injecting CSS/JS into the generated HTML report.\",\"why_it_matters\":\"Expecting full control via code alone limits report design and misses powerful customization options.\"}],\"expert_zone\":{\"nuances\":[\"Custom categories can be combined with test metadata to create dynamic filters in reports, improving navigation in large test suites.\",\"Using ExtentReports in parallel test execution requires thread-safe handling of ExtentTest objects to avoid log mix-ups.\",\"Post-processing the generated HTML report with scripts allows adding features like auto-refresh or custom analytics not supported natively.\"],\"when_not_to_use\":\"Extent report customization is less suitable when tests run in highly restricted environments without file system access or when real-time reporting is needed. In such cases, consider using cloud-based reporting tools or continuous integration dashboards that update live.\",\"production_patterns\":\"In real projects, teams integrate Extent reports with Jenkins pipelines to archive reports and send email notifications. They use custom themes and logos for branding and attach screenshots on failures. Categories help run subsets of tests like smoke or regression. Advanced users inject JavaScript to add interactive filters and export options.\"},\"connections\":[{\"to_concept\":\"Continuous Integration (CI) Pipelines\",\"relationship\":\"Builds-on\",\"insight\":\"Knowing how to customize Extent reports helps integrate clear test results into CI pipelines, improving automated quality feedback.\"},{\"to_concept\":\"User Interface (UI) Design\",\"relationship\":\"Similar pattern\",\"insight\":\"Customizing report themes and layouts shares principles with UI design, like color contrast and information hierarchy, enhancing report readability.\"},{\"to_concept\":\"Data Visualization\",\"relationship\":\"Builds-on\",\"insight\":\"Understanding how to present test data visually in reports connects to data visualization concepts, helping communicate complex results simply.\"}],\"pitfalls\":[{\"mistake\":\"Assuming screenshots attach automatically on failure.\",\"incorrect_approach\":\"test.fail(\\\"Test failed\\\");\",\"correct_approach\":\"test.fail(\\\"Test failed\\\", MediaEntityBuilder.createScreenCaptureFromPath(\\\"path/to/screenshot.png\\\").build());\",\"root_cause\":\"Misunderstanding that screenshot capture and attachment require explicit code.\"},{\"mistake\":\"Setting report title by editing the HTML file after generation.\",\"incorrect_approach\":\"Manually opening report.html and changing \u003ctitle\u003e tag in a text editor.\",\"correct_approach\":\"spark.config().setDocumentTitle(\\\"Custom Title\\\");\",\"root_cause\":\"Not knowing ExtentSparkReporter provides API for title customization.\"},{\"mistake\":\"Not calling extent.flush() at the end of tests.\",\"incorrect_approach\":\"Creating tests and logging but forgetting extent.flush();\",\"correct_approach\":\"Calling extent.flush(); after all tests to write the report file.\",\"root_cause\":\"Missing the step that finalizes and saves the report.\"}],\"key_takeaways\":[\"Extent report customization makes test results clearer and easier to understand for all stakeholders.\",\"You can change report titles, themes, add system info, categories, and screenshots through simple Java APIs.\",\"Advanced customization may require injecting CSS or JavaScript into the generated HTML report.\",\"Misunderstandings about automatic features like screenshots or system info can cause incomplete reports.\",\"Integrating customized reports into CI pipelines and using categories improves test management in real projects.\"],\"metadata\":{\"version\":\"1.0\",\"content_type\":\"testing\",\"estimated_time_minutes\":15,\"depth_level\":\"comprehensive\",\"difficulty_ceiling\":\"expert\"}}},\"subject\":\"selenium_java\",\"title\":\"Extent report customization\"},\"syllabusData\":{\"part\":\"part-3\",\"subject\":\"selenium_java\",\"difficulty\":\"advanced\",\"metadata\":{\"total_topics\":6,\"total_patterns\":44,\"patterns_with_content\":44,\"created_at\":\"2026-03-03T15:53:11.167760Z\",\"version\":\"4.2\",\"upload_tool\":\"upload_to_mongo.py v2.0\"},\"part_title\":\"Advanced\",\"subjectTitle\":\"Selenium Java\",\"topics\":[{\"topic_id\":\"selenium_java_p3_t1\",\"title\":\"Data-Driven Testing\",\"order\":1,\"pattern_count\":6,\"patterns\":[{\"pattern_id\":\"selenium_java_why_data_separation_improves_test_coverage\",\"title\":\"Why data separation improves test coverage\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_java_excel_data_reading_apache_poi\",\"title\":\"Excel data reading (Apache POI)\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_java_csv_data_reading\",\"title\":\"CSV data reading\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_java_json_test_data\",\"title\":\"JSON test data\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_java_dataprovider_with_external_data\",\"title\":\"DataProvider with external data\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_java_properties_file_for_configuration\",\"title\":\"Properties file for configuration\",\"order\":6,\"has_content\":true}]},{\"topic_id\":\"selenium_java_p3_t2\",\"title\":\"Cross-Browser and Grid\",\"order\":2,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_java_why_multibrowser_testing_ensures_reach\",\"title\":\"Why multi-browser testing ensures reach\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_java_chromeoptions_configuration\",\"title\":\"ChromeOptions configuration\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_java_firefoxoptions_configuration\",\"title\":\"FirefoxOptions configuration\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_java_edgeoptions_configuration\",\"title\":\"EdgeOptions configuration\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_java_headless_execution\",\"title\":\"Headless execution\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_java_selenium_grid_setup\",\"title\":\"Selenium Grid setup\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_java_remotewebdriver_usage\",\"title\":\"RemoteWebDriver usage\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_java_docker_selenium_grid\",\"title\":\"Docker Selenium Grid\",\"order\":8,\"has_content\":true}]},{\"topic_id\":\"selenium_java_p3_t3\",\"title\":\"Reporting\",\"order\":3,\"pattern_count\":7,\"patterns\":[{\"pattern_id\":\"selenium_java_why_reports_communicate_test_results\",\"title\":\"Why reports communicate test results\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_java_extent_reports_setup\",\"title\":\"Extent Reports setup\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_java_logging_test_steps\",\"title\":\"Logging test steps\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_java_screenshot_attachment_on_failure\",\"title\":\"Screenshot attachment on failure\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_java_extent_report_customization\",\"title\":\"Extent report customization\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_java_allure_reporting_integration\",\"title\":\"Allure reporting integration\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_java_testng_default_reports\",\"title\":\"TestNG default reports\",\"order\":7,\"has_content\":true}]},{\"topic_id\":\"selenium_java_p3_t4\",\"title\":\"Framework Design Patterns\",\"order\":4,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_java_why_framework_design_enables_scalability\",\"title\":\"Why framework design enables scalability\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_java_hybrid_framework_architecture\",\"title\":\"Hybrid framework architecture\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_java_configuration_management\",\"title\":\"Configuration management\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_java_utility_classes\",\"title\":\"Utility classes\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_java_custom_annotations\",\"title\":\"Custom annotations\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_java_retry_analyzer_for_failures\",\"title\":\"Retry analyzer for failures\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_java_logging_with_log4j\",\"title\":\"Logging with Log4j\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_java_base_test_class_pattern\",\"title\":\"Base test class pattern\",\"order\":8,\"has_content\":true}]},{\"topic_id\":\"selenium_java_p3_t5\",\"title\":\"Advanced Techniques\",\"order\":5,\"pattern_count\":7,\"patterns\":[{\"pattern_id\":\"selenium_java_why_advanced_skills_handle_complex_scenarios\",\"title\":\"Why advanced skills handle complex scenarios\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_java_cookie_management\",\"title\":\"Cookie management\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_java_file_download_handling\",\"title\":\"File download handling\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_java_browser_profile_management\",\"title\":\"Browser profile management\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_java_network_interception_cdp\",\"title\":\"Network interception (CDP)\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_java_performance_metrics_via_devtools\",\"title\":\"Performance metrics via DevTools\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_java_shadow_dom_element_access\",\"title\":\"Shadow DOM element access\",\"order\":7,\"has_content\":true}]},{\"topic_id\":\"selenium_java_p3_t6\",\"title\":\"CI/CD Integration\",\"order\":6,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_java_why_ci_integration_enables_continuous_testing\",\"title\":\"Why CI integration enables continuous testing\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_java_maven_build_lifecycle\",\"title\":\"Maven build lifecycle\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_java_running_tests_via_maven\",\"title\":\"Running tests via Maven\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_java_jenkins_pipeline_integration\",\"title\":\"Jenkins pipeline integration\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_java_github_actions_configuration\",\"title\":\"GitHub Actions configuration\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_java_docker_execution_environment\",\"title\":\"Docker execution environment\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_java_test_parallelization_in_ci\",\"title\":\"Test parallelization in CI\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_java_report_publishing_in_ci\",\"title\":\"Report publishing in CI\",\"order\":8,\"has_content\":true}]}]},\"modeCode\":\"DLM\",\"productId\":\"codefly\"}]]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Extent report customization in Selenium Java - Deep Dive: Internals \u0026 How It Works | Leyaa.ai\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Go deep on Extent report customization in Selenium Java. Internals, mental models, under-the-hood mechanics, misconceptions, common pitfalls, and production patterns. For serious learners.\"}],[\"$\",\"meta\",\"4\",{\"name\":\"author\",\"content\":\"Leyaa.ai\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"learning intelligence,AI learning,personalized learning,adaptive learning,study guide,exam preparation,learning platform,education technology,edtech,smart learning\"}],[\"$\",\"meta\",\"7\",{\"name\":\"creator\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"8\",{\"name\":\"publisher\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"9\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"10\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"meta\",\"11\",{\"name\":\"content-language\",\"content\":\"en\"}],[\"$\",\"link\",\"12\",{\"rel\":\"canonical\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/deep\"}],[\"$\",\"link\",\"13\",{\"rel\":\"alternate\",\"hrefLang\":\"en\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/deep\"}],[\"$\",\"link\",\"14\",{\"rel\":\"alternate\",\"hrefLang\":\"x-default\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/deep\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:title\",\"content\":\"Extent report customization in Selenium Java - Deep Dive: Internals \u0026 How It Works | Leyaa.ai\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:description\",\"content\":\"Go deep on Extent report customization in Selenium Java. Internals, mental models, under-the-hood mechanics, misconceptions, common pitfalls, and production patterns. For serious learners.\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:url\",\"content\":\"https://leyaa.ai/codefly/learn/selenium-java/part-3/selenium-java-extent-report-customization/deep\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:locale\",\"content\":\"en_US\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:image\",\"content\":\"https://leyaa.ai/Assets/metaImages/leyaa-preview-image.png\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"21\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"22\",{\"property\":\"og:image:alt\",\"content\":\"Extent report customization in Selenium Java - Deep Dive: Internals \u0026 How It Works\"}],[\"$\",\"meta\",\"23\",{\"property\":\"og:type\",\"content\":\"article\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:site\",\"content\":\"@leyaaai\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:creator\",\"content\":\"@leyaaai\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:title\",\"content\":\"Extent report customization in Selenium Java - Deep Dive: Internals \u0026 How It Works | Leyaa.ai\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:description\",\"content\":\"Go deep on Extent report customization in Selenium Java. Internals, mental models, under-the-hood mechanics, misconceptions, common pitfalls, and production patterns. For serious learners.\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image\",\"content\":\"https://leyaa.ai/Assets/metaImages/leyaa-preview-image.png\"}],[\"$\",\"link\",\"30\",{\"rel\":\"icon\",\"href\":\"/leyaa-logo.png\"}],[\"$\",\"link\",\"31\",{\"rel\":\"apple-touch-icon\",\"href\":\"/leyaa-logo.png\"}],[\"$\",\"meta\",\"32\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\n"])</script></body></html>