• Home
  • Testing
  • SAP
  • Web
  • Must Learn!
  • Big Data
  • Live Projects
  • Blog

Apache Maven is a Java-based project management tool. It can provide a multitasking framework for developers. It eases the complete build lifecycle. Maven is pre-defined and declared in XML format called as POM (Project Object Model) and referred to 'pom.xml.'

Using Maven framework, we can easily manage following tasks in any project-

  • Build cycle
  • Project Documentation
  • Report Checks
  • Scrums management
  • Release Information

Basic uses of Maven are-

  • Enforces a standard directory structure.
  • Provide a reusable and easy to maintain project structure.
  • Resolve packages dependencies.
  • Provide a configuration management framework.

Download Appium Maven Dependencies

Before start writing APPIUM test with Maven, we have to download  the JAR file from Maven central repository website.

Appium Desired Capabilities, Maven & ADB

or directly add below mentioned POM.xml artifact:

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

Please go through our Maven tutorial to learn how to configure Maven with Eclipse.

Testing Application with APPIUM and Maven

After configuring Maven plug-in Eclipse. It will be ready to test any android .apk application with Appium and Maven.

Step 1) In this step,

  1. Go to NEW >> select Maven project
  2. Click on 'next' button

Appium Desired Capabilities, Maven & ADB

Step 2) Then in 'New Maven Project' window, enter 'Appium Test' in Group Id and Artifact Id column. In this step, you have to enter.

  1. Group Id
  2. Artifact Id
  3. Version
  4. Packaging
  5. Name and Description
  6. Finish

Appium Desired Capabilities, Maven & ADB

Clicking on Finish button. It will open a new class on the defined Group Id (AppiumTest) name.

Step 3) To start with Appium script. Right click on 'src/main/java' from left side explorer window. Then select New >> class. Write the Appium code inside the selected class.

Appium Desired Capabilities, Maven & ADB

Step 4) In the same project, click over pom.xml from left explorer menu. All dependencies will be visible by default in 'pom.xml' tab. Refer to the Image below-

Appium Desired Capabilities, Maven & ADB

If in the case of default pom.xml does not exist then just add all Maven Appium dependencies. (extracted from Maven central repository website}

http://search.maven.org/#search|gav|1|g%3A%22io.appium%22%20AND%20a%3A%22java-client%22

Appium Desired Capabilities, Maven & ADB

Step 5) Now, right click on 'pom.xml' from left explorer or over the xml code for 'AppiumTest' project. Then click 'Run As >> Maven Clean' option.

Appium Desired Capabilities, Maven & ADB

While running, the user could see all Maven related jar files and success message. Hence, this way the user can run APPIUM test with Maven configured environment.

Appium Desired Capabilities, Maven & ADB

Summary:

  • Maven is a JAVA based Project Management Framework.
  • It is pre-defined and declared in XML format called as POM (Project Object Model) and referred to 'pom.xml'.

 

YOU MIGHT LIKE: