The findElementFromElement() function is executed unexpectedly on iOS sumulator (NoSuchElementError)


#1

Hello there, I run into a problem while executing my tests on iOS simulator.
The findElementFromElement() function executed instead of findElement().
React-native 0.57.5
Appium 1.12.1
webdriverio 4.14.0
Any suggestion here?
Here is my iOS log:

[MJSONWP (381a4495)] Calling AppiumDriver.findElementFromElement() with args: ["accessibility id","SendAgainButton","31000000-0000-0000-A636-000000000000","381a4495-9b7d-4ace-952d-8df1c0f248fb"]
[XCUITest] Executing command 'findElementFromElement'
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 0 ms for condition
[WD Proxy] Matched '/element/31000000-0000-0000-A636-000000000000/element' to command name 'findElementFromElement'
[WD Proxy] Proxying [POST /element/31000000-0000-0000-A636-000000000000/element] to [POST http://localhost:8100/session/83FCD27B-1C8F-4FA4-A168-7921E0B5136A/element/31000000-0000-0000-A636-000000000000/element] with body: {"using":"accessibility id","value":"SendAgainButton"}
[HTTP] --> POST /wd/hub/session/381a4495-9b7d-4ace-952d-8df1c0f248fb/element/31000000-0000-0000-A636-000000000000/element
[HTTP] {"using":"accessibility id","value":"SendAgainButton"}
[MJSONWP (381a4495)] Calling AppiumDriver.findElementFromElement() with args: ["accessibility id","SendAgainButton","31000000-0000-0000-A636-000000000000","381a4495-9b7d-4ace-952d-8df1c0f248fb"]
[XCUITest] Executing command 'findElementFromElement'
[WD Proxy] Got response with status 200: {"value":{"using":"accessibility id","value":"SendAgainButton","description":"unable to find an element"},"sessionId":"83FCD27B-1C8F-4FA4-A168-7921E0B5136A","status":7}
[WD Proxy] Got an unexpected response: {"value":{"using":"accessibility id","value":"SendAgainButton","description":"unable to find an element"},"sessionId":"83FCD27B-1C8F-4FA4-A168-7921E0B5136A","status":7}
[MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 0 ms for condition
[WD Proxy] Matched '/element/31000000-0000-0000-A636-000000000000/element' to command name 'findElementFromElement'
[WD Proxy] Proxying [POST /element/31000000-0000-0000-A636-000000000000/element] to [POST http://localhost:8100/session/83FCD27B-1C8F-4FA4-A168-7921E0B5136A/element/31000000-0000-0000-A636-000000000000/element] with body: {"using":"accessibility id","value":"SendAgainButton"}
[MJSONWP (381a4495)] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
[MJSONWP (381a4495)]     at XCUITestDriver.doNativeFind (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:130:13)
[MJSONWP (381a4495)]     at process._tickCallback (internal/process/next_tick.js:68:7)
[HTTP] <-- POST /wd/hub/session/381a4495-9b7d-4ace-952d-8df1c0f248fb/element/31000000-0000-0000-A636-000000000000/element 500 3687 ms - 164

The same code is working on android well.
And android log:

[MJSONWP (cc1ac46c)] Calling AppiumDriver.findElement() with args: ["accessibility id","SendAgainButton","cc1ac46c-3b07-4515-a2ff-bfda2dd66461"]
[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/b531a3f9-dcf1-4dd0-beed-c2baca7b898d/element] with body: {"strategy":"accessibility id","selector":"SendAgainButton","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"b531a3f9-dcf1-4dd0-beed-c2baca7b898d","status":0,"value":{"ELEMENT":"aa78b0ec-74fa-47ea-8978-537a4ded5e6f"}}
[MJSONWP (cc1ac46c)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"aa78b0ec-74fa-47ea-8978-537a4ded5e6f","ELEMENT":"aa78b0ec-74fa-47ea-8978-537a4ded5e6f"}
[HTTP] <-- POST /wd/hub/session/cc1ac46c-3b07-4515-a2ff-bfda2dd66461/element 200 1934 ms - 199

#2

Hi @Maksim_Isaev, I am running in to this issue. May I know if you found a solution for this? Thanks


#3

Hey @babraham! Yep, I’ve found it.
There was a problem when I was tryig to combine the old version of webdriverio (4 version) with the newest version of wdio libraries (for i. wdio-local-runner or wdio-cucumber-framework). After I’ve changed whole of my wdio libraries to 4 version the problem has gone.