Hi Chaitanya,
The page you are testing should use a refresh meta tag. The default behavior of
HtmlUnit is to refresh the page immediatly (ImmediateRefreshHandler), and this
could result in a OutOfMemoryException.
A possible solution is to change the handler to ThreadedRefreshHandler.
I will try and look if it don't break any test case.
I don't know if I can reproduce the situation. Do you agree to test the new
package before I release it to see if it solve your problem?
++
Julien
----- Message d'origine ----
De : Chaitanya Reddy Aregakuti <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Lundi, 4 Décembre 2006, 6h29mn 11s
Objet : [Jwebunit-users] WaitingRefreshHandler
Dear all,
I am a novice in writing JWebUnit testcases. When I
tried to run a testcase, it has resulted in the following
exception.
Could any one of you help me in giving the reason
for the following exception and to solve it??
java.lang.RuntimeException: Refresh Aborted by
HtmlUnit: Attempted to refresh a page using an ImmediateRefreshHandler which
could have caused an OutOfMemoryError Please use WaitingRefreshHandler or
ThreadedRefreshHandler instead.
at
com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:77)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1060)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:146)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:440)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:335)
at
com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(BaseFrame.java:129)
at
com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.java:114)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1419)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:143)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:440)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:335)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:362)
at
com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:217)
at
com.gargoylesoftware.htmlunit.html.HtmlImageInput.doClickAction(HtmlImageInput.java:133)
at
com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:114)
at
com.gargoylesoftware.htmlunit.html.HtmlImageInput.click(HtmlImageInput.java:156)
at
com.gargoylesoftware.htmlunit.html.HtmlImageInput.click(HtmlImageInput.java:117)
at
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.submit(HtmlUnitDialog.java:1251)
at
net.sourceforge.jwebunit.junit.WebTester.submit(WebTester.java:1789)
at
net.sourceforge.jwebunit.junit.WebTestCase.submit(WebTestCase.java:1372)
at
TransactionWebUnit.loginAs(TransactionWebUnit.java:63)
at
TransactionWebUnit.testValidLogin(TransactionWebUnit.java:54)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:47)
at
com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
What should I do if I don't want to refresh
anything?
Thanks and Regards
Chaitanya
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses
http://fr.answers.yahoo.com-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users