Page 1 of 1

Alt button accesses File menu in the application

Posted: Tue Sep 13, 2016 1:51 pm
by phaneendra
Hi Team,

When I use: Keyboard.Press(Keys.LMenu) /* alt key */ it tries to access the File menu of the application.

Please let me know what can be done for this?

Br,
Phanee

Re: Alt button accesses File menu in the application

Posted: Thu Sep 15, 2016 3:54 pm
by asdf
Hi Phaneendra,

Unfortunately, I'm not exactly sure what you're trying to achieve.
Could you please give us a bit more information about your issue?

Best regards,
asdf

Re: Alt button accesses File menu in the application

Posted: Fri Sep 16, 2016 5:39 am
by phaneendra
Hi,

We have a WPF application with graphical interface.

In the graphical interface, when I switch between different commands, we use the windows ALT key functionality to switch between scenarios.

I am trying to automate the functionality with ranorex. And, in the code to do this process, I have used:

Keyboard.Press(Keys.LMenu) to achieve this behavior.

But, when I do this, the automation process access the 'File' menu of the WPF application.

I am unable to solve what's going wrong.

Br,
Phaneendra.

Re: Alt button accesses File menu in the application

Posted: Fri Sep 16, 2016 1:24 pm
by krstcs
This is the expected behavior from Windows applications. If you press and release the ALT key, the focused application's main menu will be opened. This is Windows OS functionality, not Ranorex.

Re: Alt button accesses File menu in the application

Posted: Mon Sep 19, 2016 7:57 am
by phaneendra
Thanks,

yes, I understand it's the default windows behavior.

But, If I use the similar steps with the instant recording from ranorex studio, the above problem doesn't appear.

If I use this code sample in my project, the problem occurs.

I am keen to know, if the ranorex studio uses some settings to suppress these default windows actions.

Best regards,
Phanee.

Re: Alt button accesses File menu in the application

Posted: Mon Sep 19, 2016 1:40 pm
by krstcs
Ranorex does not do anything to the default Windows settings unless you specifically direct it to.

In your case, I would right-click the working version's action and select "View Code". This will show you what the actual code-behind looks like so you can get an idea of how Ranorex is using the method call.

Re: Alt button accesses File menu in the application

Posted: Mon Sep 19, 2016 1:44 pm
by phaneendra
Yes, I did the similar way how you've suggested (copying the text displayed under code-behind), but it doesn't help.

I am not sure how can I solve this. But, I see something ranorex does with the delays.

infact, If I add more delays, it works perfect.

Br,
Phanee.

Re: Alt button accesses File menu in the application

Posted: Mon Sep 19, 2016 1:47 pm
by krstcs
Ah, yeah, timing issues are probably 75%, or more, of the problems in getting test automation to work right.

Re: Alt button accesses File menu in the application

Posted: Mon Sep 19, 2016 2:04 pm
by phaneendra
Hmm, we should try to normalize these with some delays(hopefully a trail & error method).

Br,
Phanee