ScriptBuilder Instruction Types
  • 3 Minutes to read
  • Dark
    Light
  • PDF

ScriptBuilder Instruction Types

  • Dark
    Light
  • PDF

Article Summary

Complex operations are made easy—capture and validate on-screen values to add assertions in a click. Build a reusable flow by leveraging parameters combined with advanced expressions and all date, string, and numerical functions. Panaya provides many instruction types for interacting with your application and even the option to add JavaScript code for extended capabilities.

This article describes the available ScriptBuilder instructions and how to use them in your script.
Click on the Add button to view available instructions.


Application Under Test

Capture screen element

Use this option to capture the value of a screen element while running the script, and use it as a dynamic parameter that can be used for validations and more.

Click on the Add button  > Capture screen element.


If the application under test is already opened in a browser, the ScriptBuilder will allow you to select the element. If not, you can navigate to the application under test in your browser and select an element.

You can then define the parameter, and the captured value will populate it.

Use the Recapture button to reselect the element to capture in the application under test.

Select the Add Snipping option to parse the recorded value and keep the first number, words by order, word before specific strings, or use regular expressions on the recorded value.

Validate screen element

The validate screen element instruction captures the current element value in the application under test and compares it to a given value, function output, or parameter.

Click on the Add button  > Validate screen element.

Click on Equals to change to other available validations such as Not equals, Contains, Starts with, or Ends with.

Capture tab title

The capture tab title instruction records the browser title text during a run and inputs it to a parameter value.

Open URL

Use the Open URL instruction to open a browser with a given URL. The URL can also be created using a function or a parameter. You can select to open the URL in a new tab.
Click Add to add the instruction to the script. Then save the script.

Refresh application

When adding the Refresh application instruction to a script, the browser windows of the application under test will be refreshed.


General instructions

Sleep

Use this instruction to pause the script run for a specific period in seconds. A function or a parameter can also determine the period.

Execute code

Click here to learn more about executing code by the scriptBuilder or agents.

Check if the file exists

You can specify a file path location, and the instruction fails when a specified file does not exist.
If checking for a local file, when executed via the agent, the agent will attempt to locate the file locally on the agent machine. When executed for debugging purposes via the ScriptBuilder play option, the ScriptBuilder will attempt to locate the file locally on the machine where the ScriptBuilder is being run.

Run Program

This instruction allows the execution of a program by providing a file location and optional arguments.
Arguments pass parameters to the program when it is executed. They allow users to customize the program's behavior without modifying its source code.
If running a local program, when executed via the agent, the agent will attempt to locate the program locally on the agent machine. When executed for debugging purposes via the ScriptBuilder play option, the ScriptBuilder will attempt to run the program locally on the machine where the ScriptBuilder is being run.


Flow

Go to section

You can jump to another location in the script according to specific conditions using functions and parameters.
Copy a section name in the script and paste it into the Go to section input when setting up this instruction.

Pass / Fail test

The Pass and Fail test instructions allow you to determine the execution results as they appear in the Automated Executions view.


Environment Variables

Automation scripts can set or get variables from the operating system where the script is being executed.

Set environment variable

You can use the script to inject variables that will reflect in the operating system’s user variables.

Click on the Add button  > Set environment variable.


Type the name and the value for the variable and click OK.

After playing the instruction you can see the newly created variable in the User variables section for your operating system’s environment variables.

Get environment variable

Use this instruction to use a variable value from an operating system’s user environment variable and inject it into a parameter in your script.

Delete environment variable

Use this instruction to delete a user environment variable from the operating system.


Cookies

Available instructions for cookies are -

  • Create cookie

  • Get cookie

  • Update cookie

  • Validate cookie

  • Verify cookie exists

  • Delete cookie

Good to know

When setting Cookies to a String value we must use single quotes.  The same for validating cookies.


What's Next