Skip to main content

Bind-Browser

Command Description

Bind an open browser so that the Laiye RPA can operate it. The browser type can be IE, Chrome, Firefox, 360 and Edge. If the command is executed successfully, a handle string of the binding brower will be returned. If it fails, it will return null

Command Prototype

hWeb = WebBrowser.BindBrowser(sType,iTimeOut,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
sTypeTrueenum"ie"Type of browser
iTimeOutTruenumber10000Specify the amount of time (in milliseconds) that wait for the event to run before selectorNotFoundException to trigger an error (in milliseconds) The default value is 10,000 ms (10 seconds)
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

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

Demo

/************************************Binding browser************ **************************** 
Command prototype:
WebBrowser.BindBrowser(sType,iTimeOut,optionArgs)
Input parameters:
sType--Browser type: IE, Chrome, FireFox, Edge, 360Browser
iTimeOut--abnormal waiting time
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Outgoing reference:
hWeb--Browser handle string
*********************************************************************/
//Bind an open browser, so that Laiye RPA can operate on this browser, the bound browser can be IE, Chrome, FireFox, 360, Edge, the command will return to the binding if the command runs successfully The browser handle string, or null on failure
Dim hWeb
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)