0
0
Selenium Javatesting~10 mins

Extent Reports setup in Selenium Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an ExtentReports object.

Selenium Java
ExtentReports extent = new [1]();
Drag options to blanks, or click blank then click option'
AExtentReports
BExtentTest
CExtentSparkReporter
DReporter
Attempts:
3 left
💡 Hint
Common Mistakes
Using ExtentTest instead of ExtentReports.
Confusing ExtentSparkReporter with ExtentReports.
2fill in blank
medium

Complete the code to initialize ExtentSparkReporter with a file path.

Selenium Java
ExtentSparkReporter spark = new ExtentSparkReporter([1]);
Drag options to blanks, or click blank then click option'
AFile("report.html")
Bnew File("report.html")
CPaths.get("report.html")
D"report.html"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a File object instead of a String path.
Using Paths.get which returns a Path, not a String.
3fill in blank
hard

Fix the error in attaching the reporter to ExtentReports.

Selenium Java
extent.[1](spark);
Drag options to blanks, or click blank then click option'
AaddReport
BattachReporter
CaddReporter
DattachReport
Attempts:
3 left
💡 Hint
Common Mistakes
Using addReporter which does not exist.
Using addReport which is incorrect.
4fill in blank
hard

Fill both blanks to create a test and log a pass status.

Selenium Java
ExtentTest test = extent.[1]("Sample Test");
test.[2](Status.PASS, "Test passed successfully");
Drag options to blanks, or click blank then click option'
AcreateTest
Blog
CstartTest
Dpass
Attempts:
3 left
💡 Hint
Common Mistakes
Using startTest instead of createTest.
Using pass method which does not exist.
5fill in blank
hard

Fill all three blanks to flush the report after tests.

Selenium Java
extent.[1]();

// After tests
extent.[2]();

System.out.println("Report saved at: [3]");
Drag options to blanks, or click blank then click option'
Aflush
Bclose
C"report.html"
D"output.html"
Attempts:
3 left
💡 Hint
Common Mistakes
Not calling flush before close.
Printing wrong file path.