Hi Mr.HENRY,
I cannot change any of the jsps or html on which I am writing testcases. I
used JWebUnit 1.2, but I didnot see any exceptions. I agree to test the new
package on my code. Please tell me when u could provide your new package.
I appreciate your immediate response.
Here is my testcase.
public class TransactionWebUnit
extends WebTestCase
{
private static final String VALID_UID = "root";
private static final String VALID_PWD = "password";
public TransactionWebUnit(String name)
{
super(name);
}
public void setUp() throws Exception
{
getTestContext().setBaseUrl("http://localhost:8181/admin");
}
public void tearDown() throws Exception
{
}
public void testInitialState()
{
beginAt("/");
assertFormElementPresent("j_username");
assertFormElementPresent("j_password");
assertSubmitButtonNotPresent("submit");
}
public void testValidLogin()
{
loginAs(VALID_UID, VALID_PWD);
assertTitleEquals("Management Console");
}
private void loginAs(String user, String pass)
{
beginAt("/");
setFormElement("j_username", user);
setFormElement("j_password", pass);
submit();
}
public void testTransactionTimeOut()
{
loginAs(VALID_UID, VALID_PWD);
gotoPage("server/transaction/edit.jsp");
setFormElement("TimeOut", "610");
submit();
gotoPage("com/pramati/admin/webview/ShowStatusServlet");
}
public static void main(String[] args)
{
TestSuite testSuite=new TestSuite();
testSuite.addTest(new TransactionWebUnit("TransactionWebUnit"));
junit.textui.TestRunner.run(testSuite);
}
}
Thanks and Regards
Chaitanya
----- Original Message -----
From: Julien HENRY
To: Usage problems for jWebUnit
Sent: Monday, December 04, 2006 1:48 PM
Subject: [Jwebunit-users] Re : WaitingRefreshHandler
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.
------------------------------------------------------------------------------
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
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