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

Keyup, FireKeyEvents and Unicode support

3 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hessner
Top achievements
Rank 2
Hessner asked on 15 Feb 2016, 07:18 AM

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.

 

3 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 16 Feb 2016, 01:58 PM
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!
0
Hessner
Top achievements
Rank 2
answered on 17 Feb 2016, 10:34 AM

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.

 

0
Boyan Boev
Telerik team
answered on 17 Feb 2016, 02:09 PM
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!
Tags
General Discussions
Asked by
Hessner
Top achievements
Rank 2
Answers by
Boyan Boev
Telerik team
Hessner
Top achievements
Rank 2
Share this question
or