Entering Values for Parameters

Values is what get associated with parameters to be used by actions and which are defined in ‘Parameter’ section of Action screen (see details here: Parameters). There are 3 types of Parameters: String, Boolean and Array of String and here is how to enter values for them:

String

  1. You can type in any text value using any type and number of characters
  2. Pressing Enter key will keep the value you entered in the field and go to next parameter value field
  3. <NULL> value means the parameter will be returned as ‘null’ on the code level (not to be confused with empty value which is considered to be a valid one)
  4. Clicking on Drop down arrow will display easy-to-enter values: a) Possible Values that can be selected (and that were defined on Action parameters level) b) Parameters (if it’s an Action Collection on Action level) c) Variables (that are defined on variables page).
  5. You can mix variable value plus text to combine the two: <text value>${ variable } (example: I’m using the following browser ${ Browser })

Boolean

  1. You can only select value from a drop down either as TRUE or FALSE
  2. Pressing Enter key will keep the value you entered in the field and go to next parameter value field
  3. <NULL> value means the parameter will be returned as ‘null’ on the code level
  4. Boolean parameter will actually be defined as a boolean on a code level (example: boolean bMyBooleanParameter)

Array of String

  1. To enter values you will need to type in any string text you want and press enter, if you want to enter more values then set cursor to the right of first value entered, type in another value and press enter
  2. Array of String stores multiple String values which are stored in array on a code level and retrieved appropriately (example: aMyArrayParameter[0], aMyArrayParameter[1])
  3. This type is never null on code level but if there are no values specified then this Array of String is returned as empty of values

Retrieving Parameter Value in Code

Parameters are passed to actions as HashMaps which can be retrieved in a usual code manner:

params.get("Name of my parameter goes here")

That’s why every action method should require a HashMap to be passed to it and the following example code using the above example values (in the image):

public class MyTestActionClass {
     public void run(HashMap<String, Object> params) {
        System.out.print(params.get("My string parameter"));
        System.out.print(params.get("My boolean parameter"));
        System.out.print(params.get("My array of string parameter")[0]);
     }
}

will print out:

This is my string value which also has variable value at the end: Firefox (if firefox was used for execution)
true (actual Boolean value of the parameter)
string test 1 (since it’s the first value of array of string)

Feedback

Thanks for your feedback.

Post your comment on this topic.

Please do not use this for support questions.
For customer support, please contact us here.

Post Comment