Skip to content

Commands for Math & String functions

Worksoft SaaS supports a number of commands (constructs) to help you implement mathematical operations and operations on strings within your automated tests.

In this table below, you can see a listing of the commands grouped by the category along with a high-level purpose of those commands.
Command Purpose
average This command is used to calculate average on the list of numeric values provided. This is similar to arithmetical average which performs average on the list of numeric values provided.
concatenate This command concatenates the string values, numeric values and/or variables that can hold string/numeric values provided as input to this command and returns concatenated string as output. Numeric values, if any, passed as part of the input must be provided without enclosing in double quotes.

Alphanumeric string values, if any, passed as part of the input must be provided with or without enclosing in double quotes (Please note single quotes are not allowed). Variables, if any, that can hold numeric or string values passed as part of the input must be of the format ${<variableName>} (Please note that the $ sign and the opening and closing curly braces must be used around the variable name).  

Example: 12345, "Sam", "4,500", ${testValue}.
locateSubstringPosition Returns the position of the first occurrence of the  <substring> within the  <string> string starting from the position within all occurrences of the  <substring> .This command performs a case-sensitive match when searching for. It returns 0 if the <substring> is not in the  <string> . 
product This command does multiplication for the list of numeric values provided. This is similar to arithmetic multiplication which performs multiplication on the list of numeric values provided.
replaceSubstringOccurrencesWithinAString  Returns the string <string> with all occurrences of the <fromSubstring> within the <string> replaced by the <toSubstring>.
This command performs a case-sensitive match when searching for <fromString>.  
sum This command does the addition for the list of numeric values provided. This is similar to arithmetic addition which performs addition on the list of numeric values provided.
storeRandomNumber
This command is used to generate randomNumber with a specified length or within a range

Feedback and Knowledge Base