What is the correct form for a random string using a regular expression in Tosca?

Prepare for the Tricentis Tosca Automation Specialist Level 1 (AS1) Test. Enhance your skills with multiple choice questions and explanations. Be exam ready!

Multiple Choice

What is the correct form for a random string using a regular expression in Tosca?

Explanation:
Generating a random string that follows a specific pattern in Tosca uses the RANDOMREGEX function with the pattern supplied as a string. The correct form is to call RANDOMREGEX and pass the regular expression inside quotes as the argument, inside braces: {RANDOMREGEX["Regular expression"]}. This tells Tosca to produce a string that matches the provided regex. Using a different function like RANDOMTEXT would produce arbitrary text without a guaranteed pattern, and omitting quotes or using an unquoted word wouldn’t be valid for passing the regex as a string. Providing a non-string or an incorrect label inside the argument wouldn’t be parsed as a regex pattern.

Generating a random string that follows a specific pattern in Tosca uses the RANDOMREGEX function with the pattern supplied as a string. The correct form is to call RANDOMREGEX and pass the regular expression inside quotes as the argument, inside braces: {RANDOMREGEX["Regular expression"]}. This tells Tosca to produce a string that matches the provided regex. Using a different function like RANDOMTEXT would produce arbitrary text without a guaranteed pattern, and omitting quotes or using an unquoted word wouldn’t be valid for passing the regex as a string. Providing a non-string or an incorrect label inside the argument wouldn’t be parsed as a regex pattern.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy