• Public
  • Public/Protected
  • All

Interface MouseActionApi






  • _click simulates a user's click on the given element.


    _click(_button("Click Me"));
    _click(_button("Click Me"), "CTRL"); // clicks with CTRL key pressed
    _click(_button("Click Me"), "CTRL|SHIFT"); // clicks with CTRL and SHIFT keys pressed
    _click(_button("Click Me"), {force: true}); // clicks without validation
    _click(_button("Click Me"), "CTRL", {force: true}); //clicks with CTRL without validation


    • query: SahiElementQueryOrWebElement

      query to the Element to click on

    • Optional combo: undefined | string | ClickOptions

      Optional combo key(s): can be CTRL, SHIFT, ALT or META; Can also be two or more keys together like "CTRL|SHIFT"

    • Optional options: undefined | ClickOptions

      disables validations prior to the click action to enforce clicks where an element e.g. is covered

    Returns Promise<void>

    Resolves after the click is invoked, doesn't wait for further actions on the website which are possibly invoked after the click








  • _setSelected(query: SahiElementQueryOrWebElement, optionToSelect: string | number | string[] | number[], isMultiple?: undefined | false | true): Promise<void>
  • Sets the options within a <select> element. Selection can be done by the actual values of an option or its zero-based element index.

    This action will invoke a click on the option element which means that the selected state is not enforced. If an option is already selected, it will be unselected.


    Assume this HTML-snippet:

    <select multiple="multiple" name="cities">
        <option value="muc">Munich</option>
        <option value="vie">Vienna</option>
        <option value="dus">Dusseldorf</option>
    await _setSelected(_select('cities'), 'vie') // -> select the option Vienna
    await _setSelected(_select('cities'), 0) // -> select the option Dusseldorf


    Returns Promise<void>



  • _xy(): Promise<never>