Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a simple test report message.
Selenium Java
System.out.println("Test execution [1]: Passed");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'result' or 'output' which are close but less precise here.
✗ Incorrect
The word status best fits here to describe the test execution result.
2fill in blank
mediumComplete the code to assert that the test passed.
Selenium Java
assertEquals(true, [1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing generic names like 'testResult' which may not be boolean.
✗ Incorrect
The variable isTestSuccessful clearly indicates the test success status.
3fill in blank
hardFix the error in the code to log the test result correctly.
Selenium Java
logger.info("Test case [1] completed with status: " + status);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' which may not be unique.
✗ Incorrect
The id uniquely identifies the test case in reports.
4fill in blank
hardFill both blanks to create a summary report line.
Selenium Java
System.out.println("Total tests: [1], Passed: [2]");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'failedTests' or 'skippedTests' which don't match the labels.
✗ Incorrect
The summary shows total tests and how many passed, so totalTests and passedTests fit best.
5fill in blank
hardFill all three blanks to generate a detailed test report entry.
Selenium Java
report.addEntry("Test [1]", [2], "Duration: [3] ms");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'testResult' with 'testStatus' or mixing duration with status.
✗ Incorrect
The method needs the test name, status, and duration to create a full report entry.