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.
Problems with alt
Re: Problems with alt
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.
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...
-
- Posts: 9
- Joined: Thu Jul 25, 2013 3:29 pm
Re: Problems with alt
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:
I think the second line is what you mean?
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
Re: Problems with alt
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.
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.
Shortcuts usually aren't...
-
- Posts: 9
- Joined: Thu Jul 25, 2013 3:29 pm
Re: Problems with alt
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.
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.