Saturday, 19 December 2015

Execute protractor script on real android device using Appium


Prerequisite: 
1. Protractor is already installed.
    Protractor installation steps http://automation-home.blogspot.com/2015/11/protractor-installation.html

3. Java JDK can be downloaded and installed from       http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

4. Set the Environment variable for JAVA
    https://docs.oracle.com/javase/tutorial/essential/environment/paths.html 
    http://www.javatpoint.com/how-to-set-path-in-java

5. Install Android SDK

6. Set the Environment variable for Android SDK.

7. Configuring 'Protractor' in 'WebStorm IDE'.
     Running the 'Protractor' script in 'WebStorm'.
     http://automation-home.blogspot.com/2015/11/configuring-protractor-in-webstorm.html

8. Install Appium Server for windows os.

9. Install Phone Drivers

10. Enable Developer options in the mobile device.

11. Enable USB Debugging in Mobile Device.
    http://automation-home.blogspot.com/2015/12/enable-developer-options.html


Protractor script and configuration changes:
1. Copy 'todo-spec.js' and 'conf.js' from url http://www.protractortest.org/#/

2. Modify the 'conf.js' to include the appium configuration.
Conf.js:
exports.config = {
    seleniumAddress: 'http://localhost:4723/wd/hub',
    specs: ['todo-spec.js'],

    capabilities: {
        browserName: 'chrome',
        platformName: 'android',
        //platformVersion: '',
        deviceName: ''
    }
};

4. Connect real android device to your PC.

5. Run 'adb devices' and verify abd detects your android mobile device.

6. Launch Appium Server

7. Execute the protractor script.
        - Protractor script is executed on your real android device.

1 comment:

  1. can we test using emulator without connecting the device..if so...plz produce the steps...thanks in advance

    ReplyDelete