Skip to content

assert_samples_no3

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

Content

Examples: selected

Example no. 1

Can be tested on

Assert that <input id="input_selected"> element is selected.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --selected}}",
    "onElement": "input_selected",
    "locator": "Id"
}

Rhino Literal

assert {{$ --selected}} on {input_selected} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --selected}}",
    OnElement = "input_selected",
    Locator = LocatorsList.Id
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --selected}}",
    "onElement": "input_selected",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --selected}}",
    onElement: "input_selected",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --selected}}")
        .setOnElement("input_selected")
        .setLocator("Id");

Examples: stale

Example no. 1

Can be tested on

Assert that <div id="for_stale_element"> element is stale.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --stale}}",
    "onElement": "for_stale_element",
    "locator": "Id"
}

Rhino Literal

assert {{$ --selected}} on {input_selected} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --stale}}",
    OnElement = "for_stale_element",
    Locator = LocatorsList.Id
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --stale}}",
    "onElement": "for_stale_element",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --stale}}",
    onElement: "for_stale_element",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --stale}}")
        .setOnElement("for_stale_element")
        .setLocator("Id");

Examples: text

Example no. 1

Can be tested on

Assert that text for testing inner text equals Foo Bar.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --eq:Foo Bar}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --eq:Foo Bar}} on {text for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --eq:Foo Bar}}",
    OnElement = "text for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --eq:Foo Bar}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --eq:Foo Bar}}",
    onElement: "text for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --eq:Foo Bar}}")
        .setOnElement("text for testing")
        .setLocator("Name")

Example no. 2

Can be tested on

Assert that text for testing inner text not equals Bar Foo.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --ne:Bar Foo}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --ne:Bar Foo}} on {text for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --ne:Bar Foo}}",
    OnElement = "text for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --ne:Bar Foo}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --ne:Bar Foo}}",
    onElement: "text for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --ne:Bar Foo}}")
        .setOnElement("text for testing")
        .setLocator("Name")

Example no. 3

Can be tested on

Assert that text for testing inner text matches ^Foo Bar$.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --match:^Foo Bar$}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --match:^Foo Bar$}} on {text for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --match:^Foo Bar$}}",
    OnElement = "text for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --match:^Foo Bar$}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --match:^Foo Bar$}}",
    onElement: "text for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --match:^Foo Bar$}}")
        .setOnElement("text for testing")
        .setLocator("Name")

Example no. 4

Can be tested on

Assert that text for testing inner text not match ^Bar Foo$.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --not_match:^Bar Foo$}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --not_match:^Bar Foo$}} on {text for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --not_match:^Bar Foo$}}",
    OnElement = "text for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --not_match:^Bar Foo$}}",
    "onElement": "text for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --not_match:^Bar Foo$}}",
    onElement: "text for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --not_match:^Bar Foo$}}")
        .setOnElement("text for testing")
        .setLocator("Name")

Example no. 5

Can be tested on

Assert that number for testing inner text is greater than 1.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --gt:1}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --gt:1}} on {number for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --gt:1}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --gt:1}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --gt:1}}",
    onElement: "number for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --gt:1}}")
        .setOnElement("number for testing")
        .setLocator("Name");

Example no. 6

Can be tested on

Assert that number for testing inner text is lower than 100.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --lt:100}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --lt:100}} on {number for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --lt:100}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --lt:100}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --lt:100}}",
    onElement: "number for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --lt:100}}")
        .setOnElement("number for testing")
        .setLocator("Name");

Example no. 7

Can be tested on

Assert that number for testing inner text is greater or equal 10.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --ge:10}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --ge:10}} on {number for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --ge:10}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --ge:10}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --ge:10}}",
    onElement: "number for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --ge:10}}")
        .setOnElement("number for testing")
        .setLocator("Name");

Example no. 8

Can be tested on

Assert that number for testing inner text is lower or equal 10.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --text --le:10}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Rhino Literal

assert {{$ --text --ge:10}} on {number for testing} using {name}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --text --le:10}}",
    OnElement = "number for testing",
    Locator = LocatorsList.Name
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --text --le:10}}",
    "onElement": "number for testing",
    "locator": "Name"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --text --le:10}}",
    onElement: "number for testing",
    locator: "Name"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --text --le:10}}")
        .setOnElement("number for testing")
        .setLocator("Name");

Examples: title

Example no. 1

