Skip to content

condition_samples_no3

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

Content

Examples: selected

Example no. 1

Can be tested on

Executes nested actions if <input id="input_selected"> element is selected.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --selected}}",
    "onElement": "input_selected",
    "locator": "Id"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --selected}} on {input_selected} using {id}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --selected}}",
    OnElement = "input_selected",
    Locator = LocatorsList.Id,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --selected}}",
    "onElement": "input_selected",
    "locator": "Id"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --selected}}",
    onElement: "input_selected",
    locator: "Id"
    actions: [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --selected}}")
        .setOnElement("input_selected")
        .setLocator("Id")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Examples: stale

Can be tested on

Executes nested actions if <div id="for_stale_element"> element is stale.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --stale}}",
    "onElement": "for_stale_element",
    "locator": "Id"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --stale}} on {for_stale_element} using {id}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --stale}}",
    OnElement = "for_stale_element",
    Locator = LocatorsList.Id,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --stale}}",
    "onElement": "for_stale_element",
    "locator": "Id"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --stale}}",
    onElement: "for_stale_element",
    locator: "Id"
    actions: [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --stale}}")
        .setOnElement("for_stale_element")
        .setLocator("Id")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Examples: text

Example no. 1

Can be tested on

Executes nested actions if //h2 inner text equals Students.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --eq:Students}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --eq:Students}} on {//h2}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --eq:Students}}",
    OnElement = "//h2",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --eq:Students}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --eq:Students}}",
    onElement: "//h2",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --eq:Students}}")
        .setOnElement("//h2")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 2

Can be tested on

Executes nested actions if //h2 inner text not equals Not Students.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --ne:Not Students}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --ne:Not Students}} on {//h2}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --ne:Not Students}}",
    OnElement = "//h2",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --ne:Not Students}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --ne:Not Students}}",
    onElement: "//h2",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --ne:Not Students}}")
        .setOnElement("//h2")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 3

Can be tested on

Executes nested actions if //h2 inner text matches ^Students$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --match:^Students$}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --match:^Students$}} on {//h2}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --match:^Students$}}",
    OnElement = "//h2",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --match:^Students$}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --match:^Students$}}",
    onElement: "//h2",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --match:^Students$}}")
        .setOnElement("//h2")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 4

Can be tested on

Executes nested actions if //h2 inner text not matches ^Not Students$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --not_match:^Not Students$}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --not_match:^Not Students$}} on {//h2}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --not_match:^Not Students$}}",
    OnElement = "//h2",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --not_match:^Not Students$}}",
    "onElement": "//h2",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --not_match:^Not Students$}}",
    onElement: "//h2",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --not_match:^Not Students$}}")
        .setOnElement("//h2")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 5

Can be tested on

Executes nested actions if number for testing inner text greater than 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --gt:1}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --gt:1}} on {number for testing} using {name}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --gt:1}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --gt:1}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --gt:1}}",
    onElement: "number for testing",
    locator: "Name",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --gt:1}}")
        .setOnElement("number for testing")
        .setLocator("Name")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 6

Can be tested on

Executes nested actions if number for testing inner text lower than 1000.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --lt:1000}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --lt:1000}} on {number for testing} using {name}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --lt:1000}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --lt:1000}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --lt:1000}}",
    onElement: "number for testing",
    locator: "Name",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --lt:1000}}")
        .setOnElement("number for testing")
        .setLocator("Name")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 7

Can be tested on

Executes nested actions if number for testing inner text greater or equal 10.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --ge:10}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --ge:10}} on {number for testing} using {name}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --ge:10}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --ge:10}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --ge:10}}",
    onElement: "number for testing",
    locator: "Name",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --ge:10}}")
        .setOnElement("number for testing")
        .setLocator("Name")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 8

Can be tested on

Executes nested actions if number for testing inner text lower or equal 10.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --text --le:10}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --text --le:10}} on {number for testing} using {name}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --text --le:10}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --text --le:10}}",
    "onElement": "number for testing",
    "locator": "Name",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --text --le:10}}",
    onElement: "number for testing",
    locator: "Name",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --text --le:10}}")
        .setOnElement("number for testing")
        .setLocator("Name")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Examples: title

Example no. 1

Can be tested on

Executes nested actions if IWebDriver.Title equals Students - Contoso University.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --eq:Students - Contoso University}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --eq:Students - Contoso University}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --eq:Students - Contoso University}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --eq:Students - Contoso University}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --eq:Students - Contoso University}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --eq:Students - Contoso University}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 2

Can be tested on

