Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to run tests using Maven's default test phase.
Selenium Java
mvn [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'compile' runs only compilation, not tests.
Using 'package' or 'install' runs later phases but not just tests.
✗ Incorrect
The test phase runs the tests in the Maven lifecycle.
2fill in blank
mediumComplete the command to run tests with Maven and skip compiling.
Selenium Java
mvn [1] -DskipCompile=true Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'package' or 'install' runs more than tests.
Skipping compile without running tests won't test code.
✗ Incorrect
The test phase runs tests. Adding -DskipCompile=true skips compilation if already done.
3fill in blank
hardFix the error in the Maven command to run tests with a specific test class.
Selenium Java
mvn test -Dtest=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or wrong case for class name.
Including file extensions in the test name.
✗ Incorrect
The -Dtest option expects the exact test class name without file extension.
4fill in blank
hardFill both blanks to run tests and generate a report in XML format.
Selenium Java
mvn [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'clean' instead of 'test' to run tests.
Choosing HTML report format when XML is requested.
✗ Incorrect
Use test to run tests and -Dsurefire.reportFormat=xml to generate XML reports.
5fill in blank
hardFill all three blanks to clean, compile, and run tests with Maven.
Selenium Java
mvn [1] [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Running 'install' instead of 'test' to run tests.
Skipping 'clean' may cause stale files.
✗ Incorrect
The clean phase removes old files, compile compiles code, and test runs tests.