question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

android (UiAutomator2): cannot get available timeouts

See original GitHub issue

The problem

When I try to get available timeouts in my hybrid app on android I get an error:

[HTTP] --> GET /wd/hub/session/333fbb2d-f981-49da-a36e-d5a8b4246677/timeouts
[HTTP] {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/333fbb2d-f981-49da-a36e-d5a8b4246677/timeouts] to [GET http://localhost:8205/wd/hub/session/5a834c1a-cee8-4b50-8bf1-56998c90e534/timeouts] with body: {}
[MJSONWP] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - ""
[MJSONWP]     at doJwpProxy$ (/Users/dudkevich/job/projects/dudkevich/FEI-10277_pp-test/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:456:13)
[MJSONWP]     at tryCatch (/Users/dudkevich/job/projects/dudkevich/FEI-10277_pp-test/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP]     at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/dudkevich/job/projects/dudkevich/FEI-10277_pp-test/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/dudkevich/job/projects/dudkevich/FEI-10277_pp-test/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP]     at GeneratorFunctionPrototype.invoke (/Users/dudkevich/job/projects/dudkevich/FEI-10277_pp-test/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP]     at <anonymous>
[HTTP] <-- GET /wd/hub/session/333fbb2d-f981-49da-a36e-d5a8b4246677/timeouts 500 34 ms - 269

Reproduced in both contexts: native and hybrid. Moreover I get the same error with UiAutomator driver but only in webview context.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.9.1
  • Last Appium version that did not exhibit the issue (if applicable): -
  • Desktop OS/version used to run Appium: Mac Os
  • Node.js version (unless using Appium.app|exe): 8.6.0
  • Mobile platform/version under test: android 6.0
  • Real device or emulator/simulator: emulator
  • Appium CLI or Appium.app|exe: cli

Link to Appium logs

logs

Code To Reproduce Issue [ Good To Have ]

'use strict';

const webdriverio = require('webdriverio');

const browser = webdriverio.remote({
    port: '4723',
    baseUrl: 'https://yandex.ru/search/touch',

    desiredCapabilities: {
        platformName: 'Android',
        platformVersion: '6.0',
        deviceName: 'Android Emulator',
        automationName: 'UiAutomator2',
        nativeWebScreenshot: true,
        showChromedriverLog: true,
        appPackage: 'ru.yandex.searchplugin.dev',
        appActivity: 'ru.yandex.searchplugin.MainActivity',
        intentAction: 'android.intent.action.VIEW',
        optionalIntentArguments: '--esn data ya-search-app-open://?uri=https://yandex.ru/search/touch'
    }
});

browser
    .init()
    .timeouts()
    .then((timeouts) => console.log('TIMEOUTS:', timeouts))
    .end()
    .catch((e) => {
        console.log('EEEEERRRRROOOOOORRRRR:', e);
        return browser.end();
    })

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mykola-mokhnachcommented, Nov 5, 2018

getTimeouts is a W3C command and chromedriver operates in MJSONWP mode. That is why this endpoint does not work there. However for UIA2 driver the fix should be simple

0reactions
lock[bot]commented, Nov 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

implicitlyWait and appWaitActivity not working in uiautomator2
It is a way to set timeout for pulling DOM when trying to find an element(s) if it is not immediately available.
Read more >
[UiAutomator2] The instrumentation process cannot be ...
Original error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash ...
Read more >
appium/appium - Gitter
Hello, I am getting waiting for androidx.test.runner.AndroidJUnitRunner, available targets android.support.test.runner.AndroidJUnitRunner. I think the error ...
Read more >
appium-uiautomator2-driver - npm
platformName, Could be set to android . Appium itself is not strict about this capability value if automationName is provided, so feel free...
Read more >
Waiting in UiAutomator - Alex Ilyenko's Blog
until element is available SearchCondition<UiObject2> isAvailable ... UiDevice, similarly to Selenium's WebDriver , represents Android ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found