appium / ruby_lib

:gem: Ruby library for Appium
http://rubygems.org/gems/appium_lib
216 stars 160 forks source link

Double-click action sends incorrect request body #974

Closed AaronC81 closed 7 months ago

AaronC81 commented 1 year ago

This is a

Summary

When using driver.action.double_click.perform, ruby_lib makes a POST request to /doubleclick with an empty JSON body. WinAppDriver does not accept this and reports an unknown error:

POST /wd/hub/session/883E3086-A3CC-48D2-8978-B0CD8A450C4D/doubleclick HTTP/1.1
Accept: application/json
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Connection: close
Content-Length: 2
Content-Type: application/x-www-form-urlencoded
Host: 127.0.0.1:4723
User-Agent: appium/ruby_lib/9.0.0

{}
HTTP/1.1 500 Internal Error
Content-Length: 133
Content-Type: application/json

{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}

On the other hand, Appium-Python-Client sends a body with a sessionId key, and this works successfully:

POST /wd/hub/session/150C0F01-DF0D-40A1-AFDE-70EF79A2A194/doubleclick HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Connection: keep-alive
Content-Length: 53
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: appium/python 1.3.0 (selenium/3.141.0 (python windows))

{"sessionId": "150C0F01-DF0D-40A1-AFDE-70EF79A2A194"}
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json

{"sessionId":"150C0F01-DF0D-40A1-AFDE-70EF79A2A194","status":0}

/doubleclick also works when sending no body at all, using cURL.

I don't know for certain what WinAppDriver is actually doing with this body, but it looks like the Ruby library should send either an empty body, or a body with a sessionId key.

Environment

Actual behaviour and steps to reproduce

  1. Connect to WinAppDriver
  2. Use driver.action.double_click.perform
  3. Observe the exception on the Ruby end, and an error in the logs of WinAppDriver

Expected behaviour

Double clicks as expected with no exception

Link to Appium/Ruby logs

https://gist.github.com/AaronC81/bdd3332168ddbe8b5a3e0cb42c1055a7

KazuCocoa commented 1 year ago

Maybe it was in selenium webdriver side's something. What about v11? (Maybe selenium v4 based Ruby client v12 (latest version) does not have the endpoint)

KazuCocoa commented 7 months ago

https://github.com/search?q=repo%3ASeleniumHQ%2Fselenium+double_click+language%3ARuby&type=code&l=Ruby The latest selenium client perhaps does not have the endpoint.