admc / wd

A node.js client for webdriver/selenium 2.
Other
1.53k stars 402 forks source link

driver.elements does not work with appium 1.9.0 #552

Closed infoneershalin closed 5 years ago

infoneershalin commented 5 years ago

Recent appium has changed response schema for findElements and hence driver.elements("id","someId") does not work with latest appium version 1.9.0

It throws exception with message:

no value passed to Element constructor

Earlier it was


[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:8200/wd/hub/session/72963c58-412f-485e-94bd-b28c3a4243ee/elements] with body: {"strategy":"id","selector":"com.example.android.contactmanager:id/showInvisible","context":"","multiple":true}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"72963c58-412f-485e-94bd-b28c3a4243ee","status":0,"value":[{"ELEMENT":"2afe249d-de43-4b58-a0a5-9c06279e1a60"}]}
[debug] [MJSONWP] Responding to client with driver.findElements() result: [{"ELEMENT":"2afe249d-de43-4b58-a0a5-9c06279e1a60"}]

And now


[HTTP] {"using":"id","value":"com.example.android.contactmanager:id/showInvisible"}
[W3C] Calling AppiumDriver.findElements() with args: ["id","com.example.android.contactmanager:id/showInvisible","165d90be-1afa-4fb3-8349-34202e8742c1"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[JSONWP Proxy] Matched '/elements' to command name 'findElements'
[JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:8200/wd/hub/session/77b966b2-3cc1-483e-88b4-b26d7faefb18/elements] with body: {"strategy":"id","selector":"com.example.android.contactmanager:id/showInvisible","context":"","multiple":true}
[JSONWP Proxy] Got response with status 200: {"sessionId":"77b966b2-3cc1-483e-88b4-b26d7faefb18","status":0,"value":[{"ELEMENT":"a83ab760-6ddf-46be-96f5-ffb39670dd7e"}]}
[W3C] Responding to client with driver.findElements() result: [{"element-6066-11e4-a52e-4f735466cecf":"a83ab760-6ddf-46be-96f5-ffb39670dd7e"}]

can anybody please let me know how to use https://github.com/admc/wd with appium 1.9.0

jlipps commented 5 years ago

It looks like a bug in appium's protocol handling. it's not supposed to use the w3c protocol with a client that is not intentionally speaking it. please report this with a full set of logs at the appium issue tracker.