java-client
java-client copied to clipboard
Matched JSONWP error code 7 to NoSuchElementError
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
https://github.com/appium/appium/issues/10917