Page 1 of 1

Problems with alt

Posted: Fri Jul 26, 2013 10:34 am
by Patrick Kunst
During the test which I am trying to automate, I have to test the Key "alt". During the test this is no problem and all works fine but after the test case was finished I have the problem that the alt-key seems still be pressed.
So I first have to press the key again to interact normal.

Re: Problems with alt

Posted: Fri Jul 26, 2013 1:28 pm
by krstcs
How are you "pressing" the ALT key during the test?

If you are doing a KeyShortcut Down ->{ALT}, then you need to also do a KeyShortcut Up -> {ALT} at the end of the test or the system doesn't think you every stopped pressing the key.

Re: Problems with alt

Posted: Fri Jul 26, 2013 1:49 pm
by Patrick Kunst
Thank you for your reply. I recorded the test with Ranorex, so it should be done automatically, shouldn't it?
Here are the first and last codelines from the generated code:

Code: Select all

//Do some stuff
repo.AuftragHinzufuegenDE.TabControl1.GridControl.PressKeys("{LWin down}l");
//Do other stuff
 repo.AuftragHinzufuegenDE.TabControl1.GridControl.PressKeys("{Lkey}{LMenu up}");
//Do some more stuff
I think the second line is what you mean?

Re: Problems with alt

Posted: Fri Jul 26, 2013 2:12 pm
by krstcs
Take a look at the Ranorex API...

http://www.ranorex.com/Documentation/Ra ... ssKeys.htm

This gives a pretty good description of the use of the PressKeys function, including how to use it with modifier keys like ALT, CTRL, and SHIFT.


But, looking at just the example you provided, you don't let the LWin key UP.

For every down, there has to be an up.

And, yes, Ranorex should be doing this for you, but it sometimes gets confused during key recording. I very rarely use the record feature for anything, preferring to create all my test modules manually, but that's just me. :D

Re: Problems with alt

Posted: Fri Jul 26, 2013 2:29 pm
by Patrick Kunst
Thank you for your help now it works fine.
There was a down more than an up. After I added another up the problem was still there, so I disabled it all, and added a new action. I recorded the Keystroke and now there are the same numbers of up and downs.

Re: Problems with alt

Posted: Fri Jul 26, 2013 2:31 pm
by krstcs
Excellent! You are welcome!