-
Notifications
You must be signed in to change notification settings - Fork 0
get_screenshot
roei sabag edited this page Jul 12, 2020
·
1 revision
Gets an OpenQA.Selenium.Screenshot object representing the image of the page on and saves the screenshot to a file, overwriting the file if it already exists.
Web, Mobile Web, Mobile Native or any other Web Driver implementation which implements Screenshot.
| Property | Description |
|---|---|
| argument | The full path and file name to save the screenshot to. Support formats ['BMP','GIF','JPEG','TIFF','PNG']. |
| 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/#actions
Can be tested on
Saves a web driver screenshot as page.png (you can use different format, see below) to the given path (whole page - not including address bar).
{
"action": "GetScreenshot",
"argument": "GetScreenshot/image.png"
}get screenshot {GetScreenshot/image.png}
// option no.1
var actionRule = new ActionRule
{
Action = PluginsList.GetScreenshot,
Argument = "GetScreenshot/image.png"
};
// option no.2
var actionRule = new
{
Action = "GetScreenshot",
Argument = "GetScreenshot/image.png"
};action_rule = {
"action": "GetScreenshot",
"argument": "GetScreenshot/image.png"
}var actionRule = {
action: "GetScreenshot",
argument: "GetScreenshot/image.png"
};ActionRule actionRule = new ActionRule()
.setAction("GetScreenshot")
.setArgument("GetScreenshot/image.png");Can be tested on
Saves a web element screenshot as element.png to the given path (you can use different format, see below).
{
"action": "GetScreenshot",
"argument": "GetScreenshot/image.png",
"onElement": "//div[@class='jumbotron']"
}get screenshot {GetScreenshot/image.png} on {//div[@class='jumbotron']}
// option no.1
var actionRule = new ActionRule
{
Action = PluginsList.GetScreenshot,
Argument = "GetScreenshot/image.png",
OnElement = "//div[@class='jumbotron']"
};
// option no.2
var actionRule = new
{
Action = "GetScreenshot",
Argument = "GetScreenshot/image.png",
OnElement = "//div[@class='jumbotron']"
};action_rule = {
"action": "GetScreenshot",
"argument": "GetScreenshot/image.png",
"onElement": "//div[@class='jumbotron']"
}var actionRule = {
"action": "GetScreenshot",
"argument": "GetScreenshot/image.png",
"onElement": "//div[@class='jumbotron']"
};ActionRule actionRule = new ActionRule()
.setAction("GetScreenshot")
.setArgument("GetScreenshot/image.png")
.setOnElement("//div[@class='jumbotron']");