Creating and running components

Prev Next

Components can be run in an automated test, allowing their reuse in multiple areas of your automation repository. Instead of writing repetitive actions from scratch, you can reference the pre-existing components and create new automated scripts by combining them.

Adding Components

To create a component -

  1. From within a Project - Hover over the Tests tab and then Test Tree.

  2. Highlight a Cycle, Folder, or Business Process in the tree.

  3. Right-click a Cycle, Folder, or Business Process where you wish to create the Component and select Add > Component. 

  4. Your Component will appear in the tree with the following icon.

  5. To add instructions to the component script, highlight the component in the tree, click on the Script tab, and select Open ScriptBuilder.

  6. Click Record to begin capturing instructions for the newly created component. Use the Add Instructions button to add instructions manually.

  7. Upon completion, Save your script.

Good to Know!

It is recommedned to give your components clear and descriptive naming. This will make it easier to search for the component for later reuse. You may also want to organize your components into separate folders such as “Form Actions," "Page Navigation," or "Validations".

Converting Script Instructions to Components

You can convert existing script instructions to a component.

  1. In ScriptBuilder, use the Ctrl or Shift keys to multi-select consecutive instructions.

  2. Click on the Convert to component button.

  3. Set a name and a description for the new component. Click on Select from tree to select the the location where you wish the component to be created. You can create a new component in the same or another system or project.

Running Components in an Automated Test

To run a component in a script -

  1. Open the relevant script in ScriptBuilder.

  2. Click on the Add button and select the Run component instruction type.

  3. You can select from the same or another Panaya system and the same or another project.
    Then, locate the relevant component using the search box or the tree view.
    Highlight the component you wish to add to the script and click OK.

  4. The Run component instruction will be added to your script.

    If applicable, define the input and output parameters for the Component. You can use internal parameters from the script where the component is nested.

  5. To view the component while working on your script, click on the Actions menu and select View component.

    You will be able to view the component in the context of your current script.

    To edit the nested component, click on the Unlock button. This option is disabled for users without permission to edit the nested Component.

Good to Know!

You can nest components within components.