Page 1 of 1

Capturing Script errors with iMacros

Posted: Mon Jul 21, 2008 2:25 pm
by bearaman
Hi There,
I'm wondering if there's a way for iMacros to detect a script error on a web page and take a screenshot of the problem? For example, if I'm running some web testing and the page loaded generates a script error, I'd like that the error is recorded and maybe a screenshot taken for further investigation.
Can iMacros do this?
Thanks,
B.

Re: Capturing Script errors with iMacros

Posted: Tue Jul 22, 2008 8:53 pm
by Tech Support
Yes, you can run a regression test and ensure no errors came out of Javascript. Please see this FAQ for details:
http://wiki.imacros.net/Web_Testing#Q:_ ... _thrown.3F

To create a screenshot, you can call the macro from within a script and call a second macro (consisting of only one line!) to take the screenshot.

Example:

Code: Select all

i = iim1.iimPlay ("test macro")
if i < 0 then iimPlay ("CODE:SAVEAS TYPE=BMP FOLDER=* FILE=Time_{{!NOW:yyyymmdd_hhnnss}}.bmp")

Re: Capturing Script errors with iMacros

Posted: Wed Jul 23, 2008 4:10 pm
by bearaman
Great, exactly what I needed. Thanks!