How to test native Android app with Protractor

2.2k Views Asked by At

I have native Android app, built with Ionic, so e2e tests are written with Protractor and works fine with hybrid version of application.
I'm trying to figure out, if it's possible to run these tests against native app on Android device (or, at least, emulator/avd)?

I've tried Appium - no luck, it's trying to run browser on device. I don't need it.

Selendroid:
java -jar path-to-selendroid.jar -app path-to.apk
it executes, but when I start Protractor, it's trying to run some AndroidDriver Webview App (with Selendroid logo) instead of my app, so all tests failing. Config of protractor:

seleniumAddress: 'http://localhost:4444/wd/hub',
baseUrl:         'http://10.0.2.2:8000',
capabilities:    {
    browserName: 'android'
},

Is it possible at all? Or best what I can hope is run mobile browser on device by Appium/Selendroid?

1

There are 1 best solutions below

1
On

As you pointed, you want to test an Android native application. You would need to use other framework for testing native apps.

On the other way, Protractor "is an end-to-end test framework for AngularJS applications". http://angular.github.io/protractor/#/

So, it runs on a browser. The browser could be on your PC with WebDriver on your phone with AndroidDriver. But never a native application.