Executes nested actions if IWebDriver.Title not equals Contoso University - Students.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --ne:Contoso University - Students}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --ne:Contoso University - Students}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --ne:Contoso University - Students}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --ne:Contoso University - Students}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --ne:Contoso University - Students}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --ne:Contoso University - Students}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 3

Can be tested on

Executes nested actions if IWebDriver.Title matches ^Students - Contoso University$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --match:^Students - Contoso University$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --match:^Students - Contoso University$}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --match:^Students - Contoso University$}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --match:^Students - Contoso University$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --match:^Students - Contoso University$}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --match:^Students - Contoso University$}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 4

Can be tested on

Executes nested actions if IWebDriver.Title not match ^Contoso University - Students$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --not_match:^Contoso University - Students$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --not_match:^Contoso University - Students$}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --not_match:^Contoso University - Students$}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --not_match:^Contoso University - Students$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --not_match:^Contoso University - Students$}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --not_match:^Contoso University - Students$}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 5

Can be tested on

Executes nested actions if IWebDriver.Title is greater than 1 filtered by \d+ regular expression.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --gt:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --gt:1}} filter {\d+}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --gt:1}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --gt:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --gt:1}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --gt:1}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 6

Can be tested on

Executes nested actions if IWebDriver.Title is lower than 1000 filtered by \d+ regular expression.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --lt:1000}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --lt:1000}} filter {\d+}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --lt:1000}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --lt:1000}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --lt:1000}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --lt:1000}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 7

Can be tested on

Executes nested actions if IWebDriver.Title is greater or equal 10 filtered by \d+ regular expression.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --ge:10}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --ge:10}} filter {\d+}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --ge:10}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --ge:10}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --ge:10}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --ge:10}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 8

Can be tested on

Executes nested actions if IWebDriver.Title is lower or equal 10 filtered by \d+ regular expression.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --title --le:10}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --title --le:10}} filter {\d+}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --title --le:10}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --title --le:10}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --title --le:10}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --title --le:10}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Examples: url

Example no. 1

Can be tested on

Executes nested actions if IWebDriver.Url equals https://gravitymvctestapplication.azurewebsites.net/student/.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/student/}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/student/}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/student/}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/student/}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/student/}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/student/}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 2

Can be tested on

Executes nested actions if IWebDriver.Url not equals https://gravitymvctestapplication.azurewebsites.net/.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 3

Can be tested on

Executes nested actions if IWebDriver.Url matches student/$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --match:student/$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --url --match:student/$}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --match:student/$}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --match:student/$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --match:student/$}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --match:student/$}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 4

Can be tested on

Executes nested actions if IWebDriver.Url not matche ^student/.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --not_match:^student/}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --url --not_match:^student/}}
    > type {Carson} into {SearchString} using {id}
    > click on {SearchButton} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --not_match:^student/}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "Carson",
            OnElement = "SearchString",
            Locator = LocatorsList.Id,
        },
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "SearchButton",
            Locator = LocatorsList.Id,
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --not_match:^student/}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "Carson",
            "onElement": "SearchString",
            "locator": "Id"
        },
        {
            "action": "Click",
            "onElement": "SearchButton",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --not_match:^student/}}",
    actions: [
        {
            action: "SendKeys",
            argument: "Carson",
            onElement: "SearchString",
            locator: "Id"
        },
        {
            action: "Click",
            onElement: "SearchButton",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --not_match:^student/}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("Carson")
                    .setOnElement("SearchString")
                    .setLocator("Id"),
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("SearchButton")
                    .setLocator("Id"));

Example no. 5

Can be tested on

Executes nested actions if IWebDriver.Url filter by regular expression \d+ is greater than 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --gt:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Rhino Literal

condition {{$ --url --gt:0}} filter {\d+}
    > click on {Back to List} using {link text}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --gt:1}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "Back to List",
            Locator = LocatorsList.LinkText
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --gt:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --gt:1}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "Click",
            onElement: "Back to List",
            locator: "LinkText"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --gt:1}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("Back to List")
                    .setLocator("LinkText"));

Example no. 6

Can be tested on

Executes nested actions if IWebDriver.Url filter by regular expression \d+ is lower than 10.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --le:10}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Rhino Literal

condition {{$ --url --le:10}} filter {\d+}
    > click on {Back to List} using {link text}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --le:10}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "Back to List",
            Locator = LocatorsList.LinkText
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --le:10}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --le:10}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "Click",
            onElement: "Back to List",
            locator: "LinkText"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --le:10}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("Back to List")
                    .setLocator("LinkText"));

