WinAppDriver: SendKeys does not unescape double-slash

Repro steps: Use Element.SendKeys to enter a string including a single slash, e.g. “foo/bar”

Expected: WinAppDriver correctly enters foo\bar

Actual: WinAppDriver enters foo\\bar

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Aha - it doesn’t repro with the US keyboard.

Code executed: tb.SendKeys("`-=[]\\;',./~!@#$%^&*()_+{}|:\"<>? abcd \\\\ \\£ £ ££");

Result in text box: `-=[]\;',./~!@#$%^&*()_+{}|:"<>? abcd \\ \£ £ ££

Screenshot: image

[WinAppDriver] [STDOUT] ==========================================
[WinAppDriver] [STDOUT] POST /wd/hub/session/ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D/element/42.22875568/value HTTP/1.1
[WinAppDriver] [STDOUT] Accept: */*
[WinAppDriver] [STDOUT] Connection: keep-alive
[WinAppDriver] [STDOUT] Content-Length: 71
[WinAppDriver] [STDOUT] Content-Type: application/json
[WinAppDriver] [STDOUT] Host: 127.0.0.1:4724
[WinAppDriver] [STDOUT] User-Agent: appium
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] {"value":["`-=[]\\;',./~!@#$%^&*()_+{}|:\"<>? abcd \\\\ \\£ £ ££"]}
[WinAppDriver] [STDOUT] HTTP/1.1 200 OK
[WinAppDriver] [STDOUT] Content-Length: 63
[WinAppDriver] [STDOUT] Content-Type: application/json
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] {"sessionId":"ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D","status":0}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D","status":0}
[JSONWP Proxy] Replacing sessionId ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D with 5e3505f1-b586-4519-b83f-69a8760f4d3f
[HTTP] <-- POST /wd/hub/session/5e3505f1-b586-4519-b83f-69a8760f4d3f/element/42.22875568/value 200 3627 ms - 63
[HTTP] --> GET /wd/hub/session/5e3505f1-b586-4519-b83f-69a8760f4d3f/element/42.22875568/text {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/5e3505f1-b586-4519-b83f-69a8760f4d3f/element/42.22875568/text] to [GET http://127.0.0.1:4724/wd/hub/session/ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D/element/42.22875568/text] with body: {}
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] ==========================================
[WinAppDriver] [STDOUT] GET /wd/hub/session/ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D/element/42.22875568/text HTTP/1.1
[WinAppDriver] [STDOUT] Accept: */*
[WinAppDriver] [STDOUT] Connection: keep-alive
[WinAppDriver] [STDOUT] Content-Type: application/json
[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: 131
[WinAppDriver] [STDOUT] Content-Type: application/json
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] {"sessionId":"ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D","status":0,"value":"`-=[]\\;',./~!@#$%^&*()_+{}|:\"<>? abcd \\\\ \\£ £ ££"}
[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"ED30BC1A-AB0F-4808-BC6D-53A3BAE5731D\",\"status\":0,\"value\":\"`-=[]\\\\;',./~!@#$%^&*()_+{}|:\\\"<>? abcd \\\\\\\\ \\\\£ £ ££\"}"

Following up a feature request as a result of this - it would be very handy if WinAppDriver could switch the device into en-US keyboard layout at the start, and (possibly) switch back to the pre-test keyboard layout at the end.

Backslashes.

@HSAR, is this issue for back-slashes \ or forward-slashes /?