Hover over an element identified by CSS selector.
(
client: &mut CdpClient,
session_id: &str,
selector: &str,
)
| 220 | |
| 221 | /// Hover over an element identified by CSS selector. |
| 222 | pub async fn hover( |
| 223 | client: &mut CdpClient, |
| 224 | session_id: &str, |
| 225 | selector: &str, |
| 226 | ) -> Result<CommandResult> { |
| 227 | let initial_url = client.current_url(session_id).await?; |
| 228 | let (x, y) = get_element_center(client, session_id, selector).await?; |
| 229 | dispatch_mouse(client, session_id, "mouseMoved", x, y, "none", 0).await?; |
| 230 | let new_url = client.current_url(session_id).await?; |
| 231 | Ok(CommandResult::output(format!("Hovered: {selector}")) |
| 232 | .with_navigated_to_if_changed(new_url, initial_url)) |
| 233 | } |
| 234 | |
| 235 | /// Fill an input field identified by CSS selector with the given value. |
| 236 | pub async fn fill( |
no test coverage detected