Telerik Test Studio - How to send a simple ESC key?

224 views Asked by At

I've tried a few things that I found online but I'm not able to just send a simple KeyPress of the "ESC" key into my tests.

I just want to send the "ESC" key on my C# test code and using Telerik Test studio to run the test.

What do I need? Isn't this enough??

SendKeys.Send("{ESC}");
1

There are 1 answers

0
sameer shaik On

STEP 1 : Add an Assembly Reference to System.Windows.Forms (in case it's not already added)

STEP 2 : In place of - SendKeys.Send("{ESC}");

Use this code below:

Manager.Desktop.KeyBoard.SendString("{ESC}");