-
Notifications
You must be signed in to change notification settings - Fork 0
repeat
Repeats the nested actions until a condition is met. All conditions under ConditionsFactory are available.
Web, Mobile Web, Mobile Native or any other Web Driver implementation.
| Property | Description |
|---|---|
| actions | The sub set actions to execute when condition is met. |
| argument | Plugin conditions and additional information. |
| onAttribute | The element attribute from which to extract information for action execution. If not specified, information will be taken from the element inner text. |
| onElement | The locator value by which the element will be found. |
| locator | The locator type by which the element will be found. |
| regularExpression | A pattern by which the extracted information will be evaluated. Returns the first match. |
Return true if the ActionRule.OnAttribute value meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The attribute value and the provided value (expected) are equal. |
| ne | The attribute value and the provided value (expected) are not equal. |
| match | The attribute value matches to ActionRule.RegularExpression property. |
| not_match | The attribute value does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The attribute value is greater than provided value (expected). |
| lt | Applies for numbers only: The attribute value is lower than provided value (expected). |
| ge | Applies for numbers only: The attribute value is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The attribute value is lower or equal to the provided value (expected). |
Return true if the ActionRule.OnElement count (total elements found by the locator) meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The actual count and the provided value (expected) are equal. |
| ne | The actual count and the provided value (expected) are not equal. |
| match | The actual count matches to ActionRule.RegularExpression property. |
| not_match | The actual count does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The actual count is greater than provided value (expected). |
| lt | Applies for numbers only: The actual count is lower than provided value (expected). |
| ge | Applies for numbers only: The actual count is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The actual count is lower or equal to the provided value (expected). |
Return true if the element exists in the DOM and it is not enabled.
Return true if the IWebDriver.FullName value meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The driver full name value and the provided value (expected) are equal. |
| ne | The driver full name value and the provided value (expected) are not equal. |
| match | The driver full name value matches to ActionRule.RegularExpression property. |
| not_match | The driver full name value does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The driver full name value is greater than provided value (expected). |
| lt | Applies for numbers only: The driver full name value is lower than provided value (expected). |
| ge | Applies for numbers only: The driver full name value is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The driver full name value is lower or equal to the provided value (expected). |
Return true if the element exists in the DOM and it is enabled.
Return true if the element exists in the DOM.
Return true if the element exists in the DOM and it is not visible.
Return true if the element does not exists in the DOM.
Return true if the element exists in the DOM and it is selected.
Return true if the element is stale (element reference out dated or broken).
Return true if the ActionRule.OnElement inner text meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The text value and the provided value (expected) are equal. |
| ne | The text value and the provided value (expected) are not equal. |
| match | The text value matches to ActionRule.RegularExpression property. |
| not_match | The text value does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The text value is greater than provided value (expected). |
| lt | Applies for numbers only: The text value is lower than provided value (expected). |
| ge | Applies for numbers only: The text value is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The text value is lower or equal to the provided value (expected). |
Return true if the IWebDriver.Title value meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The title and the provided value (expected) are equal. |
| ne | The title and the provided value (expected) are not equal. |
| match | The title matches to ActionRule.RegularExpression property. |
| not_match | The title does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The title is greater than provided value (expected). |
| lt | Applies for numbers only: The title is lower than provided value (expected). |
| ge | Applies for numbers only: The title is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The title is lower or equal to the provided value (expected). |
Return true if the IWebDriver.Url value meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The URL and the provided value (expected) are equal. |
| ne | The URL and the provided value (expected) are not equal. |
| match | The URL matches to ActionRule.RegularExpression property. |
| not_match | The URL does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The URL is greater than provided value (expected). |
| lt | Applies for numbers only: The URL is lower than provided value (expected). |
| ge | Applies for numbers only: The URL is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The URL is lower or equal to the provided value (expected). |
Return true if the element is stale (element reference out dated or broken).
Return true if the IWebDriver.WindowHandles count (total open tabs/windows) meets a condition. The text based conditions are case sensitive.
| Value | Description |
|---|---|
| eq | The actual count and the provided value (expected) are equal. |
| ne | The actual count and the provided value (expected) are not equal. |
| match | The actual count matches to ActionRule.RegularExpression property. |
| not_match | The actual count does not match to ActionRule.RegularExpression property. |
| gt | Applies for numbers only: The actual count is greater than provided value (expected). |
| lt | Applies for numbers only: The actual count is lower than provided value (expected). |
| ge | Applies for numbers only: The actual count is greater or equal to the provided value (expected). |
| le | Applies for numbers only: The actual count is lower or equal to the provided value (expected). |
None
Can be tested on
Repeat SendKeys action with a argument into //input[@id='SearchString'], 10 times.
{
"action": "Repeat",
"argument": "10",
"actions": [
{
"action": "SendKeys",
"argument": "a",
"onElement": "//input[@id='SearchString']"
}
]
}repeat {10}
> type {a} into {//input[@id='SearchString']}
var actionRule = new ActionRule
{
Action = "Repeat",
Argument = "10",
Actions = new[]
{
new ActionRule
{
Action = "SendKeys",
Argument = "a",
OnElement = "//input[@id='SearchString']"
}
};
};action_rule = {
"action": "Repeat",
"argument": "10",
"actions": [
{
"action": "SendKeys",
"argument": "a",
"onElement": "//input[@id='SearchString']"
}
]
}var actionRule = {
action: "Repeat",
argument: "10",
actions: [
{
action: "SendKeys",
argument: "a",
onElement: "//input[@id='SearchString']"
}
]
};ActionRule actionRule = new ActionRule()
.setAction("Repeat")
.setArgument("10")
.setActions(
new ActionRule()
.setAction("SendKeys")
.setArgument("a")
.setOnElement("//input[@id='SearchString']"));Can be tested on
Repeat Click action on //a[contains(.,'Next') and @class='btn btn-default '], until element //a[contains(.,'Next') and @class='btn btn-default disabled'] exists.
{
"action": "Repeat",
"argument": "{{$ --until:exists}}",
"onElement": "//a[contains(.,'Next') and @class='btn btn-default disabled']"
"actions": [
{
"action": "Click",
"onElement": "//a[contains(.,'Next') and @class='btn btn-default ']"
}
]
}repeat {{$ --until:exists}} on {//a[contains(.,'Next') and @class='btn btn-default disabled']}
> click on {//a[contains(.,'Next') and @class='btn btn-default ']}
var actionRule = new ActionRule
{
Action = "Repeat",
Argument = "{{$ --until:exists}}",
OnElement = "//a[contains(.,'Next') and @class='btn btn-default disabled']",
Actions = new[]
{
new ActionRule
{
Action = "Click",
OnElement = "//a[contains(.,'Next') and @class='btn btn-default ']"
}
};
};action_rule = {
"action": "Repeat",
"argument": "{{$ --until:exists}}",
"onElement": "//a[contains(.,'Next') and @class='btn btn-default disabled']"
"actions": [
{
"action": "Click",
"onElement": "//a[contains(.,'Next') and @class='btn btn-default ']"
}
]
}var actionRule = {
action: "Repeat",
argument: "{{$ --until:exists}}",
onElement: "//a[contains(.,'Next') and @class='btn btn-default disabled']",
actions: [
{
action: "Click",
onElement: "//a[contains(.,'Next') and @class='btn btn-default ']"
}
]
};ActionRule actionRule = new ActionRule()
.setAction("Repeat")
.setArgument("{{$ --until:exists}}")
.setOnElement("//a[contains(.,'Next') and @class='btn btn-default disabled']")
.setActions(
new ActionRule()
.setAction("Click")
.setOnElement("//a[contains(.,'Next') and @class='btn btn-default ']"));Can be tested on
For each repeat SendKeys action with a argument into //input[@id='SearchString'], repeat SendKeys action with b argument into //input[@id='SearchString'] (repeat inside repeat)..
{
"action": "Repeat",
"argument": "2",
"actions": [
{
"action": "SendKeys",
"argument": "a",
"onElement": "//input[@id='SearchString']"
},
{
"action": "Repeat",
"argument": "3",
"actions": [
{
"action": "SendKeys",
"argument": "b",
"onElement": "//input[@id='SearchString']"
}
]
}
]
}repeat {2}
> send keys {a} into {//input[@id='SearchString']}
> repeat {6}
> send keys {b} into {//input[@id='SearchString']}
var actionRule = new ActionRule
{
Action = "Repeat",
Argument = "2",
Actions = new[]
{
new ActionRule
{
Action = "SendKeys",
Argument = "a",
OnElement = "//input[@id='SearchString']"
},
new ActionRule
{
Action = "Repeat",
Argument = "3",
Actions = new[]
{
new ActionRule
{
Action = "SendKeys",
Argument = "b",
OnElement = "//input[@id='SearchString']"
}
}
}
};
};action_rule = {
"action": "Repeat",
"argument": "2",
"actions": [
{
"action": "SendKeys",
"argument": "a",
"onElement": "//input[@id='SearchString']"
},
{
"action": "Repeat",
"argument": "3",
"actions": [
{
"action": "SendKeys",
"argument": "b",
"onElement": "//input[@id='SearchString']"
}
]
}
]
}var actionRule = {
action: "Repeat",
argument: "2",
actions: [
{
action: "SendKeys",
argument: "a",
onElement: "//input[@id='SearchString']"
},
{
action: "Repeat",
argument: "3",
actions: [
{
action: "SendKeys",
argument: "b",
onElement: "//input[@id='SearchString']"
}
]
}
]
};ActionRule actionRule = new ActionRule()
.setAction("Repeat")
.setArgument("2")
.setActions(
new ActionRule()
.setAction("SendKeys")
.setArgument("a")
.setOnElement("//input[@id='SearchString']"),
new ActionRule()
.setAction("Repeat")
.setArgument("3")
.setActions(
new ActionRule()
.setAction("SendKeys")
.setArgument("a")
.setOnElement("//input[@id='SearchString']")));