Can be tested on

Assert that IWebDriver.Title equals UI Controls v10 - Contoso University.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --eq:UI Controls v10 - Contoso University}}"
}

Rhino Literal

assert {{$ --title --eq:UI Controls v10 - Contoso University}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --eq:UI Controls v10 - Contoso University}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --eq:UI Controls v10 - Contoso University}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --eq:UI Controls v10 - Contoso University}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --eq:UI Controls v10 - Contoso University}}");

Example no. 2

Can be tested on

Assert that IWebDriver.Title not equals Contoso University - UI Controls v10.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --ne:Contoso University - UI Controls v10}}"
}

Rhino Literal

assert {{$ --title --ne:Contoso University - UI Controls v10}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --ne:Contoso University - UI Controls v10}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --ne:Contoso University - UI Controls v10}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --ne:Contoso University - UI Controls v10}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --ne:Contoso University - UI Controls v10}}");

Example no. 3

Can be tested on

Assert that IWebDriver.Title matches ^UI Controls.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --match:^UI Controls}}"
}

Rhino Literal

assert {{$ --title --match:^UI Controls}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --match:^UI Controls}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --match:^UI Controls}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --match:^UI Controls}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --match:^UI Controls}}");

Example no. 4

Can be tested on

Assert that IWebDriver.Title not match UI Controls v10$.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --not_match:UI Controls v10$}}"
}

Rhino Literal

assert {{$ --title --not_match:UI Controls v10$}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --not_match:UI Controls v10$}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --not_match:UI Controls v10$}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --not_match:UI Controls v10$}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --not_match:UI Controls v10$}}");

Example no. 5

Can be tested on

Assert that IWebDriver.Title filtered by \d+ regular expression, is greater than 1.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --gt:1}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --title --gt:1}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --gt:1}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --gt:1}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --gt:1}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --gt:1}}")
        .setRegularExpression("\\d+");

Example no. 6

Can be tested on

Assert that IWebDriver.Title filtered by \d+ regular expression, is lower than 100.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --lt:100}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --title --gt:100}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --lt:100}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --lt:100}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --lt:100}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --lt:100}}")
        .setRegularExpression("\\d+");

Example no. 7

Can be tested on

Assert that IWebDriver.Title filtered by \d+ regular expression, is greater or equal 10.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --ge:10}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --title --ge:10}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --ge:10}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --ge:10}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --ge:10}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --ge:10}}")
        .setRegularExpression("\\d+");

Example no. 8

Can be tested on

Assert that IWebDriver.Title filtered by \d+ regular expression, is lower or equal 10.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --title --le:10}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --title --ge:10}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --title --le:10}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --title --le:10}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --title --le:10}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --title --le:10}}")
        .setRegularExpression("\\d+");

Examples: url

Example no. 1

Can be tested on

Assert that IWebDriver.Url equals https://gravitymvctestapplication.azurewebsites.net/course/.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/course/}}"
}

Rhino Literal

assert {{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/course/}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/course/}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/course/}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/course/}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --eq:https://gravitymvctestapplication.azurewebsites.net/course/}}");

Example no. 2

Can be tested on

Assert that IWebDriver.Url not equals https://gravitymvctestapplication.azurewebsites.net/.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}"
}

Rhino Literal

assert {{$ --title --ne:https://gravitymvctestapplication.azurewebsites.net/}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --ne:https://gravitymvctestapplication.azurewebsites.net/}}");

Example no. 3

Can be tested on

Assert that IWebDriver.Url matches course/$.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --match:course/$}}"
}

Rhino Literal

assert {{$ --url --match:course/$}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --match:course/$}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --match:course/$}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --match:course/$}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --match:course/$}}");

Example no. 4

Can be tested on

Assert that IWebDriver.Url not match ^course/.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --not_match:^course/}}"
}

Rhino Literal

assert {{$ --title --not_match:^course/}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --not_match:^course/}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --not_match:^course/}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --not_match:^course/}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --not_match:^course/}}");

Example no. 5

Can be tested on

Assert that IWebDriver.Url filtered by \d+ regular expression, is greater than 1000.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --gt:1000}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --title --gt:1000}} filter {\\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --gt:1000}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --gt:1000}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --gt:1000}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --gt:1000}}")
        .setRegularExpression("\\d+");

Example no. 6

Can be tested on

