My current imacros code calls a URL from a datasource. Should the URL not load (scheduled downtime or wifi is broken) it must display the relevant message to the user. I am unable to get any information on how to display the message to the user when there is downtime or the wifi is down. Below is what I got so far:
VERSION BUILD=844 RECORDER=CR
SET !FILE_PROFILER YES
'Clear the Cache and history'
CLEAR
'Close any open tabs'
TAB CLOSEALLOTHERS
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 13
'Navigate to the EBU Online URL'
SET !DATASOURCE_COLUMNS 1
CMDLINE !DATASOURCE Apps.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO = {{!COL1}}
WAIT SECONDS=15
'There are no credentials for logging onto EBU Online'
Would appreciate any feedback, as I am new to imacros.
Windows 10 Chrome Version 61.0.3163.79 (Official Build) (64-bit)
If you want to display a message when there's no required text on the page, the following macro may help:
SET myText "imacros display message bla-bla-bla"
SET myScript "document.body.textContent.includes('{{myText}}') ? '' : alert('NO \"{{myText}}\" FOUND!');"
URL GOTO=javascript:{{myScript}}undefined;