You can use
dumpHtml(java.io.PrintStream stream)
private void dumpToFile(String id){try {
String responseFile = reportPath + File.separator + id+".htm";
File logFile = new File(responseFile);
PrintStream outStream = new PrintStream(new FileOutputStream(logFile));
tester.dumpHtml(outStream);
outStream.flush();
outStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
++
Julien
De : Ravi <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Jeudi, 12 Octobre 2006, 8h21mn 48s
Objet : Re: [Jwebunit-users] Jwebunit-users Digest, Vol 5, Issue 5
try {
String responseFile = reportPath + File.separator + id+".htm";
File logFile = new File(responseFile);
String responseText = tester.getDialog ().getResponseText();
responseText = formatResponseText(responseText);
PrintStream outStream = new PrintStream(new FileOutputStream(logFile));
outStream.println(responseText);
outStream.flush();
outStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
Send Jwebunit-users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Jwebunit-users digest..."
Today's Topics:
1. Re : com.meterware.httpunit.IllegalParameterValueException
(Julien HENRY)
---------- Forwarded message ----------
From: Julien HENRY <[EMAIL PROTECTED] >
To: Usage problems for jWebUnit <[email protected]>
Date: Fri, 6 Oct 2006 07:07:29 +0000 (GMT)
Subject: [Jwebunit-users] Re : com.meterware.httpunit.IllegalParameterValueException
Hi,
When you say the drop down is dynamically populated, I suppose there is an event on country input that load state drop down ?
<select name="country" >....</select>
The problem is HttpUnit has a very limited support of _javascript_. Consider migrating to JWebUnit 1.3, which use HtmlUnit behind the scene.
++
Julien
----- Message d'origine ----
De : Ravi < [EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Jeudi, 5 Octobre 2006, 15h00mn 10s
Objet : [Jwebunit-users] com.meterware.httpunit.IllegalParameterValueException
Hi,I'm writing jwebunit test case for a page where a drop down is dynamically populated(Eg: The state drop down is populated only after the country is selected). When I run the test it is giving the following error.com.meterware.httpunit.IllegalParameterValueException: May not set parameter 'selectCat' to 'sdjbcsdk'. Value must be one of: { }
at com.meterware.httpunit.SelectionFormControl$Options.reportNoMatches(FormControl.java :1189)
at com.meterware.httpunit.SelectionFormControl$SingleSelectOptions.claimUniqueValues(FormControl.java:1375)
at com.meterware.httpunit.SelectionFormControl$Options.claimUniqueValues(FormControl.java:1181)
at com.meterware.httpunit.SelectionFormControl.claimUniqueValue(FormControl.java:1062)
at com.meterware.httpunit.FormParameter.setValues(FormParameter.java:90)
at com.meterware.httpunit.WebForm.setParameter(WebForm.java :614)
at com.meterware.httpunit.WebForm.setParameter(WebForm.java:603)
at net.sourceforge.jwebunit.HttpUnitDialog.setFormParameter(HttpUnitDialog.java:299)
at net.sourceforge.jwebunit.WebTester.setFormElement ( WebTester.java:789)
at net.sourceforge.jwebunit.WebTestCase.setFormElement(WebTestCase.java:317)
at test.jwebunitext.base.TestBase.setFormValues(TestBase.java:293)
at test.jwebunitext.base.TestBase.processForm (TestBase.java:437)
at test.TestJava.testSignupFlow1(TestJava.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java :39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare (TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run (TestResult.java:109)
at junit.framework.TestCase.run (TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java :478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)Any pointers?
--
Regards,
Ravi-------------------------------------------------------------------------
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 un nouveau moyen de poser toutes vos questions quel que soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. Cliquez ici.
-------------------------------------------------------------------------
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
--
Regards,
Ravi
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
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 ! Demandez à ceux qui savent sur Yahoo! Questions/Réponses.
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Jwebunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jwebunit-users
