Complex Keypress combination fails to work

3 posts, 1 answers
  1. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 09 May 2013 Link to this post

    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. Answer
    Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 09 May 2013 Link to this post

    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
  3. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 10 May 2013 Link to this post

    Thank you for quick response.

    Current WorkAround is :
    System.Windows.Forms.SendKeys.SendWait("+^%(T)");
    
Back to Top