Skip to content

Edit steps

Editing a test case lets you manage every step: add new ones, change existing ones and remove those you don’t need.

  1. Open Edit Steps for the test case and select Add on any step. The new step is inserted directly below it.
  2. Choose an action from the dropdown. Available actions include clicking an element, making an assertion, running a custom script and accepting or rejecting a JavaScript alert.
  3. For steps that act on an element, such as clicking a button, enter the element’s CSS selector in the CSS path field at the top of the step.

The Chrome extension includes Pick CSS, which captures the selector for the element you point at.

The Add button on a step The action dropdown The CSS path field

Step What it does
Click, Hover Click a button or other element, or move the pointer over it.
DoubleClick, RightClick Double-click or right-click an element.
Click by text Click an element by its visible text. Use the index option when several elements share the same text.
Type, Password Enter a value in a text field, or a password.
Clear Empty a text field.
Keypress Send a key such as Enter or Escape.
Assert Validate the page. See Assertions.
Alert Accept or dismiss a JavaScript alert. Alerts aren’t always captured while recording, so you can add this step yourself.
Script Run custom JavaScript, for example to build a custom date string with JavaScript date functions.
Pause Wait for a fixed time, for a JavaScript condition to be true, or for an element to appear or disappear.
Take Screenshot Capture the page at this point.
SwitchToWindow, Close Window Move between browser tabs and windows, or close one.
Import Steps From Reuse the steps of another test case. See Import test cases.
Import API Test Run a saved API test as a step.
Validate PDF Check the content of a downloaded PDF. Place it right after the click that starts the download.
Store Variable Save a value for later steps. See Store variable.

Mark a step as optional and the test continues even if that step fails. This suits behavior that happens only sometimes, such as a modal dialog that appears intermittently. Use the toggle on the step to turn it on or off.

The optional toggle on a step

A step can run only when a JavaScript condition is true.

  • If the condition is true, the step runs.
  • If the condition is false, the step is skipped.
  • If the condition throws an error, the test fails at that step.

Code view lets you edit steps as YAML. It supports bulk copy and paste, moving steps between tests, undo and redo, and importing or exporting tests between applications.

The YAML keywords are name, type, assertType, selector, iframeSelector, value, javascriptCondition and optional.