-
Notifications
You must be signed in to change notification settings - Fork 0
register_parameter
Saves a parameter under application parameters collection (key/value collection), which allows other actions to access and use the saved value. This action supports locators, elements, attributes, regular expressions and macros.
Web, Mobile Web, Mobile Native or any other Web Driver implementation.
| Property | Description |
|---|---|
| argument | Plugin conditions and additional information. |
| elementAttributeToActOn | The element attribute from which to extract information for action execution. If not specified, information will be taken from the element inner text. |
| elementToActOn | 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. |
Sets the [key] of the parameter. The [key] is the parameter name and will be used by other actions when calling this parameter.
Sets the [value] of the parameter. If this argument is provided, this plugin will ignore any element based value, even if element information was provided.
None
Save //tr[1]/td[2] inner text into [first_name] application parameter.
{
"actionType": "RegisterParameter",
"argument": "first_name",
"elementToActOn": "//tr[1]/td[2]"
}register parameter {first_name} take {//tr[1]/td[2]}
// option no.1
var actionRule = new ActionRule
{
ActionType = CommonPlugins.RegisterParameter,
Argument = "first_name",
ElementToActOn = "//tr[1]/td[2]"
};
// option no.2
var actionRule = new
{
ActionType = "RegisterParameter",
Argument = "first_name",
ElementToActOn = "//tr[1]/td[2]"
};action_rule = {
"actionType": "RegisterParameter",
"argument": "first_name",
"elementToActOn": "//tr[1]/td[2]"
}var actionRule = {
actionType: "RegisterParameter",
argument: "first_name",
elementToActOn: "(//table//a)[1]"
};ActionRule actionRule = new ActionRule()
.setActionType("RegisterParameter")
.setArgument("first_name")
.setElementToActOn("(//table//a)[1]");Save //tr[1]/td[2] inner text into [first_name] application parameter.
{
"actionType": "RegisterParameter",
"argument": "{{$ --key:first_name}}",
"elementToActOn": "//tr[1]/td[2]"
}register parameter {{$ --key:first_name}} take {//tr[1]/td[2]}
// option no.1
var actionRule = new ActionRule
{
ActionType = CommonPlugins.RegisterParameter,
Argument = "{{$ --key:first_name}}",
ElementToActOn = "//tr[1]/td[2]"
};
// option no.2
var actionRule = new
{
ActionType = "RegisterParameter",
Argument = "{{$ --key:first_name}}",
ElementToActOn = "//tr[1]/td[2]"
};action_rule = {
"actionType": "RegisterParameter",
"argument": "{{$ --key:first_name}}",
"elementToActOn": "//tr[1]/td[2]"
}var actionRule = {
actionType: "RegisterParameter",
argument: "{{$ --key:first_name}}",
elementToActOn: "(//table//a)[1]"
};ActionRule actionRule = new ActionRule()
.setActionType("RegisterParameter")
.setArgument("{{$ --key:first_name}}")
.setElementToActOn("(//table//a)[1]");Save [John] into [first_name] application parameter.
{
"actionType": "RegisterParameter",
"argument": "{{$ --key:first_name --value:John}}"
}register parameter {{$ --key:first_name --value:John}}
// option no.1
var actionRule = new ActionRule
{
ActionType = CommonPlugins.RegisterParameter,
Argument = "{{$ --key:first_name --value:John}}"
};
// option no.2
var actionRule = new
{
ActionType = "RegisterParameter",
Argument = "{{$ --key:first_name --value:John}}"
};action_rule = {
"actionType": "RegisterParameter",
"argument": "{{$ --key:first_name --value:John}}"
}var actionRule = {
actionType: "RegisterParameter",
argument: "{{$ --key:first_name --value:John}}"
};ActionRule actionRule = new ActionRule()
.setActionType("RegisterParameter")
.setArgument("{{$ --key:first_name --value:John}}")Save the [href] attribute value of //tr[1]/td[6]/a[1] into [link] application parameter.
{
"actionType": "RegisterParameter",
"argument": "link",
"elementToActOn": "//tr[1]/td[6]/a[1]",
"elementAttributeToActOn": "href"
}register parameter {link} take {//tr[1]/td[6]/a[1]} from {href}
// option no.1
var actionRule = new ActionRule
{
ActionType = CommonPlugins.RegisterParameter,
Argument = "link",
ElementToActOn = "//tr[1]/td[6]/a[1]",
ElementAttributeToActOn = "href"
};
// option no.2
var actionRule = new
{
ActionType = "RegisterParameter",
Argument = "link",
ElementToActOn = "//tr[1]/td[6]/a[1]",
ElementAttributeToActOn = "href"
};action_rule = {
"actionType": "RegisterParameter",
"argument": "link",
"elementToActOn": "//tr[1]/td[6]/a[1]",
"elementAttributeToActOn": "href"
}var actionRule = {
actionType: "RegisterParameter",
argument: "link",
elementToActOn: "//tr[1]/td[6]/a[1]",
elementAttributeToActOn: "href"
};ActionRule actionRule = new ActionRule()
.setActionType("RegisterParameter")
.setArgument("link")
.setElementToActOn("//tr[1]/td[6]/a[1]")
.setElementAttributeToActOn("href");Save the first [Abe] match, from element //tr[1]/td[1] inner text, into [regex] application parameter.
{
"actionType": "RegisterParameter",
"argument": "regex",
"elementToActOn": "//tr[1]/td[1]",
"regularExpression": "Abe"
}register parameter {regex} take {//tr[1]/td[2]} filter {Abe}
// option no.1
var actionRule = new ActionRule
{
ActionType = CommonPlugins.RegisterParameter,
Argument = "regex",
ElementToActOn = "//tr[1]/td[2]",
RegularExpression = "Abe"
};
// option no.2
var actionRule = new
{
ActionType = "RegisterParameter",
Argument = "regex",
ElementToActOn = "//tr[1]/td[2]",
RegularExpression = "Abe"
};action_rule = {
"actionType": "RegisterParameter",
"argument": "regex",
"elementToActOn": "//tr[1]/td[2]",
"regularExpression" : "Abe"
}var actionRule = {
actionType: "RegisterParameter",
argument: "regex",
elementToActOn: "//tr[1]/td[2]",
regularExpression: "Abe"
};ActionRule actionRule = new ActionRule()
.setActionType("RegisterParameter")
.setArgument("regex")
.setElementToActOn("//tr[1]/td[2]")
.setRegularExpression("Abe");Save the current date into [date] application parameter with [yyyy-MM-dd] format.
{
"actionType": "RegisterParameter",
"argument": "{{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}"
}register parameter {{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}
// option no.1
var actionRule = new ActionRule
{
ActionType = CommonPlugins.RegisterParameter,
Argument = "{{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}"
};
// option no.2
var actionRule = new
{
ActionType = "RegisterParameter",
Argument = "{{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}"
};action_rule = {
"actionType": "RegisterParameter",
"argument": "{{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}"
}var actionRule = {
actionType: "RegisterParameter",
argument: "{{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}"
};ActionRule actionRule = new ActionRule()
.setActionType("RegisterParameter")
.setArgument("{{$ --key:date --value:{{$date --format:yyyy-MM-dd}}}}");