Your First Appium Test Case: Setting up the IDE

Reading Time : < 1min read
Setting up the IDE

Setting Up An IDE for Your First Appium Test Case 

Welcome to the exciting world of test automation with Appium! In this blog post, we’ll guide you through writing your first test case using Appium 2.0. Whether you’re just starting  or are an experienced developer, you’ll quickly appreciate the simplicity and power of Appium.

Understanding Appium and Its Capabilities

Appium is a powerful tool for automating tests across a variety of applications—native, hybrid, and web-based. One of its standout features is its OS-agnostic nature, allowing your Appium scripts to run seamlessly on any device or platform, whether it’s a real device, a simulator, or an emulator. This flexibility means you can execute your tests without being tied to a specific mobile OS or the application itself, making Appium a versatile choice for any automation strategy.

Under the hood, Appium serves as a wrapper that translates Selenium WebDriver commands into XCUITest for iOS and UiAutomator2 for Android. XCUITest and UiAutomator2 are testing frameworks specifically designed for Xcode and Android Studio, respectively. Additionally, Appium supports all the programming languages that Selenium does, including Java, C#, Python, Ruby, and JavaScript with Node.js, allowing you to choose the language that best fits your project’s needs.

Getting Started With Your First Appium Test Case

For the examples that follow, we will be using Java, as Appium was originally developed in this language. There are many resources available online (download our free Appium eBook)  to help you with both Appium and Java, making your learning journey smoother. While our examples will be demonstrated on a Mac, you can easily follow along on any supported operating system.

Note: The steps may seem a little daunting, especially when you want to write a simple test case. However, this is really a one-time effort. Once your environment is configured and you’re comfortable with concepts, such as dependency management, you’ll find that writing the Appium scripts is a relatively straightforward task. So stay with us through this section, and it will get easier, we promise.

Install an IDE

We’ll begin by installing an IDE to create Java-based Appium scripts. You can choose between IntelliJ IDEA or Eclipse IDE (or any IDE you prefer), but we will be using IntelliJ IDEA for our examples.

To summarize, here’s what we’ll use to create our Appium script:

  • Programming Language: Java
  • Test Framework: TestNG
  • IDE: IntelliJ IDEA
  • Project Dependency Tool: Maven

There are two primary goals for this chapter:

  • 1. Set up the IDE (IntelliJ IDEA).
  • 2. Create your first automation test case.

While Appium is responsible for driving and controlling the underlying mobile application for automation, you’ll still need a testing framework to implement your actual tests. For this purpose, we will be using the TestNG framework. Let’s dive in!

Free Appium Course

Set Up the IDE (IntelliJ IDEA)

To set up IntelliJ IDEA, follow these steps:

  1. Install IntelliJ IDEA: Download and install the latest version of IntelliJ IDEA from the JetBrains website. Choose either the Community or Ultimate edition based on your needs.
  2. Install the TestNG Plugin

Installation of IntelliJ IDEA

You can download and install IntelliJ IDEA Community Edition from here. Install it by dragging and dropping:

Screenshot showing the installation process of IntelliJ IDEA Community Edition on macOS. The image instructs users to drag the IntelliJ IDEA CE icon into the Applications folder to install the application

Figure-1: Installation of IntelliJ IDEA Community Edition.
If you are installing IntelliJ Idea for the first time, then you need to select the “ Skip import settings” option.

Screenshot displaying the 'Import Settings' screen during IntelliJ IDEA setup. Users are prompted to import settings from previous JetBrains IDEs or skip the import to proceed with the installation

Figure-2: Complete the Installation.

Install the TestNG plugin on IntelliJ IDEA

By default the TestNG plugin is installed in IntelliJ IDEA. You can check it in several ways but the best way is to check it in Plugins.

Open IntelliJ Idea and click on  Plugins.

Screenshot showing the installation of the TestNG plugin in IntelliJ IDEA. The image displays the IntelliJ IDEA welcome screen with the 'Plugins' option highlighted under the 'Configure' menu, guiding users to verify and install the TestNG plugin

Figure-3: Go to IntelliJ IDEA Plugins.

Screenshot showing the IntelliJ IDEA 'Marketplace' tab with several plugins available for installation

Figure-4: Testng installation on Marketplace.

Select the “Installed” tab and search Testng. It should be installed by default. Select “Installed and ”type ‘testng’ and search it, if it is installed properly you can see the Right tick icon right next to ‘TestNg’ text. And if it is not installed you need to install it by clicking on Marketplace and Search for ‘testng’ > Install it.

Screenshot showing the TestNG plugin installation in IntelliJ IDEA. The 'Installed' tab is selected, with TestNG listed in the search results and marked as bundled. The 'Disable' option is visible, indicating that the plugin is already installed

Figure-5: Install Testng

Installing Appium and Setting Up the Appium Server

Before we proceed, please ensure you have followed the Setting Up Appium Blog post and installed Appium correctly. Once you have Appium set up, we’ll focus on installing our development environment.

Check out the rest of our Appium Test Case series: 

Your First Appium Test Case: Writing and Running

Your First Appium Test Case: IOS and Android

To learn more, download our free eBook, Make the Move to Automation With Appium.

Appium eBook

Interested in Learning More?

Subscribe today to stay informed and get regular updates from Kobiton

Ready to accelerate delivery of
your mobile apps?

Request a Demo