Parameters are everywhere, we can use them anywhere for a lot of purposes.
In this article, we will be familiar with the different types of parameters and where they can be used.

HTML parameters VS JS Parameters

Testim allows you to define HTML parameters and JS parameters. 

  • HTML Parameters - allows you to refer to HTML Elements in your app by simply selecting them in your page.
  • JavaScript Parameter - are extremely useful when you need to use dynamic data or more complex expression (e.g. set the current date to a text field, or generate random data).

Where can you use Parameters

  • Pass to JS Step - You can use parameters in any custom JS Step - custom action, custom validation, custom wait for or custom condition.
  • Pass to a Group - You can pass parameters to a group to allow reuse inside a group. 
  • Pass to a Test - You can pass parameters to a test. This is great for setting dynamic/random values. You can pass via the CLI or from one Test to another.
  • Export (out) parameters - A value which was generated inside a step, can be used later in other steps, either in the same test, or tests depended on this test (see Test Plan).
  • Data driven - Run your test against multiple data sets of parameters. 
  • Extract text - Extract text from your application directly to a parameter for later use.

Note: Since parameters are serialised between steps as JSON - only values that may be serialised as JSON may be safely used.

After running a test, the incoming parameters, and the ones exported in a step appear in its properties panel. 

Did this answer your question?