Problems with alt

Bug reports.
Patrick Kunst
Posts: 9
Joined: Thu Jul 25, 2013 3:29 pm

Problems with alt

Post by Patrick Kunst » Fri Jul 26, 2013 10:34 am

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.

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

Re: Problems with alt

Post by krstcs » Fri Jul 26, 2013 1:28 pm

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

Patrick Kunst
Posts: 9
Joined: Thu Jul 25, 2013 3:29 pm

Re: Problems with alt

Post by Patrick Kunst » Fri Jul 26, 2013 1:49 pm

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?

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

Re: Problems with alt

Post by krstcs » Fri Jul 26, 2013 2:12 pm

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

Patrick Kunst
Posts: 9
Joined: Thu Jul 25, 2013 3:29 pm

Re: Problems with alt

Post by Patrick Kunst » Fri Jul 26, 2013 2:29 pm

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.

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

Re: Problems with alt

Post by krstcs » Fri Jul 26, 2013 2:31 pm

Excellent! You are welcome!
Shortcuts usually aren't...