Image CAPTCHA
Enter the characters shown in the image.

You are here

Activate Appium using Java

Appium is a very promising tool when it comes to mobile automation. I have given it a try for about 6 months when I was working on a mobile testing framework for my company. Appium comes in many client bindings (Java, C#, Python and Ruby) which offer a lot of features, but they lack the ability to start the server in an automated way which means that it has to be done manually.

In order to make running mobile test cases a fully automated process, I had to automate starting and stopping the Appium server along with the correct server arguments.

In this post, I will share my experience on how to do that programmatically using Java programming language.

Prerequisites:

  • Appium executable: You can download the latest builds for Windows & Mac. For older releases, please click here.
  • Java Development Kit (JDK): You can download it from here.

Starting the server:

First of all you are going to need a command line executor tool. You have two options, either use Java's built-in Process class or Apache Commons Exec. The first option provides basic functionality to run command lines across different platforms. The second option is build on the basic java Process class, but it provides more advanced functions on how to monitor the started application and to kill it after some time. For the sake of simplicity, I am gonna use the first option.

Before I move any further, you need to know that Appium server is a JavaScript based server that is built using NodeJS, so in order to start it, you have to invoke the NodeJS server and pass the Appium's JavaScript server file. After that you need to pass your Appium server arguments that will customize the server instance with your specific configurations. You don't need to worry as Appium comes bundled with its supported version of NodeJS server, so you won't need to download anything or do any extra work.

Assuming that you have your Appium source in the following directory:"C:\Appium", here is the code snippet that will start the Appium server with its configurations:

Process p = Runtime.getRuntime().exec("\"C:/Appium/node.exe\" \"C:/Appium/node_modules/appium/bin/Appium.js\" --no-reset --local-timezone");

The appium server arguemnts are optional and you can start the server without them (It will start with the default arguments). For a list of all Appium server arguments, please refer to the following link.

Stopping the server:

Since you can start more than one server instance at the same time and run tests simultaneously, your server stopping mechanism needs to be smart enough to stop the correct server instance without affecting other running servers.

Assuming that you are running Appium server locally on your machine, in order to stop the correct Appium server, you need to know the correct port number of the server instance. I will assume that you used the default Appium server port number (4723).

Here is a code snippet on how you can do this:

Process p = Runtime.getRuntime().exec("cmd /c echo off & FOR /F \"usebackq tokens=5\" %a in (`netstat -nao ^| findstr /R /C:\"4723\"`) do (FOR /F \"usebackq\" %b in (`TASKLIST /FI \"PID eq %a\" ^| findstr /I node.exe`) do taskkill /F /PID %a)");

 

Code Example:

You can find a code example performing the previous steps here. The code is licensed under the Apache License, Version 2.0. Feel free to edit or share it with others.

About The Author: 

Automation Testing Engineer at Vodafone International Services (VIS)


 

Displaying 1 - 20 of 70
Title Company Scope Application Rights User Interface Available Supported Technologies Maturity
eggPlant Functional TestPlant Monitoring Tool; Testing Tool; Emulator Commercial; Demo; Floating license; Static license; Subscription; Trial GUI usability; Integrated into ALM; Plugin; Remote Execution; Stand Alone application Adobe Flash; Adobe Flex; AJAX; Dot.NET; Java App; Java GUI; Image Verification; Mobile Applications; Android apps; Blackberry apps; Hybrid Apps; iPhone apps; Native Apps; Symbian apps; Web Apps; Windows Mobile apps; Mobile Features; RIA; Silverlight; Swing; Web; DHTML; HTML; SWT; Windows GUI/Forms 2,008
Googletest GitHub project Test Automation Framework Free Use; Opensource COM API 2,008
Ranorex Integrated Test Automation Tools Ranorex Test Automation Framework; Testing Tool; Testing Utility Commercial; Demo; Floating license; Static license; Trial Command Line; GUI usability; Integrated into IDE; Stand Alone application Adobe Air; Adobe Flash; Adobe Flex; AJAX; Dot.NET; Java; Java App; Java GUI; Java SWT; JavaFX; ComponentOne controls; Delphi App; Echo; Ext.Net; GWT; Image Verification; Infragistics; JSON; Microsoft Visual FoxPro; Mobile Applications; Android apps; Hybrid Apps; iPhone apps; Native Apps; Web Apps; Windows Mobile apps; Mobile Features; GPS testing; Mobile Bluetooth; Android; IOS; MochiKit; PowerBuilder; Qt; RIA; SAP; Sencha Touch; Silverlight; SmartClient; VB App; Web; DHTML; DHTMLX; HTML; HTML5; JavaScript; jQuery; Web2.0; Xpath; Windows GUI/Forms; ActiveX; MFC; Win32; Windows 10 Apps; WPF/XAML; YUI; ZK 2,007
Dynatrace AppMon Dynatrace LLC Monitoring Tool; Testing Tool Cloud Service; Commercial; Trial SaaS Client; Stand Alone application; Web based 2,003
Robotium GitHub project, Robotium Tech Test Automation Framework Free Use; Opensource Mobile Applications; Android apps; Hybrid Apps; Native Apps; Mobile Features; Android 2,010
M-eux Test Jamo Solutions Testing Tool; Tool Extension Commercial; Demo; Trial COM API; Integrated into ALM; Integrated into IDE; Stand Alone application; Tool Extension Mobile Applications; Android apps; Blackberry apps; Hybrid Apps; iPhone apps; Native Apps; Windows Mobile apps; Mobile Features 2,008
UISpec Google Code Projects Test Automation Framework Free Use; Opensource Mobile Applications; iPhone apps 2,010
SIGOS Mobile Testing Dynatrace LLC Cloud Service; Testing Tool Commercial; Periodic license Service; Web based Mobile Applications; Android apps; iPhone apps; Windows Mobile apps; Mobile Features; Android; IOS 1,995
T-PLAN ROBOT T-Plan Testing Tool Commercial; Demo Command Line; Plugin; Server based; Stand Alone application C/C++; Dot.NET; Java; Mobile Features; HTML 1,989
Android SDK Android Test Automation Framework; Testing Tool; Emulator; Simulator Free Use; Opensource Command Line; GUI usability; Integrated into IDE; Tool Extension Android apps; Mobile Features 2,009
SilkTest Micro Focus Software, Inc. Test Automation Framework Commercial; Demo; Free Use; Trial GUI usability; Integrated into ALM; Integrated into IDE; Plugin; Stand Alone application AJAX; Java; Mobile Applications; Android apps; iPhone apps; Native Apps; Web Apps; Mobile Platforms; Android; IOS; Silverlight; Web; AngularJS; HTML; HTML5; Web2.0; Windows GUI/Forms 1,994
Rapise Inflectra Testing Tool; Automate Gui; Simulator Commercial; Demo; Static license; Trial; User license COM API; Command Line; Direct UI; Integrated into ALM; Integrated into IDE; Remote Execution; Stand Alone application Adobe Air; Adobe Flash; Adobe Flex; Flex4; AJAX; Dot.NET; Java; Database; ODBC; Google Web Framework; GWT; Mobile Applications; OCR; Protocols; REST; SOAP; RESTful app; Web; HTML; HTML5; jQuery; Windows GUI/Forms; ActiveX; Win32; WPF/XAML; YUI 2,009
Google Toolbox for Mac GitHub project, Google Code Projects Test Automation Framework; Tool Extension Free Use; Opensource Batch Mode; Plugin; Remote Execution Mobile Applications; iPhone apps; Mobile Features; IOS 2,008
GUITAR Sourceforge Test Automation Framework Free Use; Opensource Plugin; Web based iPhone apps; Mobile Features; IOS; Swing 2,005
iPhoney Marketcircle, Sourceforge Testing Utility; Emulator; Simulator Free Use; Opensource Web based Mobile Applications; iPhone apps; Web Apps; Mobile Features; IOS 2,007
SeeTestAutomation Experitest Testing Tool; Emulator Commercial; Demo; Trial COM API; Plugin; Tool Extension Mobile Applications; Android apps; Blackberry apps; Hybrid Apps; iPhone apps; Native Apps; Web Apps; Windows Mobile apps; Mobile Features 2,008
TOSCA Testsuite TRICENTIS Management Tool; Test Management; Testing Tool Commercial; Demo; Trial GUI usability; Stand Alone application AWT; Dot.NET; Java; ODBC; Delphi App; EDIFACT standard; Gupta; IDocs; Mobile Applications; Android apps; iPhone apps; Mobile Features; Mobile Platforms; Android; IOS; PowerBuilder; REST; SOAP; SAP; mySAP HTML; SAP Gui; Siebel; SOA; Swing; Terminal Emulator 3270; Terminal Emulator 5250; VB App; Web; HTML; Windows GUI/Forms; MSExcel; MSOutlook; WPF/XAML 2,008
Silk Performer Micro Focus Software, Inc. Testing Tool Commercial; Trial GUI usability; Stand Alone application Adobe Flash; Adobe Flex; AJAX; Silverlight; Web; Web2.0 1,994
Sikuli GitHub project Test Automation Framework; Testing Tool Demo; Free Use; Opensource Command Line; GUI usability; Integrated into IDE; Stand Alone application Java; Image Verification; Mobile Applications; Android apps; Blackberry apps; Hybrid Apps; iPhone apps; Native Apps; Web Apps; Windows Mobile apps; RubyOnRails 2,010
Test Studio Telerik By Progress Test Management; Test Automation Framework; Testing Tool Commercial; Floating license; Trial GUI usability; Integrated into ALM; Integrated into IDE; Stand Alone application; Tool Extension AJAX; Mobile Applications; Native Apps; Web Apps; Silverlight; Web; AngularJS; ASP; CSS; DHTML; DHTMLX; HTML; HTML5; HTTP; JavaScript; Windows GUI/Forms; Win32; WPF/XAML 2,002

Pages

MANUFACTURERS Wallboard

View MANUFACTURERS Wallboard

Total Manufacturers in our archive: 280
Testing tool manufacturers world-wide list
10Levels ABID CONSULTING AccelQ Accord Software ActiMind AdaCore
AdaLog AgileLoad AgileWay Agitar Algorismi ALL4TEC
Andreas Kleffel Android Apache Apica Apollo Systems AppAssist.mobi
Applitools AppPerfect Appsee ApTest Assertible Assure
Atlassian AutoIt Consulti .. Automation Anyw .. Automation Cons .. Axosoft Aztaz Software
Backtrace I/O Badboy BlazeMeter Borvid BrowserStack BSQUARE
BStriker Intern .. CA Technologies Canonical Canoo Engineeri .. Catch Software CelestialTeapot
Chris Mallett Cleanscape ClicTest CloudQA Codeborne CodeCentrix
CodePlex projec .. Codoid Cogitek Compuware Configure IT Conflair
ConSol Core Services Coronys Ltd Countersoft CresTech Softwa .. CrossBrowserTes ..
Crosscheck Netw .. Crowdsourced Te .. Cucumber Ltd Cyara Cygnet Infotech DareBoost
Databene Datamatics Glob .. DevExpress DTM soft Dynatrace LLC EasyQA
Eclipse EkaTechserv Elvior Emmanuel Jorge Empirix EPAM Systems
Equafy Esterel Technol .. eXept Software .. Experitest Finaris Froglogic
FrontEndART Ltd GeneXus GitHub project gnoso Google Code Pro .. GrammaTech
Gurock Software HelpSystems HENIX Hewlett Packard .. Hexawise High-Tech Bridg ..
Hiptest Hitex IBM Rational imbus Shanghai Impetus Inflectra
informUp InTENSO - IT Ex .. Ipswitch Jamo Solutions Janova JAR Technologie ..
JBoss Developer jClarity Jellly.io JetBrains Jively jQuery foundati ..
JS Foundation Jspresso Kanoah KMS Technology Kualitee LDRA Limited
Litmus LoadFocus Loadster Perfor .. MarathonITE Marketcircle Marketcircle
Maveryx Meliora Ltd Micro Focus Sof .. Microsoft Mobile Labs Mobile1st
Mockaroo, LLC Monkop Mozila MSys Technologi .. Navicat NeoTys
Neowise Softwar .. NetCart NORIZZK.COM Novosync Mobili .. NRG Global NTT Resonant
OC Systems Odin Technology OpCord Oracle Orcanos Original Softwa ..
OW2 PANAYA Parasoft PassMark Patterson Consu .. Perfecto Mobile
Pivotal, Inc. Plutora Postman (API To .. PractiTest PrimaTest Process One
Programming Res .. Psoda PureLoad PushToTest Python Q-Assurance
QA Systems QACube QASymphony QAWorks QMetry Quali
Qualitia Softwa .. Quality First S .. Quotium RadView Softwar .. Ranorex RedLine13
Reflective Solu .. ReQtest RevDeBug Robotium Tech Rogue Wave Soft .. Rommana Softwar ..
RTTS ruby-doc.org Runscope Sandklef GNU La .. Sauce Labs Seapine Softwar ..
SeleniumHQ Sencha Sensiple Siemens PLM Sof .. SmartBear Softw .. SmarteSoft
SOASTA SoftLogica Softomotive Softsmith Solution-Soft SonarSource
Sourceforge Spirent Technol .. SQS Software Qu .. Square Stimulus Techno .. Swifting AB
Synopsys T-komp T-Plan TechExcel TechTalk Telerik By Prog ..
Tellurium Test Collab Test Goat Test Recon TestCaseLab testCloud.de Gm ..
TestCraft Techn .. Testenium Testim.io TestingBot TestLodge Testmunk
Testomato TestOptimal TestPlant TestPro Testsigma Techn .. Testuff
The Core Bankin .. The MathWorks The Open Group thePHP.cc Thoughtbot Thoughtworks
Tigris.org Time Simulator Top-Q Trace Technolog .. TrendIC TRICENTIS
Tritusa Pty Ltd TWD Solutions P .. TypeMock Tyto Software Ubertesters UniTESK
Universal Test .. Usetrace Ltd Utrecht Univers .. Validata Group Vanamco AG Vector Software
Veracode Verifaya Corpor .. Verit VersionOne Viewlike.us Vornex Inc.
Watir.com WcfStorm Soluti .. We Are Mammoth Web Performance .. Wintask Wireshark Found ..
Worksoft Xceptance XK72 Xpand IT XQual ZAPTEST
Zeenyx Software .. Zephyr Zeta Software zutubi pty

Appium YouTube Movies

Theme by Danetsoft and Danang Probo Sayekti