Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog

Parameters in custom JavaScript steps

Using parameters in your scripts

You can use parameters in any custom JavaScript step:

  • Custom Action
  • Custom Validation
  • Custom Wait-for
  • Custom Condition

There are 2 types of parameters:

  • HTML: Allows you to refer to HTML Elements in your app.
  • JS (JavaScript): Allows you do define any JS expression.

Custom Action example

In this example, we'll create a custom action that will click a button to demonstrate the use of the HTML parameter.

  1. Go to https://www.testim.io/ in the browser and start a new test.
  2. Scroll the page down until the Twitter buttons appear.
  3. Go to Testim editor.
  4. Use ‘+’ menu ⇒ Actions tab ⇒ 'Add Custom Action'.
  5. In the properties click under 'Shared Step Name' and rename it from 'Untitled validation' to 'Click'.
  6. Press Confirm to create the custom step.

Adding HTML param

  1. Click on the '+' icon to the left next to Params and choose HTML:
  1. Select the Twitter icon at the bottom of our website.
  2. The icon is now added to the list of Params.
  3. Double-click on the name and change it to "element".
    The name of every parameter is just above it.
  1. Now type under the function on the left:


  1. Go back to the test and run it.
  2. You can see that the element was clicked.

Note: in order do use Jquery in your custom validations and actions, your site needs to have Jquery installed.

Reuse and pass different parameters

We made a step in our test that clicks on the Twitter icon.

Next, let's reuse this step in another page and this time we will click on the LinkedIn button. Do we need to make another custom action? No!

  1. Use ‘+’ menu ⇒ Actions tab ⇒ choose 'Click'. This action is the action we created before.
  2. In the Params section click on the 'Assign now' and then 'HTML'.
  3. Choose the LinkedIn icon.
  1. Run the test and see that both buttons were clicked.

Adding JavaScript parameter

JavaScript parameters are commonly used for constants and variables.
We will mainly use those when we want to forward values to a group or to other reusable steps.
You can find examples for using JS params here.

Updated 2 years ago

Parameters in custom JavaScript steps

Using parameters in your scripts

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.