On Wed, Sep 11, 2013 at 9:25 PM, James Forrester
<[email protected]>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.
>

Every language that has full support for WebDriver (Java, C#, Python, Ruby)
should support the full range of DOM events:
http://www.w3schools.com/jsref/dom_obj_event.asp

Here is an example of a WIP test for the very latest VisualEditor using
"fire_event(onfocus)", now required to enable the "Save page" button when
doing send_keys to the contentEditable field of the editor:
https://gerrit.wikimedia.org/r/#/c/83817/6/modules/ve-mw/test/browser/features/step_definitions/visual_editor_steps.rb
(line
46)

It is common to need these events from time to time to exercise browsers
properly.  For example, you could explicitly emulate an action with

page.content_element.fire_event('onfocus')
page.content_element.fire_event('onkeydown')
page.content_element.send_keys('H')
page.content_element.fire_event('onkeyup')
page.content_element.fire_event('onkeydown')
page.content_element.send_keys('i')
page.content_element.fire_event('onkeyup')

but in practice you'll rarely need that kind of fine control.

-Chris



>
>
> On 11 September 2013 21:17, Amir E. Aharoni 
> <[email protected]>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
>> [email protected]
>> https://lists.wikimedia.org/mailman/listinfo/qa
>>
>>
>
>
> --
> James D. Forrester
> Product Manager, VisualEditor
> Wikimedia Foundation, Inc.
>
> [email protected] | @jdforrester
>
> _______________________________________________
> QA mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/qa
>
>
_______________________________________________
QA mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/qa

Reply via email to