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

keypress combinations

3 Answers 302 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
C4I Consultants
Top achievements
Rank 1
C4I Consultants asked on 23 Jun 2015, 04:39 PM

New to Test Studio and we're trying to record a specific keyboard combination of Ctrl + Alt + Shift + P.

How would I go about creating a test step?

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 23 Jun 2015, 07:51 PM
Hello,

First I'd like to understand what it is you're trying to accomplish, why do you want to press such an odd combination of keys?

That particular combination cannot be recorded. Instead it can be accomplished through a coded step like this:
Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.LControlKey);
Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Alt);
Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.LShiftKey);
Manager.Desktop.KeyBoard.TypeText("P");
Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.LShiftKey);
Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Alt);
Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.LControlKey);


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Kristin
Top achievements
Rank 1
answered on 05 Feb 2016, 09:01 PM
Using the example above results in a compilation error on Forms. What is the correct way to press the spacebar or tab in a coded step?
0
Boyan Boev
Telerik team
answered on 09 Feb 2016, 01:53 PM
Hi Kristin,

What compilation error do you get?

Please note that you should add a reference assembly to System.Windows.Forms.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
C4I Consultants
Top achievements
Rank 1
Answers by
Cody
Telerik team
Kristin
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or