Last Updated: 15 Sep 2016 07:56 by ADMIN
Created on: 19 Jun 2016 15:08
Type: Feature Request
Add support for JS Input event
Consider the following sample Angular login form:

Recording this as a Test Studio UI test doesn't work because TS' non-simulated typing steps will not trigger the angular input events. And so the 'Sign in' button will remain disabled.

The workaround is to trigger the event manually in code with something like this:
Actions.InvokeScript("angular.element(" + element.ClientSideLocator + ").val('" + text.Replace("'", "\\'") + "').triggerHandler('input')")

This exact issue has been discussed:

And you would have to add a coded step after every input typing step. It's very inconvenient. Test Studio should detect whether this is an angular control and then automatically arrange for the script to triggering behind the scenes. The same way it works for HtmlSelect:

You can simply set the step to SimulateRealType but this is not a great solution.

Angular is extremely popular and by not supporting it properly is really hurting TS' appeal. 
Konstantin Petkov
Posted on: 15 Sep 2016 07:56

Here is another update to ease the inputs automation of Angular applications. The Angular apps containing inputs with "ng" binding (a common case) will now be respected on test playback so the SetText step will automatically trigger the OnInput event without the need of SimulateRealTyping or addition InvokeEvent step. This particular change is also joining the next Test Studio official release scheduled to go live by the end of September 2016.

Best Regards!
Konstantin Petkov
Posted on: 17 Aug 2016 13:43

This particular example is specific to JS input event, which is missing in Test Studio JS events built-in list. We are updating the code in particular so that one can also add InvokeEvent step for JS OnInput event. That can be used as an alternative to the SimpulateRealTyping feature to trigger the exact JS event this particular example is about.

Konstantin Petkov
Posted on: 16 Aug 2016 11:05
Hi guys,

We have investigated this case and figured out this is not specific to Angular at all. This is actually the case with all inputs with custom events, which we recommend SimulateRealTyping (in case of SetText step) as a solution. We also verified this is the case with this application as well.

>>You can simply set the step to SimulateRealType but this is not a great solution.

Stoil and all, please elaborate more if this solution is not feasible. 

Please also note changing the SetText default behavior (SimulateRealTyping off) would be a breaking change.

Posted on: 29 Jul 2016 20:20
This would be very handy functionality to have built into Test Studio.
Posted on: 28 Jul 2016 13:46
This functionality is very helpful
Posted on: 19 Jun 2016 15:09
It there a way to create a plugin so that code is executed after each Test Studio test? That way this can be easily handled with a custom plugin.