Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to specify the packaging type in the Maven <project> file.
Selenium Java
<project> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>selenium-test</artifactId> <version>1.0-SNAPSHOT</version> <packaging>[1]</packaging> </project>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'war' packaging which is for web applications.
Using unsupported packaging types like 'exe' or 'zip'.
✗ Incorrect
The element defines the type of artifact. For Selenium Java projects, 'jar' is the correct packaging type.
2fill in blank
mediumComplete the dependency tag to add Selenium Java to the Maven <dependencies> section.
Selenium Java
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>[1]</artifactId> <version>4.10.0</version> </dependency>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'selenium-server' which is for the Selenium server, not the client library.
Using driver-specific artifactIds instead of the main selenium-java.
✗ Incorrect
The correct artifactId for Selenium Java client is 'selenium-java'.
3fill in blank
hardFix the error in the Maven <properties> section to set the Java version correctly.
Selenium Java
<properties> <maven.compiler.source>[1]</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> </properties>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting source to '1.8' while target is '17' causes compilation errors.
Using 'latest' is not a valid version string.
✗ Incorrect
To use Java 17 features, both source and target must be set to '17'.
4fill in blank
hardFill both blanks to complete the Maven <build> section with the Surefire plugin for running tests.
Selenium Java
<build>
<plugins>
<plugin>
<groupId>[1]</groupId>
<artifactId>[2]</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</build> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Selenium groupId or artifactId instead of Maven plugin identifiers.
Omitting the plugin version or using incorrect plugin names.
✗ Incorrect
The Surefire plugin groupId is 'org.apache.maven.plugins' and artifactId is 'maven-surefire-plugin'.
5fill in blank
hardFill all three blanks to create a Maven profile named 'chrome' that sets a system property for ChromeDriver path.
Selenium Java
<profiles>
<profile>
<id>[1]</id>
<properties>
<chrome.driver.path>[2]</chrome.driver.path>
</properties>
<activation>
<activeByDefault>[3]</activeByDefault>
</activation>
</profile>
</profiles> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting activeByDefault to true activates the profile always.
Using incorrect or relative paths for the ChromeDriver.
✗ Incorrect
The profile id is 'chrome', the driver path is set to '/usr/local/bin/chromedriver', and activeByDefault is 'false' to activate manually.