Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Description

Returns a URL-encoded string according to the ASCII Encoding Reference for UTF-8; all non-alphanumeric characters are replaced with their equivalent hexadecimal escape sequences.

Syntax

${_varEncodeUrl('variableName')}

Parameters

  • variableName
    Required; Name of the variable whose value will be converted to a URL encoded string.
Example

Where Variable rawstring contains a value of “ABC$%^----DEF":

Panel

${_varEncodeUrl(‘rawstring’)} --> ABC%24%25%5E----DEF

...

Variable By XPath

Description

Resolves to the evaluated XPath expression applied to the value of the specified variable.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, blank, or the path expression does not yield a result, the function will resolve to the default value.

Syntax

${_varXPath('variableName', 'xPathExpression'[, 'defaultValue', 'delimiter', prettyPrint])}

Parameters

variableName
Required; The name of the variable to apply the XPath expression to.

xPathExpression
Required; XPath expression. https://www.w3schools.com/xml/xpath_intro.asp

defaultValue
Optional; Default value to return if the result is not found. Default is empty ('').

delimiter
Optional; If xPathExpression evaluates to multiple results, the delimiter to be used to separate those results. Default is new line character (\n).

prettyPrint
Optional; Specification (true or false) for whether or not XML will be pretty printed (indented). Default is false.

Example

my_variable=
<message>
  <code>10</code>
</message>

${_varXPath('my_variable', '//code/text()')}
> 10

...

Variable By JsonPath

Description

Resolves to the evaluated JsonPath expression applied to the value of the specified variable.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, blank, or the path expression does not yield a result, the function will resolve to the default value.

Syntax

${_varJsonPath('variableName', 'pathExpression'[, 'defaultValue', 'delimiter', prettyPrint])}

Parameters

variableName
Required; The name of the variable to apply the JsonPath expression to.

pathExpression
Required; JsonPath expression. https://github.com/json-path/JsonPath

defaultValue
Optional; Default value to return if the result is not found. Default is empty ('').

delimiter
Optional; If pathExpression evaluates to multiple results, the delimiter to be used to separate those results. Default is new line character (\n).

prettyPrint
Optional; Specification (true or false) for whether or not JSON will be pretty printed (indented). Default is false.

Example

my_variable=
{
  "code": 10
}

${_varJsonPath('my_variable', '$.code')}
> 10

...

Variable By JsonPath As Array

Description

Resolves to the evaluated JsonPath expression applied to the value of the specified variable.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, blank, or the path expression does not yield a result, the function will resolve to the default value.

Syntax

${_varJsonPathAsArray('variableName', 'pathExpression'[, 'defaultValue', prettyPrint])}

Parameters

variableName
Required; The name of the variable to apply the JsonPath expression to.

pathExpression
Required; JsonPath expression. https://github.com/json-path/JsonPath

defaultValue
Optional; Default value to return if the result is not found. Default is empty ('').

prettyPrint
Optional; Specification (true or false) for whether or not JSON will be pretty printed (indented). Default is false.

Example

my_variable=
[
  {
    "message" : "Hello",
    "code" : 10
  },
  {
    "message" : "World!",
    "code" : 20
  }
]

${_varJsonPathAsArray('my_variable', '$[*].message', '', true)}
>
[
    "Hello",
    "World!"
]

...

Variable Number of Lines

Description

Resolves to the number of lines the value of the specified variable has.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, or blank, the function will resolve to 0.

Syntax

${_varNumberOfLines('variableName')}

Parameters

variableName
Required; The name of the variable to return the number of lines for.

Example

my_variable=
Line 1
Line 2
Line 3

${_varNumberOfLines('my_variable')}
> 3

...

Variable By Specific Line(s)

Description

Resolves to the specified line(s) of variable data for the specified variable.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, blank, or no lines qualify, the function will resolve to the default value.

Syntax

${_varLines('variableName', startLine, numberOfLines[, 'defaultValue', 'resultDelimiter'])}

Parameters

variableName
Required; The name of the variable to apply the function to.

startLine


Required; Start line, where 1 is the first line and -1 is the last line.

numberOfLines
Required; Number of lines to return starting from the startLine.

defaultValue
Optional; Default value to return if no lines qualify. Default is empty ('').

resultDelimiter
Optional; Delimiter to use when concatenating matching lines. If not specified, "\n" or "\r\n" depending on original output line endings.

Example

my_variable=
Line 1
Line 2
Line 3
Line 4

${_varLines('my_variable', 2, 2)}
>
Line 2
Line 3

...

Variable By Line(s) Matching Regular Expression

Description

Resolves to the line(s) of variable data that match the specified regular expression, of the specified variable.

  • If the variable is unresolved, the function will remain unresolved.

  • If the variable is undefined, blank, or no lines qualify, the function will resolve to the default value.

Syntax

${_varLinesByRegex('variableName', 'regexPattern'[, maxCount, numberOfLinesBefore, numberOfLinesAfter, 'defaultValue', 'resultDelimiter'])}

Parameters

variableName
Required; The name of the variable to apply the function to.

regexPattern
Required; Regular expression used for determining if a line matches. Regular expression must match the whole line (see Example, below).

maxCount
Optional; Maximum number of matching lines to return. Default is 1.

numberOfLinesBefore
Optional; Number of lines before each matching line to return along with the matching line. Default is 0.

numberOfLinesAfter
Optional; Number of lines after each matching line to return along with the matching line. Default is 0.

defaultValue
Optional; Default value to return if the result is not found. Default is empty ('').

resultDelimiter
Optional; Delimiter to use when concatenating matching lines. If not specified, "\n" or "\r\n" depending on original output line endings.

Example

my_variable=
Some_Text
ABC=Some_String
More_Text

${_varLinesByRegex('my_variable', '^ABC=')} /* Returns empty (the whole Line was not matched) */
>

${_varLinesByRegex('my_variable', '^ABC=.*')}
> ABC=Some_String

Anchor
System Functions
System Functions
System Functions

...