appium / appium/java-client

Matched JSONWP error code 7 to NoSuchElementError

Open
#1,129 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

I am working on real android device and my code was not working with uiautomator2 on chrome app but uiautomator is ok , i started getting error Matched JSONWP error code 7 to NoSuchElement.

Environment

java client build version : 6.1.0
Appium server version : 1.11.0
Desktop OS/version : mac os
Node.js version : 9.2.1
Mobile platform/version under test: 8.1.0
Real device or emulator/simulator: Real device

Details

When i switched to uiautomator2,i started getting error of Matched JSONWP error code 7 to NoSuchElementError;but if i switched to uiautomator,it worked ok .

Code To Reproduce Issue [ Good To Have ]

public LoginPage homePageLogin_in(){
    swipeUp(100);
    driver.context("NATIVE_APP");

    WebElement element=driver.findElement(By.id("home:home-btn"));
    wait(element).click();

    return gotoPage(LoginPage.class);
}

Ecxeption stacktraces

[HTTP] <-- POST /wd/hub/session/8103799b-3630-425e-b5a9-b8ba4faed415/element 404 351 ms - 495
[HTTP]
[HTTP] --> POST /wd/hub/session/8103799b-3630-425e-b5a9-b8ba4faed415/element
[HTTP] {"using":"id","value":"home:user-btn"}
[W3C (8103799b)] Calling AppiumDriver.findElement() with args: ["id","home:user-btn","8103799b-3630-425e-b5a9-b8ba4faed415"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://localhost:8200/wd/hub/session/d5c8f924-4baf-4271-a347-ed07c1e7369e/element] with body: {"strategy":"id","selector":"home:user-btn","context":"","multiple":false}
[WD Proxy] Got an unexpected response: {"sessionId":"d5c8f924-4baf-4271-a347-ed07c1e7369e","status":7,"value":"An element could not be located on the page using the given search parameters."}
[MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[W3C (8103799b)] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
[W3C (8103799b)] at AndroidUiautomator2Driver.helpers.findElOrEls (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-android-driver/lib/commands/find.js:75:11)
[W3C (8103799b)] at process._tickCallback (internal/process/next_tick.js:68:7)

Link to Appium logs

https://gist.github.com/herry-ff/216a6627a79bfe217cf8de859738f897

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Java client, Appium server, Android version, reproduction method, and stack trace. Inspect the logged findElement request and appium-android-driver/lib/commands/find.js, then compare the uiautomator2 and uiautomator behavior using the supplied logs. Done means establishing a reproducible java-client issue with a defined failing case or documenting that the problem is outside this repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.