Succesful element click returns malformed response
See original GitHub issueUsing WebdriverIO and Appium I’m able to click on an element successfully, e.g. a button in Calculator, but the response does not contain the expected NULL value. This results in WebdriverIO interpreting the click as failed.
According to the WC3 spec the click should "Return success with data null. " WinAppDriver is returning success, but is failing to return an explicit value of NULL.
https://w3c.github.io/webdriver/#element-click
An issue has been filed for WebdriverIO but I believe the issue is due to WinAppDriver.
https://github.com/webdriverio/webdriverio/issues/2775#issuecomment-428650139
This WebdriverIO sample recreates the error
describe('webdriver.io click one', () => {
it('should click the one button', () => {
const btn = driver.findElement('name', 'One');
driver.elementClick(btn['ELEMENT']);
})
});
This is the Appium output that illustrates the missing NULL value. The currently returned response is:
[debug] [WD Proxy] Got response with status 200: {"sessionId":"60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD","status":0}
More complete output below
[WinAppDriver] [STDOUT] ==========================================
[WinAppDriver] [STDOUT] POST /wd/hub/session/60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD/element/42.2755824.4.56/click HTTP/1.1
[WinAppDriver] [STDOUT] Accept: application/json, */*
[WinAppDriver] [STDOUT] Connection: close
[WinAppDriver] [STDOUT] Content-Length: 2
[WinAppDriver] [STDOUT] Content-Type: application/json; charset=utf-8
[WinAppDriver] [STDOUT] Host: 127.0.0.1:4724
[WinAppDriver] [STDOUT] User-Agent: appium
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] {}
[WinAppDriver] [STDOUT] HTTP/1.1 200 OK
[WinAppDriver] [STDOUT] Content-Length: 63
[WinAppDriver] [STDOUT] Content-Type: application/json
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] {"sessionId":"60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD","status":0}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD","status":0}
[WD Proxy] Replacing sessionId 60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD with 9b2575cd-7b8c-4786-afae-4e2353029430
[HTTP] <-- POST /wd/hub/session/9b2575cd-7b8c-4786-afae-4e2353029430/element/42.2755824.4.56/click 200 820 ms - 63
[HTTP]
[HTTP] --> POST /wd/hub/session/9b2575cd-7b8c-4786-afae-4e2353029430/element/42.2755824.4.56/click
[HTTP] {}
[MJSONWP (9b2575cd)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Matched '/wd/hub/session/9b2575cd-7b8c-4786-afae-4e2353029430/element/42.2755824.4.56/click' to command name 'click'
[debug] [WD Proxy] Proxying [POST /wd/hub/session/9b2575cd-7b8c-4786-afae-4e2353029430/element/42.2755824.4.56/click] to [POST http://127.0.0.1:4724/wd/hub/session/60D8F800-BEE0-42FF-B8DF-EA120FEAF7CD/element/42.2755824.4.56/click] with body: {}
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] ==========================================
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9
Top GitHub Comments
It would be wonderful if this could be addressed. Our team has had to implement a rather cumbersome workaround - we use a CLI tool written in C# to interact with WinAppDriver that our JS code then sends commands to and receives responses back from to process. It works, but it’s really hacky.
@hassanuz @timotiusmargo Is there any plan on fixing this? We have a test framework setup with webdriverIO which we would want to re-use for winapp UWP app. Any update on plans would be really appreciated!