How to edit your script?

Watch this short video tutorial and learn about Panaya’s brand new Script Editing capabilities, introducing the next level of test acceleration and automation


Let’s take a look at how easy it is to edit your Quick Test script, to allow maximum accuracy and minimum setbacks when executing Quick Runs. Use functions and parameters to enhance your script flexibility when executing Quick Run.

In this article - 

To edit a value - 

  1. From within any Quick Test select the Script tab to view the pre-recorded script
    The Script tab displays the entire script to be run, with the activity overview and the expected results of each Step.
  2. Click on the Edit Step buttonor Double click on the relevant step
  3. Double-click on any value in the Step


     
  4. You will then be given the option to change the value to Text or to an Expression


    Text
    Use this option to provide a static text value that will be used every time the script is executed

    Expression 
    An Expressions is a combination of plain values (text) and built-in functions. You can also combine parameters in your expressions.

    Add Parameter
    Parameters allow you to collect values from the tested system, or from the tester, and use them as values for any field within the script.
    Click here to learn more about working with Parameters

    Add Function
    Use predefined functions to automatically input a dynamic date, minimum or maximum values within a range and more.
    Click here to learn more about using Functions
     
  5. Type in the new value and click OK, and then OK again

  6. Save the Script

Disable or Delete Instructions

You can disable an instruction or a group of instructions in the script. The disabled instructions will be ignored while running a Quick Run.

The instruction will not be deleted, instead it will appear in grey and will be ignored. You can also delete an instruction altogether. 

Good to Know!
You can always revert and enable the instruction any time

  1. From within any Quick Test select the Script tab to view the pre-recorded script
    The Script tab displays the entire script to be run, with the activity overview and the expected results of each Step.
  2. Click on the Edit Step buttonor Double click on the relevant step
  3. Highlight (1) the instruction or the instruction group you wish to disable or delete.
    Click the Disable (2) or Delete (3) button

 

Important!
Deleted Instruction cannot be restored

Convert to Manual

Use the Convert to Manual option to ensure specific activities are performed manually by the tester and ensure maximum control over test execution performance. 

  1. From within any Quick Test select the Script tab to view the pre-recorded script.
    The Script tab displays the entire script to be run, with the activity overview and the expected results of each Step.
  2. Click on the Edit Step buttonor Double click on the relevant step
  3. Highlight (1) the instruction you wish to convert, and then Convert to Manual (2).
    The converted instruction will require the tester to perform the activity manually in the recorded system.

 

Working with Commands 
Use Commands to display a message for the Tester while executing the script. You can even ask the Tester to provide a value to be used while executing as input value for any field.

How to add a new Command to your script?

  1. From within any Quick Test select the Script tab to view the pre-recorded script.
    The Script tab displays the entire script to be run, with the activity overview and the expected results of each Step.
  2. Click on the Edit Step buttonor Double click on the relevant step
  3. Commands can be added before or after any instruction in the script.
    Highlight (1) an instruction, and click on either Add Before (2) or Add After, then select Command
  4. The Add Command pop up will appear, allowing you to select and configure any of the Commands described below.
     

What are the available Commands?

  • Show Message
    This option will display a message to the tester indicating an action to be performed or information to acknowledge about the recorded activity
     

  • Get Value
    This option will require to enter a value and save it as a parameter so it can be reused later in the script
    For example - If you set the parameter to company_code, you will be able to use it as a dynamic value anywhere in the script by using the following syntax in the Expression field - 
    <company_code>

    When using the Get Value command with Date as input value - Date format should match the machine Regional Settings date format used by the tester


     

  • Skip Next Instruction
    Skip the next instruction if the condition is met. The condition can contain parameters and/or functions.
     

  • Sleep
    Pause the execution for a selected duration. This can come in handy if you have other processes that should be performed on an external system or application, before moving on with playing the following instructions and steps in the script.
     

  • Beep
    Play a beep sound. Use this option to engage the tester before performing important activities.
     

  • Run program
    Will run any executable file locally or on a server directory
     

  • Execute Code
    Use Quick Run to execute JavaScript code services, allowing  to communicate with other systems via APIs .
    Learn more
     

  • Open URL
    Allows to open up any URL or web application automatically
     

  • Validate
    Validate whether the given expression is true. The expression can contain parameters and/or functions.
     

 

Functions

Functions are an easy a way to dynamically perform updates in the existing values.

  1. From within any Quick Test select the Script tab to view the pre-recorded script
    The Script tab displays the entire script to be run, with the activity overview and the expected results of each Step.
  2. Click on the Edit Step buttonor Double click on the relevant step


     
  3. Double-click the value you wish to change in the script
  4. First, clear any existing value. Then, click on Add Function.
  5. Select from any of the function categories in the menu
    For more information, including the syntax and examples of using Functions, click here
     

 

 

 

Working with Parameters

You can select a value in the expected results in the script and set it as a parameter. Then, use this newly created parameter anywhere in your script activities. 

There are 2 options to create Parameters

  • Get Value
    To add a parameter in the Step Activity, use the Get Value option available in commands.

  • Set as Parameter
    When editing the expected results of a Step in your script, you can highlight any value and then click on Set value as parameter

    Type in the name of the new Parameter and click OK

    The selected value will be assigned to the newly created Parameter, when the script is executed

How to Utilize Parameters?
 

  1. Select to edit any Step Activity or Expected Results
  2. When editing a particular value, click on the Add Parameter button 
  3. Panaya will display a list of Parameters that were defined prior to the current step.
    For each Parameter, the Step number is displayed. This is the Step where the parameter is currently being populated.
  4. Select the parameter and click Add. You can combine the Parameter with other Parameters or Functions.


Smart Validation
Before you can utilize Smart Validation, you will need to execute at least one Quick Run of your script.
Smart Validation will automatically disable all validations that were skipped during the last run (from the Expected section of the script).
Smart validation also suggests instructions to be disabled based on the crowd analysis (i.e. instructions frequently skipped by other Panaya users). 

Good to Know!
You can copy or duplicate any Quick Test where Smart Validation has been applied. These rules will automatically be applied to the copied or duplicated Quick Test.