Tuesday 2 October 2018

Install Appium on Mac

To install Appium first we need to install the latest version of Java , Homebrew, Node in Mac.

JAVA Installation

  • Download the latest version of java 8 .dmg from Oracle Java 8
  • Double click the DMG file and Double click the JDK 8 install icon.

Open Terminal and run:
Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Carthage


 brew install carthage

Install Node
brew install node

Install Appium
npm install -g appium

To execute Test in Android Emulator, Please refer my other posts:

For IOS - Install Xcode
  • Goto the Mac Appstore and search for Xcode and click the Get button.
  • After installation, install the Commandline Tools.
  • Open a terminal and run
xcode-select --install


Wednesday 22 November 2017

Identify your Device, Package and Activity Name

Device , package and activity names etc are required to initiate Android Driver instance as Desired capabilities.

Device Name is required to connect the device.
Package and activity names are required to connect the APK.

We can get Device, package and activity names from ADB, Android Debug Bridge, which is a command-line utility included with Google's Android SDK.
If you don't have Android SDK tools and packages installed please refer POST  Appium - Install SDK tools and packages

Please connect your android device and make sure USB debugging is enabled. Enable Developer Options in Android

Device Name
Open cmd prompt and run the below command

adb devices
*Note: if Android path is not setup then please navigate to the android_sdk\platform-tools



Package and Activity Name
Run below command

adb shell


adb dumpsys window windows | grep -E ‘mCurrentFocus|mFocusedApp’
*Note: Please make sure that before running the above command your phone must be unlocked and desired application is open.



Other way to get Package and Activity Name:

  1. Go to Android Play Store > Download and Install APK Info application

     
  2.  Search the desired application and long press on it.

     
  3. Long presssing the selection, opens the Detailed Information popup > go to Detailed Information.
     

     
  4. Look for APK path
     

  5. Look for Activities
     

Wednesday 8 November 2017

Enable Developer Options in Android

To allow USB debugging we have to enable Developer Options in Android Settings. By default it is not enabled. Inside Developer options will get an option to allow USD debugging.

Enable Developer Options
  1. Go to Settings

     
  2. Go to Setting > About phone

     
  3. Go to Setting> About phone > Device Information

     
  4. Click 7 times on Build Number to enable developer option

     


Allow USB debugging
  1. In Setting, go to Developer Option

     
  2. Look for USB debugging and enable(ON) it

     

Tuesday 7 November 2017

Appium - Install SDK tools and packages

In this post we will install android SDK tools and required packages to run test cases in android device.

Introduction:

SDK Manager

SDK manager which is a command line tool to view, install, update, and uninstall packages for the Android SDK .
The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in android_sdk/tools/bin/. To install update and uninstall packages use below commands.

Install Packages
sdkmanager packages [options]
Update all Packages
sdkmanager --update [options]
Uninstall Packages
sdkmanager --uninstall packages [options]
Android SDK download
  1. Go to download section of official website of Android Studio, scroll down to the end of the page. Select the platform specific installer.
     
  2. Agree terms and condition to download the zip.
     
  3. Extract the zip to a specific location, you will see tools directory.
     
  4. Open command prompt and navigate to the android_sdk/tools/bin/ directory and run command
    sdkmanager "platform-tools" "platforms;android-26" "build-tools;27.0.1"
     
  5. Accept terms and condition and proceed.

  6.  On completion will see new packages in our sdk root directory.

Android Home and Path Setup

Set PATH variables for android_sdk/tools and android_sdk/platform-tools in environment variables.
That is,  go to Control Panel\System and Security\System> Advanced system settings > Environment variables
ANDROID_HOME: android_sdk directory

Path: %ANDROID_HOME%\platform-tools\;%ANDROID_HOME%\tools\

Monday 6 November 2017

Appium Server setup and installation on windows

Installing appium server is the first step to setup appium framework to execute tests on emulators/real devices. 

Appium Introduction
Appium is an open source test automation framework for use with native, hybrid and mobile web apps. 
It drives iOS, Android, and Windows apps using the WebDriver protocol.

Architecture
Appium works on client/server architecture, It receives request from a client, listens for commands, executes those commands on a mobile device emulator /real, and responds with an HTTP response as a result of the command execution.

Setup Appium Server
Appium is a server written in Node.js. It can be built and installed from source or installed directly from NPM

Steps:
  1. Download latest nodejs installer for windows MSI (version >= 6.0) from here and install.
  2. Add nodejs paths in your PATH environment variable. Path should be specified up-to the parent directory and should be like:
    Path: C:\Program Files\nodejs

  3. Open admin cmd prompt, Run the below command which will install Appium from NPM.
    npm install -g appium
    




  4. To start Appium, you can now simply run below command from the cmd prompt.
    appium




  5. On successful server startup you will see the appium version and port

In next post we will continue with Additional Setup required for Android App Testing.

Sunday 5 November 2017

Appium Tutorial

Setup Appium, Selenium 3, Eclipse on Windows

Please follow the sequence to configure android test project with Appium and Eclipse


Eclipse + Appium Setup

  1. Setup Appium and Eclipse
  2. Run first Test prject in Appium, Selnium, Eclipse

Others

  1. How to find Elements in mobile application