On Feb 2, 2005, at 8:32 AM, Nick Neuberger wrote:

1) Try using:
selectOption("outage.companyName", "1");

just to see if it will find it by using the value.

Nope - Unable to find option 1 for outage.companyName.


2) Is the javascript "writing" to the output and dynamically adding to the
page after the response is returned?

No.


3) What does the onchange="checkCompany(this)" javascript function do?

The checkCompany() function just disables a submit button if one option is checked.



Can you find a select box in your application that doesn't call onchange.

I tried removing the onchange handler, and I still get the same error.


4) Turn on HttpUnitOptions.setExceptionsThrownOnScriptError(true);

This may give you more insight into what HttpUnit is not liking in your
page.

I don't have js.jar in my classpath, so JavaScript is disabled (or should be at least). Also, I'm running this from Maven and it seems to work, except for this selectOption thing. As far as I can tell, jWebUnit seems to think this particular select has no options.


Matt


Hope This Helps (HTH).

Nick






-----Original Message-----
From: Matt Raible [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 02, 2005 8:40 AM
To: [email protected]
Subject: [Jwebunit-users] Unable to find option using selectOption


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(Http
UnitDialog
.java:863)
     [junit]     at
net.sourceforge.jwebunit.HttpUnitDialog.selectOption(HttpUnitD
ialog.java
: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 e-mail message is intended only for the use of the individual or entity
identified in the alias address of this message and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution of this e-mail message is strictly prohibited. If you have
received this e-mail message in error, please notify the sender immediately
by reply e-mail and delete this message from your system. Thank you.



------------------------------------------------------- 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

Reply via email to