-
Notifications
You must be signed in to change notification settings - Fork 0
keyboard
roei sabag edited this page Jul 12, 2020
·
1 revision
Simulates keys able to be pressed that are not text keys to the browser.
Full list of supported keys can be found here
- https://github.com/SeleniumHQ/selenium/blob/master/dotnet/src/webdriver/Keys.cs (pass the field name as the action argument).
Web, Mobile Web or any other Web Driver implementation which implements Value.
| Property | Description |
|---|---|
| argument | Plugin conditions and additional information. |
| onElement | The locator value by which the element will be found. |
| locator | The locator type by which the element will be found. |
None
https://www.w3.org/TR/webdriver/#element-send-keys
Can be tested on
Perform keyboard Enter action (press enter) on the specified element.
{
"action": "Keyboard",
"argument": "Enter",
"onElement": "SearchString",
"locator": "Id"
}keyboard {Enter} into {SearchString} using {id}
// option no.1
var actionRule = new ActionRule
{
Action = PluginsList.Keyboard,
Argument: "Enter",
OnElement: "SearchString",
Locator: "Id"
};
// option no.2
var actionRule = new
{
Action = "Keyboard",
Argument: "Enter",
OnElement: "SearchString",
Locator: "Id"
};action_rule = {
"action": "Keyboard",
"argument": "Enter",
"onElement": "SearchString",
"locator": "Id"
}var actionRule = {
action: "Keyboard",
argument: "Enter",
onElement: "SearchString",
locator: "Id"
};ActionRule actionRule = new ActionRule()
.setAction("Keyboard")
.setArgument("Enter")
.setOnElement("SearchString")
.setLocator("Id");Can be tested on
Perform keyboard Control+A action (ctrl+A) on the specified element.
{
"action": "Keyboard",
"argument": "Control,a",
"onElement": "text_area_enabled",
"locator": "Id"
}keyboard {Control,a} into {text_area_enabled} using {id}
// option no.1
var actionRule = new ActionRule
{
Action = PluginsList.Keyboard,
Argument: "Control,a",
OnElement: "text_area_enabled",
Locator: "Id"
};
// option no.2
var actionRule = new
{
Action = "Keyboard",
Argument: "Control,a",
OnElement: "text_area_enabled",
Locator: "Id"
};action_rule = {
"action": "Keyboard",
"argument": "Control,a",
"onElement": "text_area_enabled",
"locator": "Id"
}var actionRule = {
action: "Keyboard",
argument: "Control,a",
onElement: "text_area_enabled",
locator: "Id"
};ActionRule actionRule = new ActionRule()
.setAction("Keyboard")
.setArgument("Control,a")
.setOnElement("text_area_enabled")
.setLocator("Id");