VERSION BUILD=10.4.28.1074
TAB T=1
TAB CLOSEALLOTHERS
'
'Explain macro purpose:
URL GOTO=http://demo.imacros.net/Automate/KeywordAssert
WAIT SECONDS=3
'
'Start Test
URL GOTO=http://www.imacros.net/
'
'Check for the keyword "iMacros" on the web page
'
'For more details, please see the Wiki FAQ at
'http://wiki.imacros.net/Web_Testing#Q:_How_can_I_search_for_a_specific_keyword_on_a_web_page.3F
'
'
'Method 1
'
TAG POS=1 TYPE=SPAN ATTR=TXT:*iMacros*
'
'Same as above, but this time ignore the formatting (TYPE=*)
'This command takes longer, as iMacros needs to scan the complete page, not only certain html tags
TAG POS=1 TYPE=* ATTR=TXT:*iMacros*
'
'Alternatively, you can "invert" the keyword search and generate an error
'*IF*word is on found on the page
TAG POS=1 TYPE=* ATTR=TXT:*404* CONTENT=EVENT:FAIL_IF_FOUND
'
'
'Method 2
'
'The result of the EXTRACT command can be retrieved
'with extracted_text = iim1.iimGetLastExtract()
'
TAG POS=1 TYPE=SPAN ATTR=TXT:*iMacros* EXTRACT=TXT
'
'
'If the macro reaches this point, ALL assert tests have been passed!
URL GOTO=http://demo.imacros.net/Automate/KeywordAssertOK