Herbie Logo

Keywords Command Playground

Instructions

To add a keyword with a variable in the Herbie extension, follow these steps:

  1. Navigate to the Keywords tab in the Herbie extension.
  2. In the Enter keyword field, type your desired keyword, e.g., SubmitButton.
  3. In the Enter XPath field, type the XPath of the element, e.g., //button[@id='submit'].
  4. If the XPath contains a variable part (e.g., part of the XPath can change dynamically), check the Has Variable checkbox.
  5. Click the Add Keyword button to save the keyword.
  6. The keyword will now appear under the Global Keywords section.
  7. To use the added keyword in your Herbie script, navigate back to the Herbie tab and type the following:
  8. click on 'SubmitButton'

Use Keyword in Herbie Script

After adding the keyword, use it in the script as shown below:

click on 'SubmitButton'

This will simulate a click action on the element specified by the XPath in the keyword.