How to test native Android app with Protractor
Asked Answered
V

1

11

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?

Vinasse answered 10/11, 2014 at 19:31 Comment(0)
A
5

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.

Anthurium answered 14/11, 2014 at 22:30 Comment(1)
Can you please give links to examples of frameworks? I'm ready to rewrite tests, just show me tools :)Vinasse

© 2022 - 2024 — McMap. All rights reserved.