Explore all your options for using parameters

Parameters are variables that can be used to pass information into a test step. Parameters can be used in steps to test different scenarios without knowing the information ahead of time. In this article, we will discuss 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 define 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 serialized between steps as JSON - only values that may be serialized 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.