Skip to content

move_to_element

roei sabag edited this page Jul 12, 2020 · 1 revision

Description

Moves the mouse to the specified element. This action will trigger mouseover event.

Scope

Web, Mobile Web, Mobile Native or any other Web Driver implementation which implements Actions.

Properties

Property Description
elementToActOn The locator value by which the element will be found.
locator The locator type by which the element will be found.

W3C Web Driver Protocol

https://www.w3.org/TR/webdriver/#actions

Examples

Example no. 1

Can be tested on:

Moves the mouse to the specified element.

Action Rule (JSON)

{
    "action": "MoveToElement",
    "onElement": "over_outcome",
    "locator": "Id"
}

Rhino Literal

move to element on {over_outcome} using {id}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.MoveToElement,
    OnElement = "over_outcome",
    Locator = LocatorsList.Id
};

// option no.2
var actionRule = new
{
    Action = "MoveToElement",
    OnElement = "over_outcome",
    Locator = "Id"
};

Python

action_rule = {
    "action": "MoveToElement",
    "onElement": "over_outcome",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "MoveToElement",
    onElement: "over_outcome",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("MoveToElement")
        .setOnElement("over_outcome")
        .setLocator("Id");

Clone this wiki locally