Example no. 7

Can be tested on

Executes nested actions if IWebDriver.Url filter by regular expression \d+ is greater or equal 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --ge:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Rhino Literal

condition {{$ --url --ge:1}} filter {\d+}
    > click on {Back to List} using {link text}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --ge:1}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "Back to List",
            Locator = LocatorsList.LinkText
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --ge:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --ge:1}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "Click",
            onElement: "Back to List",
            locator: "LinkText"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --ge:1}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("Back to List")
                    .setLocator("LinkText"));

Example no. 8

Can be tested on

Executes nested actions if IWebDriver.Url filter by regular expression \d+ is lower or equal 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --url --le:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Rhino Literal

condition {{$ --url --le:1}} filter {\d+}
    > click on {Back to List} using {link text}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --url --le:1}}",
    RegularExpression = "\\d+",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.Click,
            OnElement = "Back to List",
            Locator = LocatorsList.LinkText
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --url --le:1}}",
    "regularExpression": "\\d+"
    "actions": [
        {
            "action": "Click",
            "onElement": "Back to List",
            "locator": "LinkText"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --url --le:1}}",
    regularExpression: "\\d+"
    actions: [
        {
            action: "Click",
            onElement: "Back to List",
            locator: "LinkText"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --url --le:1}}")
        .setRegularExpression("\\d+")
        .setActions(
            new ActionRule()
                    .setAction("Click")
                    .setOnElement("Back to List")
                    .setLocator("LinkText"));

Examples: visible

Example no. 1

Can be tested on

Executes nested actions if <input id="input_enabled"> element is visible.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --visible}}",
    "onElement": "input_enabled",
    "locator": "Id",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --visible}} on {input_enabled} using {id}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --visible}}",
    OnElement = "input_enabled",
    Locator = LocatorsList.Id,
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --visible}}",
    "onElement": "input_enabled",
    "locator": "Id",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --visible}}",
    onElement: "input_enabled",
    locator: "Id",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --visible}}")
        .setOnElement("input_enabled")
        .setLocator("Id")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Examples: windows_count

Example no. 1

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count equals 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --eq:1}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --eq:1}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --eq:1}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --eq:1}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --eq:1}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --eq:1}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 2

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count not equals 0.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --ne:0}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --eq:1}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --ne:0}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --ne:0}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --ne:0}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --ne:0}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 3

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count matches ^1$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --match:^1$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --match:^1$}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --match:^1$}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --match:^1$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --match:^1$}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --match:^1$}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 4

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count not match ^0$.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --not_match:^0$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --not_match:^0$}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --not_match:^0$}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --not_match:^0$}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --not_match:^0$}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --not_match:^0$}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 5

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count greater than 0.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --gt:0}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --gt:0}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --gt:0}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --gt:0}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --gt:0}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --gt:0}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 6

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count lower than 10.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --lt:10}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --lt:10}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --lt:10}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --lt:10}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --lt:10}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --lt:10}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 7

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count greater or equal 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --ge:1}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --ge:1}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --ge:1}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --ge:1}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --ge:1}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --ge:1}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Example no. 8

Can be tested on

Executes nested actions if IWebDriver.WindowHandles count lower or equal 1.

Action Rule (JSON)

{
    "action": "Condition",
    "argument": "{{$ --windows_count --le:1}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Rhino Literal

condition {{$ --windows_count --le:1}}
    > type {20} into {number_of_alerts} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Condition,
    Argument = "{{$ --windows_count --le:1}}",
    Actions = new[]
    {
        new ActionRule
        {
            Action = PluginsList.SendKeys,
            Argument = "20",
            OnElement = "number_of_alerts",
            Locator = LocatorsList.Id
        }
    }
};

Python

action_rule = {
    "action": "Condition",
    "argument": "{{$ --windows_count --le:1}}",
    "actions": [
        {
            "action": "SendKeys",
            "argument": "20",
            "onElement": "number_of_alerts",
            "locator": "Id"
        }
    ]
}

Java Script

var actionRule = {
    action: "Condition",
    argument: "{{$ --windows_count --le:1}}",
    actions: [
        {
            action: "SendKeys",
            argument: "20",
            onElement: "number_of_alerts",
            locator: "Id"
        }
    ]
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Condition")
        .setArgument("{{$ --windows_count --le:1}}")
        .setActions(
            new ActionRule()
                    .setAction("SendKeys")
                    .setArgument("20")
                    .setOnElement("number_of_alerts")
                    .setLocator("Id"));

Clone this wiki locally