Skip to content

context_click

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

Description

Right clicks the mouse at the last known mouse coordinates or on the specified element.

Scope

Web, Mobile Web or any other Web Driver implementation which implements Context Click.

Properties

Property Description
argument Plugin conditions and additional information.
onElement The locator value by which the element will be found.
locator The locator type by which the element will be found.

Command Line Arguments (CLI)

None

W3C Web Driver Protocol

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

Examples

Example no. 1

Can be tested on

Right clicks the mouse on the specified element.

Action Rule (JSON)

{
    "action": "ContextClick",
    "onElement": "click_button",
    "locator": "Id"
}

Rhino Literal

context click on {click_button} using {id}

// aliases (alternatives)
right click on {click_button} using {id}

CSharp

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

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

Python

action_rule = {
    "action": "ContextClick",
    "onElement": "click_button",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "ContextClick",
    onElement: "click_button",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("ContextClick")
        .setOnElement("click_button")
        .setLocator("Id");

Example no. 2

Can be tested on

Right clicks the mouse at the last known mouse coordinates.

Action Rule (JSON)

{
    "action": "ContextClick"
}

Rhino Literal

context click

// aliases (alternatives)
right click

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.ContextClick
};

// option no.2
var actionRule = new
{
    Action = "ContextClick"
};

Python

action_rule = {
    "action": "ContextClick"
}

Java Script

var actionRule = {
    action: "ContextClick"
};

Java

ActionRule actionRule = new ActionRule().setAction("ContextClick");

Clone this wiki locally