Skip to main content

Get-Scrollbar-Position

Command Description

Get the position (in pixel) of the scrollbar in the current page

Command Prototype

dictScrollPostion = WebBrowser.GetScroll(hWeb,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
hWebTrueexpressionhWebBrowser handle string using WebBrowser.create or WebBrowser.bind Command Returns
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

return

dictScrollPostion,The variable used to save the output of the command.

Demo

/************************************Get scrollbar position************ **************************** 
Command prototype:
WebBrowser.GetScroll(hWeb,optionArgs)
Input parameters:
hWeb--Browser object
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Outgoing reference:
dictScrollPostion--The result returned by the command running
*********************************************************************************/
Dim hWeb,bRet
hWeb = WebBrowser.Create("ie","www.baidu.com",30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sBrowserPath":"","sStartArgs":""})
TracePrint(hWeb)
hWeb = WebBrowser.BindBrowser("ie",10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint(hWeb)
bRet = WebBrowser.GetScroll(hWeb,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint(bRet)