Skip to main content

Element-Screenshot

Command Description

Takes a full or partial screenshot of the designated element

Command Prototype

UiElement.ScreenCapture(sFile,objUiElement,sRect,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
sFileTruepath'''C:\Users'''File path stored by screenshots
objUiElementTruedecorator@ui""Interface elements that are selected with the mouse, including windows and elements
sRectTruedictionary{"x": 0, "y": 0, "width": 0, "height": 0}For the range of Element Screenshot, the specified interface, if the range is passed to {"x": 0, "Yight": 0}, the entire area of ​​this element is intercepted, otherwise this element is The upper left corner is coordinate original, according to the high and wide screenshot
bContinueOnErrorNonebooleanNoneSpecify whether the automation should continue to support this field even if the activity is incorrect, it is only supported by the Boolean value (true, false) default value
iDelayAfterNonenumber300Delay time (in milliseconds) after executing the activity is 300 milliseconds
iDelayBeforeNonenumber200The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds

Demo

TracePrint "--------------------Element Screenshot--------------------" 
// --------------------------------------------------------
// [Remarks] Element screenshot, the Demo needs to use IE to open the URL below
// url: http://www.vrbrothers.com/cn/wqm/demo/pages/Demo-ComplexForm.aspx
// Input parameter 1:
// sFile--save path
// Input parameter 2:
// objUiElement--target element
// Input parameter 3:
// sRect--screenshot range
// Input parameter 4:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution).Type:Dict

// Command prototype: UiElement.ScreenCapture(sFile,objUiElement,sRect,optionArgs)
// --------------------------------------------------------

UiElement.ScreenCapture(@res'''1.png''',@ui"table element<td>_username",{"x":0,"y":0,"width":0,"height ":0},{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})