Creating a Maven project

Here, you'll create a Maven project that can be used to write and perform test automation, using the Selenium WebDriver. Before you begin, verify that Java 8 SDK is installed on your computer. Then, use your preferred IDE (we recommend IntelliJ IDEA). Finally, download Maven from https://maven.apache.org/download.cgiThe steps for completion of this process are as follows:

  1. Open the IDE.
  2. Create a new Maven project by navigating to File | New | Project.
  3. Select Maven, and click on Next.
  4. Enter com.beginningselenium as GroupId and lesson1 as the ArtifactId, and click on Next. Finally, click on Finish.
    Next, we'll look at adding Selenium WebDriver to the Maven project's POM.xml file.
  1. The POM.xml file should open automatically. Before the </project> tag, add the following, and then save the file:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
</dependencies>
  1. Right-click on the project, then navigate to Maven | Reimport.
  2. Right-click on the src/main/java folder and navigate to New | Package.
  3. Enter com.beginningselenium.selenium as the name, and click OK.
  4. Right-click on the new package and navigate to New | Java Class.
  5. Enter BrowserCheck for the name, and click on OK.

Configuring the development environment for Selenium consists of three simple steps, as follows:

  • Installing and configuring the Java SDK
  • Installing and configuring an IDE
  • Downloading and configuring the browser drivers for all of the required browsers
  • Using Maven, or any other means, to ensure that the programming language and IDE will be able to import and use the required Selenium libraries and documentation
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.84.171