Assign
Command value: assign
Types a value into an input, textarea or editable element.
Fields
| Field | JSON property | Description |
|---|---|---|
| Target | target | CSS selector or XPath of the element the step acts on, for example #login or //button[text()='Save']. |
| Input Value | value | Text to enter. Variables and built-ins such as {{TIMESTAMP}} are supported. |
| Make this value private (Hide in display) | private | Masks the value in the step editor and step list. Use it for passwords. |
| Description (Optional) | notes | A comment shown in the step list and in Gherkin and Playwright exports. |
Usage
- The default browser engine types the text after any existing content and does not clear the field first. Start from an empty field, or clear it in an earlier step.
- The Playwright export uses fill, which clears the field before typing.
- Use {{ALPHANUMERIC}} or {{TIMESTAMP}} to create unique emails and names on each run.
- Store credentials as suite or test variables and enter them as {{PASSWORD}} instead of plain text.
Example step (JSON)
{
"command": "assign",
"target": "#email",
"value": "qa+{{TIMESTAMP}}@example.com"
}Playwright equivalent
await page.locator('#email').fill(`qa+${Date.now()}@example.com`);Common options
- Make this step optional (Continue on failure): when checked, a failure in this step is recorded and the test continues with the next step.
- Execute step when JavaScript returns true: runs the step only when the JavaScript condition returns true. Otherwise the step is skipped.
See conditional steps and variables for details.