Page 1 of 1

Problem with Key Sequence

Posted: Thu Nov 19, 2015 11:24 am
by giuseppe.lacagnina
Dear All,

I have a problem with Key Sequence. I am running Ranorex Studio on Win7 64 bit and doing tests with a QT application and a browser both (IE).

In all cases, when I use Key Sequence to fill a field, sometimes the string which is typed in is incomplete.
For example, if it is "Document Name", sometimes Ranorex will type

"Document Na"
"Document Nam"
"Docu"

or similar substrings. Is there a way to avoid this?
Thanks!

Re: Problem with Key Sequence

Posted: Thu Nov 19, 2015 12:05 pm
by odklizec
Hi,

What's your actual setting of "Use asynchronous dispatching of mouse and keyboard events"? You can find this option in General Settings >> Advanced tab. By default, it should be ON. If you have it enabled, try to disable it, but I believe 'enabled' state should produce more reliable mouse and keyboard results.

Another thing you might try is using SetValue action, which is generally more reliable way of setting values to controls, than using key sequence. I'm personally using key sequence only for few special inputs with enabled OnKeyPress event, where SetValue fails to trigger OnKeyPress event ;)

Re: Problem with Key Sequence

Posted: Thu Nov 19, 2015 2:41 pm
by giuseppe.lacagnina
Thanks! I will try all the above :-)

Cheers,

Giuseppe

Re: Problem with Key Sequence

Posted: Thu Nov 19, 2015 3:06 pm
by giuseppe.lacagnina
The trick of using Set Value worked.

However, a colleague pointed out to me that this is not equivalent to typing.
In the test we want to reproduce the typing: after all, it is also part of the interface
we are testing.

I believe that Key Sequence should somehow be made to work properly.

Re: Problem with Key Sequence

Posted: Thu Nov 19, 2015 8:42 pm
by krstcs
I would agree with your colleague, using Set Value should only be done when absolutely necessary because you don't actually exercise the UI the way a real user would.

Using Key Sequence and Mouse Click are the most appropriate way to handle testing a UI. If they aren't working then there is probably something wrong with the UI.

The other consideration is that Set Value and PerformClick do not fire events in many situations where a Mouse Click or Key Sequence would. Again, you aren't testing the UI thoroughly if you use that method.