<< Click to Display Table of Contents >> Navigation: 3. Script Language > Browser and Office (Acc.-Engine) > Browser and Office Commands |
MiniRobotLanguage (MRL)
WBR. Command
Wait for Browser Event/ Site loaded
Intention
Using WBR. you can wait until a Site had been completely loaded in the Mini-Browser (=MB). WBR. can also be used to wait for Browser Events.
For more details on the Mini-Browser (MB) see there.
WBR. is a multi-purpose command that includes multiple possible subcommands.
WBR. supports a set of typical "Wait" Subcommands that do not have further parameters,
as well of a second set that is used to check Error states.
Usage is simple. To just wait until a WEB-Site is loaded, write:
WBR.
Below you will see more examples on how to check for Errors and loading Progress.
Syntax
WBR.[P1][|[!]P2]
Parameter Explanation
[!] - If you prefix the time-value P2 with a "!" then the Logic is negated and the given
condition is true, if its false.
P1 - Subcommand, the following Subcommands are currently supported:
• WBR.
WBR. without any options is the same as WBR.all
• "All" - wait until MB is ready with all Jobs
WBR.all
WBR.all
WBR.all[|[!]max time]
• "Page" - Wait until the actual Page has been loaded
WBR.Page[|[!]max time]
WBR.Page
• "Job" - Wait until the actual Job is done
WBR.Job[|[!]max time]
WBR.Job
The following Subcommands support Comparisons !,=,>,<
If you prefix these Subcommands with a "q" they will "confirm" any Error like if you had been using the command:
CBR.errclear
If you omit the "q" you will need to manually call
CBR.errclear
to clear internal Error Variables, and make them ready for the next Event.
• "Progress","Pro." - Compare actual loading Progress (0-100%)
WBR.Progress=progress value[|[!]max time]
WBR.Progress>0|120
WBR.Progress<19|60
WBR.Progress<19|!60
• "Error","Err." - Compare actual loading Error State
WBR.Err.=0[|[!]max time]
WBR.Error>0|120
WBR.Error=0|!120
WBR.Error!200|66
• "State","Sta." - Compare actual loading Error State as textual pattern
For this textual compare the sign is been ignored.
WBR.Sta.=HTTP&AND:Error|55
WBR.State=HTTPS&OR:Error|!251
WBR.qState=HTTPS&OR:Error|!251
• "Description","Des." - Compare loading State as textual pattern
For this textual compare the sign is been ignored.
WBR.Des.=HTTP&AND:Error|55
WBR.description=HTTPS&OR:Error|!251
WBR.qDescription=HTTPS&OR:Error|!203
Depending on the chosen Subcommand the further Parameters P3 to P4 differ and may be
needed or not.
If you prefix the Subcommand or the max-time value with a "!" this will negate the logic of the command. If you prefix both, the logic will be unchanged.
P2 - [optional] Time-Value If given, this is the maximum time to wait for the
condition to be true. If missing, the command will wait "endless".
If the condition does not become true, then the command will set the
timeout-flag and just continue with the script. You can check the timeout-flag to
immediately after this command, to see if an timeout has occurred.
cond - WBR. supports the following conditions:
! - NOT
= - Is Equal to
> - Larger then
< - Smaller then
Hint: Combined Operators like ">=" are not supported. In this case, just use ! and "<"
and switch the operators. Because A>=B is the same as NOT B<A.
Example
' This example uses WBR. to wait until a Site is been loaded.
'
LBR.Size=1024,980|Pos=0,0|svf=0|site=www.fa2.de
WBR.
CBR.gw.
FOR.$$NUM|1|40
AGR.40|||$$NUM
GAI.v|$$LNK
DBP.Der hinterlegte Link:$crlf$$$LNK
MMV.
NEX.
MBX.Browser exit
CBR.exit
ENR.
' Example on how to track Site-loading Errors
'
LBR.Size=1024,980|Pos=0,0|svf=0|site=www.fa33.de
WBR.
DBP. Descr.: $mb_ert$
DBP. Err-Code: #mb_err#
DBP. Err.-Name: $mb_err$
MBX.Browser exit
CBR.exit
ENR.
Output:
[10:15:00] [12] Descr.: The server or proxy was not found.
[10:15:00] [13] Err-Code: 2148270085
[10:15:00] [14] Err.-Name: INET_E_RESOURCE_NOT_FOUND
' Example, if we wait for an specific Error to happen
'
LBR.Size=1024,980|Pos=0,0|svf=0|site=www.fa33.de
' This will wait forever until the site is "Not found".
'
WBR.qDes.=was not found
' Because WBR.Des. will confirm the Error,
' you will get a state 0 (no error) here:
DBP. Descr.: $mb_ert$
'DBP. Err-Code: #mb_err#
'DBP. Err.-Name: $mb_err$
'MBX.Browser exit
CBR.exit
ENR.
' Example, if we wait for an specific Error to happen
' In this case the Error-Number is 2148270085
'
LBR.Size=1024,980|Pos=0,0|svf=0|site=www.fa33.de
WBR.Err.=2148270085
DBP. Err-Code: #mb_err#
CBR.exit
ENR.
Remarks
There are multiple examples on using the Mini-Browser within the supplied Sample Scripts. A list with possible Errors can be found here:
Internet Explorer Errors and here: HTTP-Status Codes
Limitations:
-
See also:
• ! Smart Package Robot 's Browser and Office Commands
• LBR. - Launch (Mini-)Browser