WaitForWebTag |
Top Previous Next |
×V3.1Ø ((EMUE + Web)) Syntax - WaitForWebTag <timeout> <String Value 1> ...<String Value x> Where: <timeout> is an integer or a variable that contains an integer. <StringValueX> is a literal string or a variable that contains a literal string.
Description: This command can be used to instruct EMUE to continue to look for a particular element on a web page until the specified timeout is reached. The web macro code that EMUE should run is supplied in <String Value 1> ... <String Value x>. All string values supplied are concatenated together and run in the web browser. The macro code runs just like it would with the RunWebMacroCode command.
This command is particularly useful for websites where AJAX is used. AJAX allows certain parts of a page to change without updating the entire page. Because the entire page does not change, iMacros does not detect the change and will not wait for the portion of the page to finish loading. When this happens, iMacros may look for the element before it is available. By using the WaitForWebTag command, EMUE will keep looking for the element for a specified amount of time. That way, that portion of the page has time to load. As soon as the element is found, EMUE will continue processing. When this command is used, the next step should always be to check the return code so that the script can detect whether or not the element was found and proceed accordingly.
This command can be used with any of the web macro commands (URL GoTo, TAG, EXTRACT, TAB, etc), but it is most useful with the TAG and EXTRACT commands.
Note: This command is a part of the Web Macro Commands, introduced in EMUE V3 and should not be mixed with Web Scripting Commands from EMUE V4.
Sample: WaitForWebTag 30 "TAG POS=1 TYPE=A ATTR=TXT:Claims<SP>Status" If &Web_LastCompletionCode ne 1 Then LogLine "Claim Status results could not be found for " PtID GoTo NextPatient EndIf
|