Can I make assertions in JavaScript?
  • 09 Apr 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Can I make assertions in JavaScript?

  • Dark
    Light

Yes, you can. Open the [Scenario Details Page] and insert a [JS Step] where you want the assertion.

Sample code

if(not the expected result) {  throw new Error("Error message")}

For your convenience, we have created a resource which provides templates of the most frequently utilized JS snippets when testing in Autify; which you can find by clicking here.

If you have any questions, please feel free to contact us.


Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.