Michael Pyle
unread,Feb 7, 2011, 4:25:01 PM2/7/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to watij
Hi, whenever I attempt to use snapAll() on a page that is very long
(it normally is quite short, but every now and again if there's an
error with the page it will display a massive stack trace, making the
page quite long), I receive an OutOfMemoryError which I assume occurs
when JxBrowser attempts to take the screen shot, and then the JVM will
crash with this exception during ImageIO.write:
Exception in thread "Main message loop" java.lang.OutOfMemoryError:
Java heap space
java.lang.IllegalArgumentException: im == null!
at javax.imageio.ImageIO.write(Unknown Source)
at javax.imageio.ImageIO.write(Unknown Source)
at org.watij.webspec.dsl.WebSpec.snap(WebSpec.java:468)
at org.watij.webspec.dsl.WebSpec.snapAll(WebSpec.java:462)
at
au.gov.centrelink.qa.jnat.web.NWebEntity.takeScreenShot(NWebEntity.java:
225)
at
au.gov.centrelink.qa.jnat.web.NWebExecutionContext.takeScreenShot(NWebExecutionContext.java:
88)
at
au.gov.centrelink.qa.jnat.NUtils.createScreenShot(NUtils.java:350)
at au.gov.centrelink.qa.jnat.NUtils.sendResult(NUtils.java:
390)
at
au.gov.centrelink.qa.jnat.functional.NResultAction.execute(NResultAction.java:
30)
at
au.gov.centrelink.qa.jnat.execution.NExecutor.execute(NExecutor.java:
380)
at
au.gov.centrelink.qa.jnat.execution.NExecutionThread.run(NExecutionThread.java:
21)
at java.lang.Thread.run(Unknown Source)
Would it be possible to add a 'null' check during that part of the
code that calls ImageIO - to not call ImageIO if the image returned
from JxBrowser is null?
And even better would also be some kind of getContentSize() method for
the browser so I can call snap() instead of snapAll() if the displayed
content is too large.
Thanks for your time.