Switch-Tab
Command Description
Switch browser tabs to match with address bar and title bar, and wildcard '*' is supported
Command Prototype
bRet = WebBrowser.SwitchTab(hWeb,sType,sContent,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
hWeb | True | expression | hWeb | Browser handle string using WebBrowser.create or WebBrowser.bind Command Returns |
sType | True | enum | "title" | Match object |
sContent | True | string | "" | Match content |
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
bRet,The variable used to save the output of the command.
Demo
/************************************Switch Tabs************* ****************************
Command prototype:
WebBrowser.SwitchTab(hWeb,sType,sContent,optionArgs)
Input parameters:
hWeb--Browser object
sType--match object: title bar, address bar
sContent--match content
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Outgoing reference:
bRet--The result after the command is run
*********************************************************************************/
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.SwitchTab(hWeb,"url","www.baidu.com",{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint(bRet)