Assert that IWebDriver.Url filtered by \d+ regular expression, is lower than 2000.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --lt:2000}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --url --lt:2000}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --lt:2000}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --lt:2000}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --lt:2000}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --lt:2000}}")
        .setRegularExpression("\\d+");

Example no. 7

Can be tested on

Assert that IWebDriver.Url filtered by \d+ regular expression, is greater or equal 1045.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --ge:1045}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --url --ge:1045}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --ge:1045}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --ge:1045}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --ge:1045}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --ge:1045}}")
        .setRegularExpression("\\d+");

Example no. 8

Can be tested on

Assert that IWebDriver.Url filtered by \d+ regular expression, is lower or equal 1045.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --url --le:1045}}",
    "regularExpression": "\\d+"
}

Rhino Literal

assert {{$ --url --le:1045}} filter {\d+}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --url --le:1045}}",
    RegularExpression = "\\d+"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --url --le:1045}}",
    "regularExpression": "\\d+"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --url --le:1045}}",
    regularExpression: "\\d+"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --url --le:1045}}")
        .setRegularExpression("\\d+");

Examples: visible

Example no. 1

Can be tested on

Assert that <input id="input_enabled"> element is visible.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --visible}}",
    "onElement": "input_enabled",
    "locator": "Id"
}

Rhino Literal

assert {{$ --visible}} on {input_enabled} using {id}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --visible}}",
    OnElement = "input_enabled",
    Locator = LocatorsList.Id
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --visible}}",
    "onElement": "input_enabled",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --visible}}",
    onElement: "input_enabled",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --visible}}")
        .setOnElement("input_enabled")
        .setLocator("Id");

Examples: windows_count

Example no. 1

Can be tested on

Assert that IWebDriver.WindowHandles count equals 1.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --eq:1}}"
}

Rhino Literal

assert {{$ --windows_count --eq:1}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --eq:1}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --eq:1}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --eq:1}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --eq:1}}");

Example no. 2

Can be tested on

Assert that IWebDriver.WindowHandles count not equals 0.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --ne:0}}"
}

Rhino Literal

assert {{$ --windows_count --ne:0}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --ne:0}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --ne:0}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --ne:0}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --ne:0}}");

Example no. 3

Assert that IWebDriver.WindowHandles count matches \d{1}.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --match:\\d{1}}}"
}

Rhino Literal

assert {{$ --windows_count --match:\d{1}}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --match:\\d{1}}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --match:\\d{1}}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --match:\\d{1}}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --match:\\d{1}}}");

Example no. 4

Can be tested on

Assert that IWebDriver.WindowHandles count not match 1\d+.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --not_match:1\\d+}}"
}

Rhino Literal

assert {{$ --windows_count --not_match:1\d+}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --not_match:1\\d+}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --not_match:1\\d+}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --not_match:1\\d+}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --not_match:1\\d+}}");

Example no. 5

Assert that IWebDriver.WindowHandles count is greater than 0.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --gt:0}}"
}

Rhino Literal

assert {{$ --windows_count --gt:0}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --gt:0}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --gt:0}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --gt:0}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --gt:0}}");

Example no. 6

Can be tested on

Assert that IWebDriver.WindowHandles count is lower than 10.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --lt:10}}"
}

Rhino Literal

assert {{$ --windows_count --lt:10}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --lt:10}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --lt:10}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --lt:10}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --lt:10}}");

Example no. 7

Can be tested on

Assert that IWebDriver.WindowHandles count is greater or equal 1.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --ge:1}}"
}

Rhino Literal

assert {{$ --windows_count --ge:1}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --ge:1}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --ge:1}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --ge:1}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --ge:1}}");

Example no. 8

Can be tested on

Assert that IWebDriver.WindowHandles count is lower or equal 1.

Action Rule (JSON)

{
    "action": "Assert",
    "argument": "{{$ --windows_count --le:1}}"
}

Rhino Literal

assert {{$ --windows_count --le:1}}

CSharp

var actionRule = new ActionRule
{
    Action = PluginsList.Assert,
    Argument = "{{$ --windows_count --le:1}}"
};

Python

action_rule = {
    "action": "Assert",
    "argument": "{{$ --windows_count --le:1}}"
}

Java Script

var actionRule = {
    action: "Assert",
    argument: "{{$ --windows_count --le:1}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("Assert")
        .setArgument("{{$ --windows_count --le:1}}");

Clone this wiki locally