butterbee/action

The action module contains functions to perform actions on nodes.

Perform actions by passing the functions in this module to either the node.do or node.get functions.

Example

This example performs a click on the node with the css selector a.logo:

let example = butterbee.new([config.Firefox])
  |> butterbee.goto("https://gleam.run/")
  |> get.node(by.css("a.logo"))
  |> node.do(action.click(key.LeftClick))

Values

pub fn click(
  mouse_button: key.MouseButton,
) -> fn(webdriver.WebDriver(remote_value.NodeRemoteValue)) -> webdriver.WebDriver(
  definition.CommandResponse,
)

Performs a click on the given node

pub fn enter_keys(
  keys: String,
) -> fn(webdriver.WebDriver(remote_value.NodeRemoteValue)) -> webdriver.WebDriver(
  definition.CommandResponse,
)

Simulates a user entering the given keys into the browser.

NOTE: It is not recommended to use this function for entering text into text fields. Use the node.set_value(value) function instead.

Search Document