Appium Setup from Scratch
Appium is an open source test automation tool developed and supported by Sauce Labs to automate native and hybrid mobile apps. It is basically known as a Cross-Platform Mobile Automation Tool. It uses JSON wire protocol internally to interact with iOS and Android native apps using the Selenium WebDriver.
Please Note that the below setup has been done and tested on MAC OS Make sure you have the latest mac (since xcode version is dependent on your mac os version) version and your editor is updated
- Install Brew, Node & npm on your machine via iterm
brew tap caskroom/versions
brew install carthage
brew install node
npm install -g npm
Check the Node & npm version
2. Install Latest Version of Java. I am installing Java 8 because it is the LTS Version (Long Term Support)
brew cask install java8
3. Install Appium and Web driver globally
npm install -g appium
npm install wd
4. Download JDK Latest Version
6. Install IntelliJ IDEA, and Go to File -> Project Structure -> Upload the JDK from local machine
Android Automation, We need to install the
Android StudioAndroid Studio
- Update System Preferences, Open bash_profile in terminal:
Paste the below :
SAVE AND EXIT TERMINAL
3. Check that JAVA_HOME and ANDROID_HOME is set:
4. Open the
Android Studio and go to
Preferences -> System Settings -> Android SDK & Download the Necessary Package.
5. I use
Genymotion Virtual Emulator for Android and i love it. You will ❤️ it too.
Follow the Steps to install Genymotion : https://docs.genymotion.com/Content/01_Get_Started/Installation.htm
- Launch Genymotion and Click “Settings”→ ADB and set the path for Android-SDK.
- Add a New Virtual Device by clicking on the “Add” button
- Select the Virtual Device Created and Click “Start”.
- Launch Appium and Navigate to Android Settings. Change the Capabilities as per the selected Virtual device.
- Launch the Appium Inspector.
- To check the devices attached to the local machine
- Install the apk file to emulator
- Install the
$ xcode-select --install
$ sudo xcode-select --reset
$ sudo xcode-select --switch /Applications/Xcode.app
$ brew install libimobiledevice --HEAD
There is also a dependency, made necessary by Facebook’s WebDriverAgent, for the Carthage dependency manager.
$ brew install carthage
Deviceconsole allows analyzing crash logs and console output from the device
$ npm install deviceconsole
Install and debug iPhone apps from the command line, without using Xcode
$ brew install ios-deploy
Xcpretty is a fast and flexible formatter for xcodebuild
$ gem install xcpretty
You need to authorize use of the iOS Simulator. If you’re only testing Android, this can be skipped.
$ npm install -g authorize-ios
- Launch the IOS Simulator by opening XCODE or Launch it through command Line
See all the Available Simulator Devices Created along with
xcrun simctl list
Install and Launch the Application
xcrun simctl install <YOUR-DEVICE-ID> <PATH-TO-APPLICATION-BUNDLE>
xcrun simctl launch <YOUR-DEVICE-ID> <BUNDLE-ID-OF-APP-BUNDLE>
xcrun simctl help
Verify Appium Installation is Successful
appium-doctor to verify that all of Appium’s dependencies are met :
$ npm install -g appium-doctor
$ appium-doctor --ios
$ appium-doctor --android
- Install the
Inspector that you can use to look at your app's elements, get basic information about them, and perform basic interactions with themI Suggest the Following based on my experience :
This is first among the series of posts related to Appium and Mobile. Please let me know your feedback and suggestion.
I hope you find this setup useful in powering your mobile automation tests.What are the exciting ideas that you have related to mobile automation — and how are you implementing them? Let us know in the comments.
If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter or Facebook. Thank you!