Keyup, FireKeyEvents and Unicode support

4 posts, 0 answers
  1. Hessner
    Hessner avatar
    189 posts
    Member since:
    Mar 2003

    Posted 15 Feb Link to this post

    Hi

    Starting out with Test Studio. My first "stop" was some javascript code using the Keyup event.

    In the docs I found that "FireKeyEvents" should be turned on, but I could not find that option.

    It turned out that uncheck off "Unicode Support" was the way forward.

    Regards.

     

  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 16 Feb Link to this post

    Hello Bo,

    Yes you are right, however in some scenarios the key events are not fired up and you have to do so manually in code.

    Could you please describe in more details what exactly issue do you experience so we can better assist you.

    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!
  3. Hessner
    Hessner avatar
    189 posts
    Member since:
    Mar 2003

    Posted 17 Feb Link to this post

    Hi,

    Was posting so if anyone searching "FireKeyEvents" would get a relevant hit :-)

     

    Here are the story:

    We have an Angular directive where keyup are tested. something like this:

    elem.bind('keyup', function (event) { // Only proceed if key 0-9, numpad 0-9 or ctrl+v is pressed to trigger the serviceif (elem[0].validity.valid && ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.ctrlKey && event.keyCode === 86)) {

     

    This event was not fired, so my first attempt was to send ctrl+v via code, like this:

    HtmlInputText c = Find.ById<HtmlInputText>("cpr");
    c.Focus();

    Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.LControlKey);
    Manager.Desktop.KeyBoard.TypeText("v");

    Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.LControlKey);

     

    This did not do the trick - then I discovered that unchecking "Unicode Support" solved the matter.

     

    Regards.

     

  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 17 Feb Link to this post

    Hello Bo,

    Thank you for sharing your knowledge and experience with your community.

    We really appreciate it.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top