[QA] Is it possible to send actual keypresses instead of strings?

Nikolas Everett neverett at wikimedia.org
Thu Sep 12 15:07:07 UTC 2013


I've had no trouble sending \n in the past but haven't tried any
combinations like ctrl-alt-p.  I'm pretty sure send_keys can send any
utf-8 character you feed it so long as your ruby file is declared
utf-8.  See https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCirrusSearch.git/master/tests%2Fbrowser%2Ffeatures%2Fsupport%2Fbuild_pages.rb#L9
where I send the "white pawn" character.

I'm not sure sending the actual keys would be all the productive any
way unless visual editor itself (not the operating system) is doing
something special with keypresses for that language.  From my somewhat
limited experience with Japanese typing is handled by programs outside
the browser that drop characters into it once you've decided that they
are correct.  You'd be testing an operating system feature.  Worse
yet, in the example of Japanese there are (at least) two keyboard
layout techniques that translate my familiar American keyboard into
Japanese, one based on English phonetics (mostly two strokes per
hiragana character) and one designed for mostly single stroke per
hiragana character.  You still need other key presses to change the
hiragana to katakana or the particular kanji that you meant but the
problem remains - when you do send_key :a_key which keyboard layout do
you mean to use?  When you want to select kanji from the list is it
two presses of the "squash" character to turn your hiragana to the
kanji you want or three?

I can certainly see us wanting to make sure that, for example, the
squashing process used to build kanji doesn't cause visual editor to
go crazy and throw characters on different lines while the user picks
from their list, but for the most part questions like did sending the
sequence "w a t a s i h a <squash>" spit out "私は" is the operating
systems problem.

Nik

On Thu, Sep 12, 2013 at 12:25 AM, James Forrester
<jforrester at wikimedia.org> wrote:
> I believe Inez (copied) from Wikia who is working on VisualEditor said that
> the Java Selenium driver could do this, but that others generally couldn't…
> but that could be me mis-remembering.
>
>
> On 11 September 2013 21:17, Amir E. Aharoni <amir.aharoni at mail.huji.ac.il>
> wrote:
>>
>> If I understand correctly, Selenium's send_keys send strings or characters
>> rather then actual keypresses.
>>
>> Is there a way to send actual keypresses? It's useful for testing
>> different keyboard layouts. See my question on StackOverflow about it:
>> http://stackoverflow.com/questions/18754576/can-i-use-seleniums-send-keys-or-some-other-function-to-send-actual-keys-rather
>> --
>> Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי
>> http://aharoni.wordpress.com
>> ‪“We're living in pieces,
>> I want to live in peace.” – T. Moore‬
>>
>> _______________________________________________
>> QA mailing list
>> QA at lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/qa
>>
>
>
>
> --
> James D. Forrester
> Product Manager, VisualEditor
> Wikimedia Foundation, Inc.
>
> jforrester at wikimedia.org | @jdforrester
>
> _______________________________________________
> QA mailing list
> QA at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/qa
>



More information about the QA mailing list