System Functions

Generate and use dynamic values in your tests

Systems functions are very similar to variables, but functions are built-in variables that come with Scandium.

Functions help you generate dynamic and unique values in your tests.

Let's take a quick look at the available functions on Scandium:

Email: To help you generate unique emails. Useful in cases where you need to test signup flows and you need a unique email each time the test runs. e.g itKRJ.lkdhuz1bql@testmail.getscandium.com

Num: To help you generate numbers of any length. e.g 19660200324

Range: To help generate a number within two boundaries. e.g 236

Alpha: To generate letters of the alphabet. You can specify the number of letters needed and even which character set you want the letters to come from. e.g itKRJ

Alphanum: Similar to alpha, but also includes numbers in the generated value. e.g JlU1ZZcr

Date: To generate date value in a desired format. e.g 15/09/2023

Time: Generate timestamp value (epoch time). e.g 1694463242839

Datetime: To generate datetime value e.g Mon Sep 11 2023 21:13:50 GMT+0100 (West Africa Standard Time)

Using a system function

You can insert a function anywhere you can insert a variable. To use a function in the value of a text field, expand the settings of the step where you want to insert the function, then click on the "Insert function" button, and choose the desired function to insert.

Once you select a function to insert, its notation will be added in the Text to Assign field {{num(11)}} . When the test is running and it gets to this step, the notation will be replaced with a randomly generated 11-digit number.

Last updated