VMware Cloud Community
StefanSchnell
Enthusiast
Enthusiast

Library to Emulate the System Class Local

A month ago I wrote a post about an approach of a simulation of the JavaScript runtime environment. Based on this I developed an emulation of the System class of Aria Automation. The System class contains a set of basic functions to offer standard processing methods for the most fundamental requirements in the context of the JavaScript runtime environment. To use these methods outside of Aria Automation, a library is available to emulate the System class. This gives us the possibility to code and test Actions a bit more independently, without the direct use of an Orchestration environment.

Here a tiny example:

 

 

load("system.class.js");

// Begin ---------------------------------------------------------------

System.log("Hello World");
System.debug("Hello World");
System.warn("Hello World");
System.error("Hello World");

System.log("UUID: " + System.nextUUID());

// End -----------------------------------------------------------------

 

 

system.class.js.001.jpg

This mock-up of the System class bases on the same JavaScript engine used in Aria Automation. This ensures us a consistent basis for simulation and operation. To use this library in your code it is necessary to add  load("system.class.js");  at the beginning of the program. After that, all functions can be used seamlessly.

This class emulation provides 53 methods, 51 of them are implemented and 15 delivers mock-up results. Furthermore exemplary is shown how mock-ups of other objects can be integrated and used.

Conclusion

This approach shows us that it is possible to emulate Aria Automation classes and use them outside the Web GUI development environment, e.g. in a local environment. Because the same execution engine is used, incompatibilities are kept within limits. Of course, with this one class only a very small part of the Web GUI development environment is represented, but it is a beginning.

You can find the source code of the class at blog.stschnell.de.


More interesting information at blog.stschnell.de

Labels (1)
0 Kudos
0 Replies