Create a new scripted component

useMango™ is shipped with a large number of default components which allow you to automate most of the range of supported applications.

In order to support applications where not only workflows have been customized but also forms and controls, there can be a need to create specific scripted components to be able to automate the full business process. The section below describes how to do this with useMango™.

To create scripted component

  1. In useMango™, click the Components tab.
  2. Click Scripted tab in the window.
  3. Click Add scripted component. A new Unnamed scripted component is created and displayed ready to be edited.
  4. Click on the component name and type your name for the component.
  5. Click on the Description text of the component and provide appropriate test to explain the purpose of the component.
  6. Choose the Execution Engine and Resource Group that will be used when executing the new component.

    The Engine you choose will determine the scripting language that you must use when coding the functions of the component. The Resource Group determines which code libraries will be loaded with your component when it executes.

  7. Click Edit to begin editing the script of the component. See below for more information.

Once the custom component is created using the details and code entered, it can be used directly in tests.

Editing the scripts

Click the Edit button in the script panel to edit a script along with the code libraries that it references. useMango™ will open the component script file and reference code libraries in a third-party text editor. After editing, simply save the script file and useMango will automatically save it to useMango™ Server ready for immediate use in tests.

Ensure that the useMango™ application is kept open whilst editing scripts in external text editors so that they are save automatically. If useMango™ is not running then it can’t save any changes made to the scripts or code libraries.

The choice of text editor to use is made the first time a component script is edited. When subsequent scripts are edited, useMango™ will open the script in the same editor as previously used. The chosen text editor is displayed in the Component window in the bottom-left corner. To change editors, click Clear, then on the next edit useMango will again allow an editor to be chosen.

useMango™ supports several of the best text editors available for working with scripts in VB and Ruby. It’s recommended that one of these is installed prior to editing component scripts with useMango™. Choose from:

  • Visual Studio Code
  • Notepad++
  • Sublime Text
  • Atom