New to Telerik Test Studio Dev EditionStart a free 30-day trial

Send Keystorkes

I want to send keystrokes like Alt+F4.

Solution

Here is the full code-behind file, excluding the standard using/Imports statements and the Dynamic Pages Reference region:

C#
    using System.Windows.Forms;
    
    namespace TestProject8
    {     
        public class SendKeystrokes : BaseWebAiiTest    {  
            
        
            [CodedStep(@"New Coded Step")]
            public void Keystrokes()
            {
                Manager.Desktop.KeyBoard.SendString("%{F4}");
            }
        }
    }

Here you can find the list with key codes.

I want to perform multi-select while holding down the Ctrl key.

Solution

Here is the full code-behind file, excluding the standard using/Imports statements and the Dynamic Pages Reference region:

C#
    using System.Windows.Forms;
    
    namespace TestProject8
    {     
        public class SendKeystrokes : BaseWebAiiTest    {  
            
        
            [CodedStep(@"New Coded Step")]
            public void Keystrokes()
            {
                
                    
                    Manager.Desktop.KeyBoard.KeyDown(Keys.Control);
    
                    //You can put the click steps HERE
    
                    Manager.Desktop.KeyBoard.KeyUp(Keys.Control);
            }
        }
    }
In this article
SolutionSolution
Not finding the help you need?
Contact Support