Selendroid Setup in Eclipse Using WebDriver

Selendroid is a test automation framework used in automation of Android native and hybrid apps and the mobile web. Tests in Selendroid are written in Selenium WebDriver client API. This post covers step-by-step tutorial to perform Selendroid Setup in Eclipse IDE using WebDriver.

Selendroid Setup in EclipseWe will use TestNG framework in our setup and write a test on Selenium WebDriver using Java. The test will be carried out on sample Selendroid app installed in an emulator. But before we proceed further, let’s ensure we have below prerequisites met for Selendroid setup.

Prerequisites:

We can now start with Selendroid setup in Eclipse. Perform below steps for it.

  • Start an emulator to run your test on or connect your device to the system.
  • Download Selendroid server JAR file from above link. Also download Selendroid sample app from here.
  • Put both downloaded files in same directory. Open Command Prompt and go to the directory where both these files are stored.
  • Run below command in Command Prompt. It starts Selendroid server for the app under test.
  • Selendroid server gets started on running the above command. To check if Selendroid server is running correctly, go to http://localhost:4444/wd/hub/status URL in your browser. It should show connected devices, app details etc. similar to below screenshot.Selendroid Server
  • Create a Java project in your Eclipse and reference Selendroid client, server and TestNG JAR files.
  • Create a class file in your project and write below code. The app name displayed in Capabilities code is taken from ‘appId’ parameter shown in above image.
  • Run your test using TestNG.

Important point to note here. Selendroid requires following permission for the app.

That means your Android application’s Manifest file needs to have the above permission.

We hope you have enjoyed the above article about Selendroid setup in Eclipse IDE. We would love to hear your inputs in comment.

Comments
  1. Rajesh
  2. Rajesh
  3. nil
  4. Unch

Leave a Reply

Your email address will not be published.