0
0
Selenium Javatesting~20 mins

Extent report customization in Selenium Java - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Extent Report Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of ExtentReports Configuration Code
What will be the title of the report generated by the following ExtentReports configuration code snippet?
Selenium Java
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");
htmlReporter.config().setDocumentTitle("My Test Report");
ExtentReports extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.createTest("Sample Test").pass("Test passed successfully");
extent.flush();
AMy Test Report
BSample Test
Cextent.html
DTest passed successfully
Attempts:
2 left
💡 Hint
Look at the method that sets the document title in the htmlReporter configuration.
assertion
intermediate
2:00remaining
Correct Assertion for Extent Test Status
Which assertion correctly verifies that an ExtentTest has passed after execution?
Selenium Java
ExtentTest test = extent.createTest("Login Test");
test.pass("Login successful");
AassertEquals(test.getStatus(), Status.PASS);
BassertTrue(test.getStatus() == Status.FAIL);
CassertNull(test.getStatus());
DassertFalse(test.getStatus() == Status.PASS);
Attempts:
2 left
💡 Hint
Check the status set by the pass() method and compare it correctly.
locator
advanced
2:00remaining
Best Locator for Customizing Extent Report Theme
In ExtentHtmlReporter configuration, which method correctly sets the theme to DARK mode?
AhtmlReporter.setConfig("theme", "dark");
BhtmlReporter.setTheme("dark");
ChtmlReporter.config().theme = "dark";
DhtmlReporter.config().setTheme(Theme.DARK);
Attempts:
2 left
💡 Hint
Check the official ExtentHtmlReporter API for setting themes.
🔧 Debug
advanced
2:00remaining
Identify the Error in Extent Report Initialization
What error will occur when running this ExtentReports initialization code?
Selenium Java
ExtentReports extent = new ExtentReports();
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter();
extent.attachReporter(htmlReporter);
AIllegalArgumentException due to missing file path
BNullPointerException at attachReporter
CCompilation error: No suitable constructor found for ExtentHtmlReporter()
DNo error, code runs successfully
Attempts:
2 left
💡 Hint
Check the constructors available for ExtentHtmlReporter.
framework
expert
3:00remaining
Customizing Extent Report with System Info and Multiple Tests
Given the following code snippet, what will be the value of the system info key "OS" in the generated report?
Selenium Java
ExtentReports extent = new ExtentReports();
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("report.html");
extent.attachReporter(htmlReporter);
extent.setSystemInfo("OS", "Windows 10");
ExtentTest test1 = extent.createTest("Test 1");
test1.pass("Step 1 passed");
ExtentTest test2 = extent.createTest("Test 2");
test2.fail("Step 2 failed");
extent.flush();
Anull
BWindows 10
CStep 1 passed
DTest 1
Attempts:
2 left
💡 Hint
System info is set once on the ExtentReports object and is global for the report.