Hello, i need some assistance. I’ve set up appium 1.5.0 with real device Android 4.2, automationName: selendroid. Everything looks fine except the following matter, no POST requests work properly.
[Selendroid] Getting window handles from Selendroid [JSONWP Proxy] Proxying [GET /window_handles] to [GET http://localhost:8200/wd/hub/session/5d634ee2-b134-39c0-175e-a9e408faa1c3/window_handles] with body: {} [JSONWP Proxy] Got response with status 200: "{\"value\":[\"NATIVE_APP\",\"WEBVIEW_0\"],\"status\":0,\"sessionId\":\"5d634ee2-b134-39c0-175e-a9e408faa1c3\"}" [Selendroid] Available contexts: ["NATIVE_APP","WEBVIEW_0"] [JSONWP Proxy] Proxying [POST /wd/hub/session/2cc6f275-7b34-434a-bea8-616a3b5ca8a5/element] to [POST http://localhost:8200/wd/hub/session/5d634ee2-b134-39c0-175e-a9e408faa1c3/element] with body: {"using":"id","value":"phone"} [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_0"] [HTTP] <-- GET /wd/hub/session/2cc6f275-7b34-434a-bea8-616a3b5ca8a5/contexts 200 318 ms - 98 [JSONWP Proxy] Got response with status 200: {"value":{"message":"CATCH_ALL: java.lang.NullPointerException\n\tat io.selendroid.server.util.Preconditions.checkNotNull(Preconditions.java:191)\n\tat io.selendroid.server.model.DefaultSelendroidD... [JSONWP Proxy] Replacing sessionId 5d634ee2-b134-39c0-175e-a9e408faa1c3 with 2cc6f275-7b34-434a-bea8-616a3b5ca8a5 [HTTP] <-- POST /wd/hub/session/2cc6f275-7b34-434a-bea8-616a3b5ca8a5/element 200 339 ms - 2946
Also, my conf is following:
exports.config = {
framework: 'jasmine', seleniumAddress: 'http://localhost:4723/wd/hub',
specs : ['tests/signin.js'],
capabilities: { 'browserName': '', 'appium-version':'1.5.0', 'platformName': "Android", 'platformVersion': "4.2", 'deviceName': "ALCATEL_ANDROID", 'app': "<my_app>.apk", 'app-package': "<my_app>.test", 'app-activity': ".QAShopTablet", 'automationName': "selendroid", 'autoWebview': true, "autoAcceptAlerts": true },
jasmineNodeOpts: { onComplete: null, isVerbose: false, showColors: true, includeStackTrace: true, defaultTimeoutInterval: 30000 },
allScriptsTimeout: 60000,
onPrepare: function () {
var wd = require('wd'), protractor = require('protractor'), wdBridge = require('wd-bridge')(protractor, wd); _ = require('underscore');
wdBridge.initFromProtractor(exports.config);
} };
And test is:
"use strict"; describe('signin', function () {
browser.ignoreSynchronization = true; browser.sleep(10000);
it('valid signin', function () {
browser.sleep(5000);
console.log('start'); wdBrowser.contexts();
console.log('here is the context' + wdBrowser.contexts()); wdBrowser.context('WEBVIEW_0'); console.log("Set context");
var phone = wdBrowser.elementById('phone'); phone.sendKeys("14081111111");
browser.sleep(3000);
var pass = wdBrowser.elementById('passcode'); pass.sendKeys('demo')
browser.sleep(3000);
var body = wdBrowser.elementByCss('[ng-click="login()"]');
console.log("click a button" + body); body.click();
browser.sleep(10000);
});
});
Protractor output:
Mac-Admin:bin admin$ node protractor /Users/admin/development/android-conf.js Using the selenium server at http://localhost:4723/wd/hub [launcher] Running 1 instances of WebDriver Started start here is the context[object Promise] Set context click a button[object Promise] A Jasmine spec timed out. Resetting the WebDriver Control Flow. F
Failures: 1) signin valid signin Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Stack: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. at Timer.listOnTimeout (timers.js:92:15)
1 spec, 1 failure Finished in 30.037 seconds [launcher] 0 instance(s) of WebDriver still running [launcher] #01 failed 1 test(s) [launcher] overall: 1 failed spec(s) [launcher] Process exited with error code 1