Showing posts with label NPM. Show all posts
Showing posts with label NPM. Show all posts

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
     

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.