Launch-a-New-Browser
Command Description
Start a new browser so that RPA Creator can operate on it. The browser can be Internet Explorer, Chrome, FireFox, 360, Edge, or Laiye RPA (can only open one browser window). The bound browser handle string is returned when the command run successfully. Null is returned when failed
Command Prototype
hWeb = WebBrowser.Create(sType,sURL,iTimeOut,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sType | True | enum | "ie" | Type of browser |
sURL | True | string | "about:blank" | The URL when the browser is launched |
iTimeOut | True | number | 30000 | Specify 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 30,000 ms (30 seconds) |
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 |
sBrowserPath | None | path | "" | Browser path, default is an empty string. When the value is an empty string, it automatically looks for the browser installed on the machine and tries to start it |
sStartArgs | None | string | "" | Browser's launch parameters |
return
hWeb,The variable used to save the output of the command.
Demo
/************************************Start a new browser*********** ****************************
Command prototype:
WebBrowser.Create(sType,sURL,iTimeOut,optionArgs)
Input parameters:
sType--Browser type: IE, Chrome, FireFox, Edge, 360Browser, Laiye RPA browser
sURL--Open the link to jump to the browser
iTimeOut--abnormal waiting time
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
sBrowserPath--Browser installation path
sStartArgs--Browser startup parameters
Outgoing reference:
hWeb--Browser handle string
*********************************************************************/
//Start a new browser, so that Laiye RPA can operate on this browser, the browser to start can be Internet Explorer, Chrome, FireFox, 360, Edge, Laiye RPA browser (Laiye The RPA browser only supports launching a browser window), the command will return the bound browser handle string if the command runs successfully, and null if it fails.
Dim hWeb
hWeb = WebBrowser.Create("ie","www.baidu.com",30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sBrowserPath":"","sStartArgs":""})
TracePrint(hWeb)