Skip to main content

Module element

Module element 

Source
Expand description

DOM element interaction. DOM element interaction and manipulation.

Elements are identified by UUID and stored in the content script’s internal Map<UUID, Element>.

§Example

use firefox_webdriver::Key;

let element = tab.find_element("#submit-button").await?;

// Get properties
let text = element.get_text().await?;
let value = element.get_value().await?;

// Interact
element.click().await?;
element.type_text("Hello, World!").await?;

// Press navigation keys
element.press(Key::Enter).await?;
element.press(Key::Tab).await?;

Structs§

Element
A handle to a DOM element in a browser tab.