Versions Compared

Key

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

...

CommandExamplesExplanation
save value of <Locator> as <Variable>save value of textbox with id "textboxId" as userInputSaves the "value" attribute of the element as the stated variable, or if the attribute doesn't exist, the text contained by the element. Requires Toffee Performer version 723 or higher.
save attribute "<Attribute>" of <Locator> as <Variable>save attribute "href" of link "Documentation" as DocLinkSaves the specified attribute of the element as the stated variable. If the attribute does not exist for the element, the step will fail. Requires Toffee Performer version 723 or higher.

Save Random Values

Command

ExamplesExplanation
save random number from <Start> to <End> as <Variable>save random number from 1 to 6 as D6rollSaves a random number between the start and end numbers inclusively as the stated variable.
save random [case] <type> string of length <Length> as <Variable>

save random alpha string of length 12 as azAZs

Saves a random grouping of letters and numbers of the specified length as the stated variable.

The case is optional and can either be lowercase or uppercase. If the case is not defined, then mixed-case will be used for all types.

The four possible types are alpha (only letters), numeric (only numbers), alphanumeric (letters and numbers), and hexadecimal (0-9 and A-F).

save random lowercase alphanumeric string of length 8 as AlphaNums
save random uppercase hexadecimal string of length 6 as bgColor
save random [case] <type> string with spaces of length <Length> as <Variable>save random uppercase alphanumeric string with spaces of length 8 as 09AZwSpaces

Saves a random grouping of letters, numbers, and spaces of the specified length as the stated variable.

As above, the case is optional and either lowercase or uppercase, and there are the four types: alpha, numeric, alphanumeric, and hexadecimal.

save random regex "<Regular Expression>" as <Variable>save random regex "([1-9]\d{1,2}) (red|green) apples" as inBasket

Generates a random string that matches the regular expression and saves it as the stated variable.

Any grouping that specifies a range without an upper limit defaults to the lower limit + 10. In other words, \d* is actually \d{0,10}, \d+ is \d{1,11}, and \w{5,} is \w{5,15}. To use a range greater than 10, you must define a range with a lower and upper limit.

save random mask "<Mask>" as <Variable>save random mask "pl'ate '# AAA-####" as plate

Generates a random string that matches the mask given and saves it as the stated variable.

Specific characters get replaced by the mask. All other characters do not get replaced by the mask. The characters are as follows:

#

Digit (0-9)

aLowercase letter (a-z)
AUppercase letter (A-Z)
ZEither-case letter (a-z or A-Z)
nLowercase letter or digit (a-z or 0-9)
NUppercase letter or digit (A-Z or 0-9)
MAny letter or digit (a-z, A-Z, or 0-9)
hLowercase hexadecimal digit (0-9 or a-f)
HUppercase hexadecimal digit (0-9 or A-F)
JAny hexadecimal digit (0-9, a-f, or A-F)
'Make the next character definitely a literal

...