Problem with Key Sequence

Ask general questions here.
User avatar
giuseppe.lacagnina
Posts: 113
Joined: Fri Sep 18, 2015 10:25 am
Location: Brunn am Gebirge, Vienna, Austria

Problem with Key Sequence

Post by giuseppe.lacagnina » Thu Nov 19, 2015 11:24 am

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!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Problem with Key Sequence

Post by odklizec » Thu Nov 19, 2015 12:05 pm

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 ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
giuseppe.lacagnina
Posts: 113
Joined: Fri Sep 18, 2015 10:25 am
Location: Brunn am Gebirge, Vienna, Austria

Re: Problem with Key Sequence

Post by giuseppe.lacagnina » Thu Nov 19, 2015 2:41 pm

Thanks! I will try all the above :-)

Cheers,

Giuseppe

User avatar
giuseppe.lacagnina
Posts: 113
Joined: Fri Sep 18, 2015 10:25 am
Location: Brunn am Gebirge, Vienna, Austria

Re: Problem with Key Sequence

Post by giuseppe.lacagnina » Thu Nov 19, 2015 3:06 pm

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.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Problem with Key Sequence

Post by krstcs » Thu Nov 19, 2015 8:42 pm

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.
Shortcuts usually aren't...