Many time when you want to set a dynamic text string, a static value is not good enough. Here we'll show how to create advanced Set Text step, without the need of writing complete custom action in JavaScript.

Using JavaScript expression

For example, making sure we set a unique user name value in an input field. In this case you can set the value to this simple expression: 'user' +

When running, Testim will evaluate the expression and set its text in the field:

Using a parameter

Another advantage of the JavaScript expression, is that you can use a parameter created previously in a different step (more about exporting parameters).

For example if I have exported from a prior step the user name to the parameter userName,
I can now set its value to the user name field by just writing its name in the Text to Assign field:

Did this answer your question?