Winappdriver: Sendkeys with a \ is being converted to #

Created on 26 May 2017  Â·  12Comments  Â·  Source: microsoft/WinAppDriver

Hi

I have just tried to run the NotepadTest example and found that when sample tries to save the document to %TEMP%\NotepadTestOutputFile.txt what I see happening is %TEMP%#NotepadTestOutputFile.txt which saves to the wrong place and fails the test.

Any advice?

Regards

Enhancement

Most helpful comment

Workaround: string Backslash = Keys.Alt + Keys.NumberPad9 + Keys.NumberPad2 + Keys.Alt;

All 12 comments

Hi @beatsm, This is interesting. Are you running the test on the machine with standard US keyboard layout selected?

No, UK keyboard layout.

Regards

Get Outlook for Androidhttps://aka.ms/ghei36


From: Timotius Margo notifications@github.com
Sent: Thursday, June 1, 2017 7:15:53 PM
To: Microsoft/WinAppDriver
Cc: beatsm; Mention
Subject: Re: [Microsoft/WinAppDriver] Sendkeys with a \ is being converted to # (#194)

Hi @beatsmhttps://github.com/beatsm, This is interesting. Are you running the test on the machine with standard US keyboard layout selected?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/WinAppDriver/issues/194#issuecomment-305575941, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADQA19HHOZHuHG3fRR0s1eHPJ2UamArqks5r_v_ZgaJpZM4Nns1g.

I see. At the moment WinAppDriver is only supporting a standard US keyboard layout as specified in the Selenium JSON Wire Protocol spec

In your machine with the UK keyboard layout, the backslash code is mapped to a different character that generates the behavior you saw. A workaround is to set the test machine to have the standard US keyboard layout.

Thanks

I hope this will be fixed in time.

Apparently pressing alt gr + # should send a . I will test and report back.

Regards


From: Timotius Margo notifications@github.com
Sent: Thursday, June 1, 2017 8:22:41 PM
To: Microsoft/WinAppDriver
Cc: beatsm; Mention
Subject: Re: [Microsoft/WinAppDriver] Sendkeys with a \ is being converted to # (#194)

I see. At the moment WinAppDriver is only supporting a standard US keyboard layout as specified in the Selenium JSON Wire Protocol spechttps://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue

In your machine with the UK keyboard layout, the backslash code is mapped to a different character that generates the behavior you saw. A workaround is to set the test machine to have the standard US keyboard layout.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/WinAppDriver/issues/194#issuecomment-305594343, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADQA12S1jrvRWN25R_CJd0Evck8bB2K4ks5r_w-BgaJpZM4Nns1g.

Hi,

Unfortunately I have not been able to work and changing the keyboard on the test machine (my own while I am developing) is a pain.

Is it on the road map to fix this as I don't have this problem with Chrome Driver or FireFox driver.

Regards

Hi @timotiusmargo & @beatsm ,

We are also facing the same issue ? Any updates regarding this issue ?

I'm using norwegian (ÆØÅ), same issue, I can use norwegian in driver calls like .find_element_by_name("Søk") but not in .send_keys(), no issue with other webdrivers.

Workaround: string Backslash = Keys.Alt + Keys.NumberPad9 + Keys.NumberPad2 + Keys.Alt;

I guess this is a general issue. I am using a german keyboard, and sending "/n/AFI/DIC Monitor"
via send_keys results in "-n-AFI-DIC Monitor" on the screen.

{"text": "/n/AFI/DIC_Monitor", "value": ["/", "n", "/", "A", "F", "I", "/", "D", "I", "C", "_", "M", "o", "n", "i", "t", "o", "r"], "id": "42.10161586", "sessionId": "B4E10E0B-9069-498E-B1BC-FC4EEAB770A4"} HTTP/1.1 200 OK

@timotiusmargo Seems you changed to using the local keyboard layout, which is worse in some situations. Couldn't you just enter the charachters sent as it is, and not as a virtualised click on the actual phisical button that would have the given char on it if it were a US keyboard? Because now hitting those keys sends weird characters from my own language. Or add a sendString() like call?

Hit this problem and sending Alt-92 triggered an autocomplete drop down. (probably something to do with numeric keypad 2 being a down arrow)

Ended up using a forward slash as a workaround.

Will this ever be fixed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdesousa picture mdesousa  Â·  4Comments

SanjeevKumarmn picture SanjeevKumarmn  Â·  4Comments

hassanuz picture hassanuz  Â·  4Comments

sky205 picture sky205  Â·  3Comments

tomw93 picture tomw93  Â·  4Comments