question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Succesful element click returns malformed response

See original GitHub issue

Using 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
Jack-Barrycommented, Aug 23, 2019

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.

image

0reactions
vagisha-nidhi195commented, Feb 14, 2022

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

element click intercepted Error in selenium
I ran into the same "ElementClickInterceptedError" error when running under certain situations such as through Task Scheduler where the browser ...
Read more >
Solutions to The Click Problem With Selenium & Java
Examine 7 different solutions you can use in the click problem - one of the most fundamental problems you may encounter during UI...
Read more >
Selenium Element Not Clickable At Point Exception - YouTube
Element Click Intercepted Exception, also known as Element Not ... In this video we answer the questions above while providing a code ...
Read more >
How to continue script when element is not found in selenium
Use findElements instead of findElement . findElements will return an empty list if no matching elements are found instead of an exception.
Read more >
HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found