This is a migrated thread and some comments may be shown as answers.

Complex Keypress combination fails to work

2 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 09 May 2013, 10:32 AM
We have a WPF application we are trying to automate and I am having trouble performing complex key presses. We have a control that responds to CTRL+ALT+SHIFT+T which works when manually entered however using both of the 2 different methods below it fails to work. Please note that simpler 3 key combos work on the same control using Method 2 below but I have not tried using method 1.

Method 1
control.User.Click(MouseClickType.LeftClick);
var keys = ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("SHIFT+CTRL+ALT+T");
AtlasApp.Manager.Desktop.KeyBoard.KeyPress(keys, 500);

Method 2         
control.User.Click(MouseClickType.LeftClick);
AtlasApp.Manager.Desktop.KeyBoard.KeyDown(Keys.Control);                   
AtlasApp.Manager.Desktop.KeyBoard.KeyDown(Keys.Alt);
AtlasApp.Manager.Desktop.KeyBoard.KeyDown(Keys.Shift);
AtlasApp.Manager.Desktop.KeyBoard.KeyPress(Keys.T);
AtlasApp.Manager.Desktop.KeyBoard.KeyUp(Keys.Shift);
AtlasApp.Manager.Desktop.KeyBoard.KeyUp(Keys.Alt);
AtlasApp.Manager.Desktop.KeyBoard.KeyUp(Keys.Control);

2 Answers, 1 is accepted

Sort by
0
Accepted
Velin Koychev
Telerik team
answered on 09 May 2013, 03:50 PM
Hi Max,

The problem with this keyboard shortcut is based on a bug that prevents Alt key to be triggered in Manager.Desktop.KeyBoard.KeyPress or Manager.Desktop.KeyBoard.KeyDown. There is already logged a bug report, which you can follow on our Feedback portal.

Unfortunately I was not able to find any work-around in your case (when you need to use a keyboard shortcut with Alt and two more keys). I hope that in the next  R1 2013 release of Test Studio,  that is expected to come in June, this problem will be fixed. 

I apologize for the inconvenience with the Alt key.

Greetings,
Velin Koychev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 10 May 2013, 06:39 AM
Thank you for quick response.

Current WorkAround is :
System.Windows.Forms.SendKeys.SendWait("+^%(T)");
Tags
General Discussions
Asked by
Max
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Max
Top achievements
Rank 1
Share this question
or