0
0
Selenium Javatesting~10 mins

Report publishing in CI 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 initialize the ExtentReports object for report publishing.

Selenium Java
ExtentReports extent = new ExtentReports();
extent.attachReporter(new ExtentHtmlReporter([1]));
Drag options to blanks, or click blank then click option'
Atest-output/report.html
Breport.html
C"test-output/report.html"
D"report"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the file path in quotes.
Using a relative path without quotes causing syntax errors.
2fill in blank
medium

Complete the code to flush the ExtentReports so the report is saved after tests.

Selenium Java
extent.[1]();
Drag options to blanks, or click blank then click option'
Aflush
Bwrite
Csave
Dclose
Attempts:
3 left
💡 Hint
Common Mistakes
Using close() which may not save the report properly.
Trying to use save() which does not exist.
3fill in blank
hard

Fix the error in the code to correctly add a test log entry with status PASS.

Selenium Java
test.[1](Status.PASS, "Test passed successfully");
Drag options to blanks, or click blank then click option'
Arecord
BaddLog
CwriteLog
Dlog
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like addLog or writeLog.
Trying to use record which is not a method here.
4fill in blank
hard

Fill both blanks to create a Jenkins pipeline step that archives the test report folder and publishes the HTML report.

Selenium Java
archiveArtifacts '[1]'
publishHTML (target: [allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: '[2]', reportFiles: 'report.html', reportName: 'Test Report'])
Drag options to blanks, or click blank then click option'
Atest-output/**
Btest-output
Creports/**
Dreports
Attempts:
3 left
💡 Hint
Common Mistakes
Using the folder name without wildcards in archiveArtifacts causing no files archived.
Using wrong folder names that don't match the report location.
5fill in blank
hard

Fill all three blanks to configure a Maven Surefire plugin to generate test reports in XML format for CI integration.

Selenium Java
<configuration>
  <reportsDirectory>[1]</reportsDirectory>
  <testFailureIgnore>[2]</testFailureIgnore>
  <reportFormat>[3]</reportFormat>
</configuration>
Drag options to blanks, or click blank then click option'
Atarget/surefire-reports
Bfalse
Cxml
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Setting testFailureIgnore to true which ignores failures.
Using wrong report format like 'html' instead of 'xml'.