Invoking Javascript
Telerik Testing Framework supports directly invoking JavaScript functions from your .NET test code. One key advantage to this support is that you can use it to do your JavaScript unit testing without having to integrate yet another unit testing framework into your development environment. You can also avoid having to learn/support this additional framework. Abilities include:
Invoke JavaScript functions and get return values.
Handle JSON objects returned after invoking a JavaScript function.
Invoke script events directly on a page element. (e.g. OnBlur(), OnMouseOut(), etc)
Attach .NET event handlers to actual JavaScript events.
Perform logging/tracing of your JavaScript routines. The logging is done directly into the unified log you are using.
Invoking JavaScript Functions
The Actions.InvokeScript() enables you to simply provide a JavaScript function name to invoke. For example:
Here is a code which calls an Angular function against input field:
JavaScript Unit Testing Using NUnit or Visual Studio Team Test
Below is an example of how you can define JavaScript unit tests that is consistent with the rest of your tests and manages their execution and reporting using the same unit testing infrastructure, whether it is NUnit or Visual Studio Team Test.