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

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

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

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

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

4) Turn on HttpUnitOptions.setExceptionsThrownOnScriptError(true);

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

Hope This Helps (HTH).

Nick






> -----Original Message-----
> From: Matt Raible [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 02, 2005 8:40 AM
> To: jwebunit-users@lists.sourceforge.net
> 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
> Jwebunit-users@lists.sourceforge.net
> 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
Jwebunit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to