Open-Webpage
Command Description
Control the browser to load the specified link (URL)
Command Prototype
iRet = WebBrowser.GoURL(hWeb,sURL,bWait,arrElement,iTimeOut,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
hWeb | True | expression | hWeb | Browser handle string using WebBrowser.create or WebBrowser.bind Command Returns |
sURL | True | string | "" | The webpage link address (URL) to be loaded |
bWait | True | boolean | True | Whether waiting for the page to load, the command returns, passes to true, etc., you must wait for page Load SuccessFully or Load Faile, will continue, and return to false and return to the page |
arrElement | True | decorator | {} | Judge the existence of specified element after page loading. If left blank, no element will be evaluated |
iTimeOut | True | number | 30000 | Timeout of waiting for the page to finish loading. If this time is exceeded, it will be determined as loading failure. By default the timeout is 30000 milliseconds (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 |
return
iRet,The variable used to save the output of the command.
Demo
/*********************************open the Web page************** ************************
Command prototype:
WebBrowser.GoURL(hWeb,sURL,bWait,arrElement,iTimeOut,optionArgs)
Input parameters:
hWeb--Browser object
sURL--the link address of the web page to be loaded
bWait--Whether to wait for the command to return after the page is loaded
arrElement--Determine whether the specified element exists
iTimeOut--timeout for waiting for page load
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Outgoing reference:
iRet--command return result
*********************************************************************************/
Dim hWeb,iRet
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)
iRet = WebBrowser.GoURL(hWeb,"weibo.com",true,{},30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint(iRet)