--- Begin Message ---
Is the <select> element part of a form? And if so, did you select that form?

It's been a while, but iirc you need to select the form before you can assert the form elements.

Martijn

Matt Raible wrote:

Here's a bit more information:

assertOptionsEqual("outage.companyName",
                new String[] {"", "1", "2", "3" });

Results in:

[junit] Arrays not same length expected:<4> but was:<0>
[junit] junit.framework.AssertionFailedError: Arrays not same length expected:<4> but was:<0>
[junit] at net.sourceforge.jwebunit.WebTester.assertArraysEqual(WebTester.java: 508)
[junit] at net.sourceforge.jwebunit.WebTester.assertOptionsEqual(WebTester.java: 476)
[junit] at net.sourceforge.jwebunit.WebTestCase.assertOptionsEqual(WebTestCase.java :196)


If I'm reading this right, it's saying that there are no options in the HTML that jWebUnit reads? I tried using dumpResponse(System.out) and it all looks correct.

Thanks,

Matt

On Feb 2, 2005, at 7:39 AM, Matt Raible wrote:

I have the following code in my jWebUnit test:

selectOption("outage.companyName", "NSPP");

And I have the following HTML that's rendered (if I do a view-source in Firefox):

<select name="outage.companyName" onchange="checkCompany(this)" id="outage.companyName">
<option value=""></option>
<option value="2">NSPP</option>
<option value="1">PSCo</option>
<option value="3">SPS</option>
</select>


Any idea why I'm getting the following error:

[junit] Unable to find option NSPP for outage.companyName
[junit] java.lang.RuntimeException: Unable to find option NSPP for outage.companyName
[junit] at net.sourceforge.jwebunit.HttpUnitDialog.getValueForOption(HttpUnitDialo g.java:863)
[junit] at net.sourceforge.jwebunit.HttpUnitDialog.selectOption(HttpUnitDialog.jav a:875)
[junit] at net.sourceforge.jwebunit.WebTester.selectOption(WebTester.java:847)
[junit] at net.sourceforge.jwebunit.WebTestCase.selectOption(WebTestCase.java: 341)


Thanks,

Matt



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users




--- End Message ---


Reply via email to