Skip to content

select_from_combo_box

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

Description

Provides a convenience method for manipulating selections of options in an HTML select element. This action supports different selection options as well as multiple selection based on a pattern.

Scope

Web, Mobile Web.

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.
onAttribute The element attribute from which to extract information for action execution. If not specified, information will be taken from the element inner text.
regularExpression A pattern by which the extracted information will be evaluated. Returns the first match.

Command Line Arguments (CLI)

all

Select all values in the combo box (combo must be of type multiple).

W3C Web Driver Protocol

None

Examples

Example no. 1

Can be tested on

Selects a single value from select_menu combo box, by item text.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "Two",
    "onElement": "select_menu",
    "locator": "Id"
}

Rhino Literal

select from combo box {Two} on {select_menu} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "Two",
    OnElement: "select_menu",
    Locator: "Id"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "Two",
    "onElement": "select_menu",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "SelectFromComboBox",
    argument: "Two",
    onElement: "select_menu",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("Two")
        .setOnElement("select_menu")
        .setLocator("Id");

Example no. 2

Can be tested on

Selects a single value from select_menu combo box, by item value.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "2",
    "onElement": "select_menu",
    "locator": "Id",
    "onAttribute": "value"
}

Rhino Literal

select from combo box {2} on {select_menu} using {id} from {value}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "2",
    OnElement: "select_menu",
    Locator: "Id",
    OnAttribute: "value"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "2",
    "onElement": "select_menu",
    "locator": "Id",
    "onAttribute": "value"
}

Java Script

var actionRule = {
    action: "SelectFromComboBox",
    argument: "2",
    onElement: "select_menu",
    locator: "Id",
    onAttribute: "value"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("2")
        .setOnElement("select_menu")
        .setLocator("Id")
        .setOnAttribute("value");

Example no. 3

Can be tested on

Selects a single value from select_menu combo box, by item index.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "2",
    "onElement": "select_menu",
    "locator": "Id",
    "onAttribute": "index"
}

Rhino Literal

select from combo box {2} on {select_menu} using {id} from {index}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "2",
    OnElement: "select_menu",
    Locator: "Id",
    OnAttribute: "index"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "2",
    "onElement": "select_menu",
    "locator": "Id",
    "onAttribute": "index"
}

Java Script

var actionRule = {
    action: "SelectFromComboBox",
    argument: "2",
    onElement: "select_menu",
    locator: "Id",
    onAttribute: "index"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("2")
        .setOnElement("select_menu")
        .setLocator("Id")
        .setOnAttribute("index");

Example no. 4

Can be tested on

Selects multiple values from select_menu_multiple combo box, by item text.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "['One', 'Two']",
    "onElement": "select_menu_multiple",
    "locator": "Id"
}

Rhino Literal

select from combo box {['One', 'Two']} on {select_menu_multiple} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "['One', 'Two']",
    OnElement: "select_menu_multiple",
    Locator: "Id"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "['One', 'Two']",
    "onElement": "select_menu_multiple",
    "locator": "Id"
}

Java Script

action_rule = {
    action: "SelectFromComboBox",
    argument: "['One', 'Two']",
    onElement: "select_menu_multiple",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("['One', 'Two']")
        .setOnElement("select_menu_multiple")
        .setLocator("Id");

Example no. 5

Can be tested on

Selects multiple values from select_menu_multiple combo box, by item value.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "['1', '2']",
    "onElement": "select_menu_multiple",
    "locator": "Id",
    "onAttribute": "value"
}

Rhino Literal

select from combo box {['1', '2']} on {select_menu_multiple} using {id} from {value}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "['1', '2']",
    OnElement: "select_menu_multiple",
    Locator: "Id",
    OnAttribute: "value"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "['1', '2']",
    "onElement": "select_menu_multiple",
    "locator": "Id",
    "onAttribute": "value"
}

Java Script

action_rule = {
    action: "SelectFromComboBox",
    argument: "['1', '2']",
    onElement: "select_menu_multiple",
    locator: "Id",
    onAttribute: "value"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("['1', '2']")
        .setOnElement("select_menu_multiple")
        .setLocator("Id")
        .setOnAttribute("value");

Example no. 6

Can be tested on

Selects multiple values from select_menu_multiple combo box, by item index.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "['1', '2']",
    "onElement": "select_menu_multiple",
    "locator": "Id",
    "onAttribute": "index"
}

Rhino Literal

select from combo box {['1', '2']} on {select_menu_multiple} using {id} from {index}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "['1', '2']",
    OnElement: "select_menu_multiple",
    Locator: "Id",
    OnAttribute: "index"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "['1', '2']",
    "onElement": "select_menu_multiple",
    "locator": "Id",
    "onAttribute": "index"
}

Java Script

action_rule = {
    action: "SelectFromComboBox",
    argument: "['1', '2']",
    onElement: "select_menu_multiple",
    locator: "Id",
    onAttribute: "index"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("['1', '2']")
        .setOnElement("select_menu_multiple")
        .setLocator("Id")
        .setOnAttribute("index");

Example no. 6

Can be tested on

Selects all values from select_menu_multiple combo box.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "{{$ --all}}",
    "onElement": "select_menu_multiple",
    "locator": "Id"
}

Rhino Literal

select from combo box {{$ --all}} on {select_menu_multiple} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "{{$ --all}}",
    OnElement: "select_menu_multiple",
    Locator: "Id"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "{{$ --all}}",
    "onElement": "select_menu_multiple",
    "locator": "Id"
}

Java Script

action_rule = {
    action: "SelectFromComboBox",
    argument: "{{$ --all}}",
    onElement: "select_menu_multiple",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("{{$ --all}}")
        .setOnElement("select_menu_multiple")
        .setLocator("Id");

Example no. 7

Can be tested on

Selects all values from select_menu_multiple combo box if the option inner text match T.

Action Rule (JSON)

{
    "action": "SelectFromComboBox",
    "argument": "{{$ --all}}",
    "onElement": "select_menu_multiple",
    "locator": "Id",
    "regularExpression": "T"
}

Rhino Literal

select from combo box {{$ --all}} on {select_menu_multiple} using {id} filter {T}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.SelectFromComboBox,
    Argument = "{{$ --all}}",
    OnElement: "select_menu_multiple",
    Locator: "Id",
    RegularExpression: "T"
};

Python

action_rule = {
    "action": "SelectFromComboBox",
    "argument": "{{$ --all}}",
    "onElement": "select_menu_multiple",
    "locator": "Id",
    "regularExpression": "T"
}

Java Script

action_rule = {
    action: "SelectFromComboBox",
    argument: "{{$ --all}}",
    onElement: "select_menu_multiple",
    locator: "Id",
    regularExpression: "T"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("SelectFromComboBox")
        .setArgument("{{$ --all}}")
        .setOnElement("select_menu_multiple")
        .setLocator("Id")
        .setRegularExpression("T");

Clone this wiki locally