Just wanted to know, anyone using Appium version 1.14.0 with Android 8.0 or later?
Actually, I'm having an issue, where the driver is unable to find out the third party web view window elements. But I can see and access web view elements on appium inspector.
It was working fine on Android 6.0. And it started failing from Android 7.0, 8.0 or later!
if anyone has any solutions, please let me know.
Third-party web view window means, In our application, if a user clicks on the HELP button we show web view window(Not the browser). It's an in-app web view window.
Appium version: 1.14.0
Android - 8.0
Chrome Driver: 2.44
"mobile: scroll", {"element": element, "toVisible": True}
)
An example:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
views/profile.py:58: in sign_out_button
self.move(ProfileReference.sign_out_button)
views/base.py:23: in move
actions.perform()
../../miniconda2/envs/mobile/lib/python3.7/site-packages/selenium/webdriver/common/action_chains.py:80: in perform
self.w3c_actions.perform()
../../miniconda2/envs/mobile/lib/python3.7/site-packages/selenium/webdriver/common/actions/action_builder.py:76: in perform
self.driver.execute(Command.W3C_ACTIONS, enc)
../../miniconda2/envs/mobile/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute
self.error_handler.check_response(response)
../../miniconda2/envs/mobile/lib/python3.7/site-packages/appium/webdriver/errorhandler.py:29: in check_response
raise wde
../../miniconda2/envs/mobile/lib/python3.7/site-packages/appium/webdriver/errorhandler.py:24: in check_response
super(MobileErrorHandler, self).check_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <appium.webdriver.errorhandler.MobileErrorHandler object at 0x113d4bc18>
response = {'status': 500, 'value': '{"value":{"error":"unknown error","message":"An unknown server-side error occurred while pro...m.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:235:19)"}}'}
The code that went with it
element = self.driver.find_element_by_accessibility_id(locator[1])
actions = ActionChains(self.driver)
actions.move_to_element(element)
actions.click(element)
actions.perform()
Then the output device's delegate (here, self) has to implement the callback
Net::ReadTimeout:
Net::ReadTimeout with #<TCPSocket:(closed)>
[0-0] 2019-09-10T08:26:59.937Z ERROR webdriver: Request failed due to session not created: A new session could not be created. Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: 'capabilities' are mandatory for session creation
at getErrorFromResponseBody (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/webdriver/build/utils.js:215:10)
at Request._callback (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/webdriver/build/request.js:103:64)
at Request.self.callback (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:185:22)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at Request.<anonymous> (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:1161:10)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at IncomingMessage.<anonymous> (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:277:13)
[0-0] 2019-09-10T08:26:59.940Z ERROR @wdio/runner: session not created: A new session could not be created. Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: 'capabilities' are mandatory for session creation
at getErrorFromResponseBody (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/webdriver/build/utils.js:215:10)
at Request._callback (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/webdriver/build/request.js:103:64)
at Request.self.callback (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:185:22)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at Request.<anonymous> (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:1161:10)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at IncomingMessage.<anonymous> (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:277:13)
0-0 worker error { name: 'session not created',
message:
'A new session could not be created. Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: \'capabilities\' are mandatory for session creation',
stack:
'session not created: A new session could not be created. Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: \'capabilities\' are mandatory for session creation\n at getErrorFromResponseBody (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/webdriver/build/utils.js:215:10)\n at Request._callback (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/webdriver/build/request.js:103:64)\n at Request.self.callback (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:185:22)\n at Request.emit (events.js:189:13)\n at Request.EventEmitter.emit (domain.js:441:20)\n at Request.<anonymous> (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:1161:10)\n at Request.emit (events.js:189:13)\n at Request.EventEmitter.emit (domain.js:441:20)\n at IncomingMessage.<anonymous> (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/request/request.js:1083:12)\n at Object.onceWrapper (events.js:277:13)' }
[0-0] 2019-09-10T08:26:59.941Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'capabilities' of null
at Runner.run (/Users/gromanas/lotteryie/CtpIENativeApp/node_modules/@wdio/runner/build/index.js:68:74)
at process._tickCallback (internal/process/next_tick.js:68:7)
const { generate } = require('multiple-cucumber-html-reporter');
const { removeSync } = require('fs-extra');
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
exports.config = {
specs: [
'./test/features/**/*.feature'
],
// Patterns to exclude.
exclude: [
'./test/features/ui/**/*.feature'
],
logLevel: 'silent',
deprecationWarnings: true,
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'cucumber',
reporters: ['dot', 'spec',
[ 'cucumberjs-json', {
jsonFolder: './test/output/json/',
},
],
],
cucumberOpts: {
require: [
'./test/step_definitions/common.js',
'./test/step_definitions/dashboard.js',
'./test/step_definitions/dbg.header.js',
'./test/step_definitions/dbg.playslip.js',
'./test/step_definitions/dbg_number_picker.js',
'./test/step_definitions/home.js',
'./test/step_definitions/hooks.js',
'./test/step_definitions/jackpot.js',
'./test/step_definitions/login.js',
'./test/step_definitions/playhub.js',
'./test/step_definitions/register.js',
'./test/step_definitions/screenshot.js',
'./test/step_definitions/set_wiremock.js'
], // <string[]> (file/dir) require files before executing features
backtrace: false, // <boolean> show full backtrace for errors
requireModule: [], // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
dryRun: false, // <boolean> invoke formatters without executing steps
failFast: false, // <boolean> abort the run on first failure
format: ['pretty'], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
colors: true, // <boolean> disable colors in formatter output
snippets: true, // <boolean> hide step definition snippets for pending steps
source: true, // <boolean> hide source uris
profile: [], // <string[]> (name) specify the profile to use
strict: false, // <boolean> fail if there are any undefined or pending steps
tagExpression: '(not @wip)', // <string> (expression) only execute the features or scenarios with tags matching the expression
timeout: 400000, // <number> timeout for step definitions
ignoreUndefinedDefinitions: true, // <boolean> Enable this config to treat undefined definitions as warnings.
defaultTimeoutInterval: 10000
},
services: ['native-app-compare'],
nativeAppCompare: {
// Mandatory
baselineFolder: '.dist/image-compare/baseline',
screenshotPath: '.dist/image-compare/screenshots',
// Optional
autoSaveBaseline: true,
blockOutIphoneXBottomBar: true,
blockOutStatusBar: true,
blockOutNavigationBar: true,
savePerDevice: true,
rawMisMatchPercentage: true
},
onPrepare() {
removeSync('./test/output/');
},
beforeSession: () => {
require('@babel/register');
},
before() {
global.expect = chai.expect;
global.assert = chai.assert;
global.should = chai.should();
global.chaiAsPromise = chai.use(chaiAsPromised);
},
onComplete() {
// Generate the report when it all tests are done
generate({
// Required
// This part needs to be the same path where you store the JSON files
// default = '.tmp/json/'
jsonDir: './test/output/json/',
reportPath: './test/output/report/',
openReportInBrowser: true,
displayDuration: true,
// for more options see https://github.com/wswebcreation/multiple-cucumber-html-reporter#options
});
}
};
and the setup for android local is
const { config } = require("./wdio.shared.conf");
config.services = config.services.concat('appium');
config.port = 4723;
config.capabilities = [
{
maxInstances: 1,
platformName: "android",
platformVersion: "8.0",
deviceName: "Galaxy S9 Plus HD API 26",
unicodeKeyboard: true,
app: "android/app/build/outputs/apk/release/app-release.apk",
'cjson:metadata': {
device: "Galaxy S9 Plus HD API 26",
app: {
name: "****",
version: "1.0"
},
platform: {
name: "android",
version: "8.0"
}
}
}
];
exports.config = config;
and the devDependencies
"devDependencies": {
"@babel/core": "7.5.5",
"@babel/plugin-proposal-decorators": "7.4.4",
"@babel/plugin-transform-runtime": "7.5.5",
"@babel/preset-env": "7.5.5",
"@babel/register": "7.5.5",
"@babel/runtime": "7.5.5",
"@lingui/cli": "2.8.3",
"@react-native-community/eslint-config": "0.0.5",
"@testing-library/react-hooks": "2.0.1",
"@wdio/appium-service": "5.12.1",
"@wdio/cli": "5.12.5",
"@wdio/cucumber-framework": "5.12.3",
"@wdio/dot-reporter": "5.12.1",
"@wdio/local-runner": "5.12.5",
"@wdio/sauce-service": "5.12.5",
"@wdio/spec-reporter": "5.12.1",
"@wdio/sync": "5.12.3",
"@welldone-software/why-did-you-render": "3.3.3",
"appium": "1.14.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.3",
"babel-jest": "24.9.0",
"babel-plugin-functional-hmr": "1.0.25",
"babel-plugin-macros": "2.6.1",
"babel-plugin-module-resolver": "3.2.0",
"babel-plugin-transform-remove-console": "6.9.4",
"body-parser": "1.19.0",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"chance": "1.1.0",
"enzyme-to-json": "3.4.0",
"eslint": "6.3.0",
"eslint-config-airbnb": "18.0.1",
"eslint-plugin-flowtype": "4.2.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.14.3",
"eslint-plugin-react-hooks": "2.0.1",
"eslint-plugin-react-native": "3.7.0",
"eslint-plugin-react-native-a11y": "1.2.0",
"flow-bin": "0.106.3",
"fs-extra": "8.1.0",
"husky": "3.0.5",
"jest": "24.9.0",
"jest-extended": "0.11.2",
"jest-styled-components": "6.3.3",
"jetifier": "1.6.4",
"live-server": "1.2.1",
"metro-react-native-babel-preset": "0.56.0",
"metro-with-symlinks": "1.3.2",
"minimist": "1.2.0",
"multiple-cucumber-html-reporter": "1.13.0",
"ng-apimock": "1.4.9",
"prettier-eslint": "9.0.0",
"react-test-renderer": "16.8.6",
"reactotron-react-native": "3.6.5",
"reactotron-redux": "3.1.1",
"wdio-cucumber-snippet-reporter": "0.0.5",
"wdio-cucumberjs-json-reporter": "1.0.8",
"wdio-native-app-compare-service": "1.1.0",
"yarn-check": "0.0.3"
},