Set-Scrollbar-Position
Command Description
Set the position (pixels) of the scrollbar on the page
Command Prototype
WebBrowser.SetScroll(hWeb,dictScrollPostion,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
hWeb | True | expression | hWeb | Browser handle string using WebBrowser.create or WebBrowser.bind Command Returns |
dictScrollPostion | True | expression | {"ScrollLeft": 0,"ScrollTop": 0} | The new position where scrollbars are moved to. The element ScrollLeft indicates the position of the horizontal scrollbar, and the element ScrollTop indicates the position of the vertical scrollbar |
bContinueOnError | None | boolean | None | Specify 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 |
iDelayAfter | None | number | 300 | Delay time (in milliseconds) after executing the activity is 300 milliseconds |
iDelayBefore | None | number | 200 | The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds |
Demo
/************************************Set scrollbar position************ ****************************
Command prototype:
SetScroll(hWeb,dictScrollPostion,optionArgs)
Input parameters:
hWeb--Browser object
dictScrollPostion--the new position to which the scroll bar moves
bContinueOnError--error or whether to continue
iDelayAfter-- delay after execution
iDelayBefore--Delay before execution
*********************************************************************************/
Dim hWeb
hWeb = WebBrowser.Create("ie","www.baidu.com",30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sBrowserPath":"","sStartArgs":""})
TracePrint(hWeb)
Mouse.Action(@ui"块级元素<div>_","left","click",10000,{"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [],"sSimulate": "simulate", "bMoveSmoothly": false})
WebBrowser.SetScroll(hWeb,{"ScrollLeft": 0,"ScrollTop": 600},{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})