How to configure Appium Maven Project 🧐

Tharaka Liyanage
4 min readDec 2, 2021

--

πŸ‘‹ In this article I am going to discuss about on adding java client dependencies required for configuring Appium Maven Project.

What Integrated Development Environment (IDE) you prefer for creating your Appium Maven Project ?

Eclipse OR IntelliJ IDEA 🀞

IntelliJ IDEA would be a good fit for this since this is the most powerful and popular IDE in the market today which supports Java and Maven.

Why Maven Project ?

In this blog series I am using Java as my Appium Client language. All Java related libraries are hosted in Maven repository and that’s the reason I am moving forward with a Maven Project.

  1. Download IntelliJ IDEA based on your choice of OS

2. Create a simple Java Project in IntelliJ IDEA

  • Open IntelliJ IDEA
  • Create New Project
  • Select Java to create a plain Java project and select a JDK from below window
    eg: JDK 11

If you have not already downloaded JDK you can choose Download JDK option and get it downloaded or else refer my previous blog on download Java

I am not adding any additional libraries like Groovy , Kotlin at the moment.

  • Go ahead and click on Next
  • Let’s start from the scratch and not create a project template. Click on Next
  • Add any preferred Project name and change the default project location if you want, go ahead and click on Finish
  • πŸ‘ πŸ‘ You have successfully created a simple Java Project

3. Convert Java Project to a Maven Project

  • Right click on the project folder and select Add Framework Support
  • Select the option Maven and click on OK
  • Now your Maven project template is ready with the required packages and pom.xml

What is pom.xml ?
This contains all information about the project and configuration details used by Maven to build the project. This is the file where we keep all the dependencies.

4. Add Appium Java client dependency in Maven Project

  • Go to Maven repository
  • Search for β€œappium” and select the top filter result β€” Java Client
  • Select the latest version in top of the list
    eg: 8.0.0-beta
  • Copy the Maven dependency

<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>8.0.0-beta</version>
</dependency>

Note : Once you add this dependency in your project , this will automatically connect to the Maven repository and download all the required jars to write your Java code or the client.

  • Open your Maven project and add the parent tag for dependencies in your pom.xml
  • Add the Appium java client child dependency inside the parent dependencies tags.

Note:
Soon after adding this child dependency, reload your Maven project, then all the required .jar s for Appium will download automatically. This is the beauty of having a Maven Project rather a plain Java Project.

5. Add the Selenium dependency

Why we need Selenium ?
Appium is coming from the Selenium family and it is built on top of the Selenium. So let’s add Selenium .jar s as well.

  • Find the current Selenium stable version from here listed under Changelog section. It is 3.141.59 and keep this version number with you.
  • Select the stable version found earlier which is 3.141.59
  • Copy the selenium dependency
  • Add the copied Selenium dependency in your Maven project pom.xml

Save and reload your Maven Project to configure all required Selenium .jar files.

Cheers..🍻🍻 You were successfully created Appium Maven Project and ready to start automation.

See you in the next blog..✌️

--

--