Bugs item #1708229, was opened at 2007-04-26 09:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1708229&group_id=61302

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: HtmlUnit plugin
Group: Release 1.4
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jon (jonr23)
Assigned to: Nobody/Anonymous (nobody)
Summary: clickRadioOption() clobbers working form

Initial Comment:
Release 1.4.  I have two forms on a page, the first with hidden field named 
"foo" and the second with a radio option also named "foo".

I set my working form to be the second one, then call clickRadioOption("foo, 
"value").  JWebUnit internally asserts that the field exists (successfully), 
but that process changes my working form because it found the hidden field on 
the first form!  The click then fails.

It looks like HtmlUnitDialog.getFormWithInput is being called during the 
assert.  It searches for the first form with the named input, and sets working 
form to that regardless of whether it's already set.

Looking in HtmlUnitDialog.getFormWithSelect(), I see some code at the top to 
work around this problem.  I copied it to getFormWithInput and it seems to fix 
the problem:

   private HtmlForm getFormWithInput(String inputName) {
        if (form != null) {
            try {
                if (form.getInputByName(inputName) != null) {
                    return form;
                }
            } catch (ElementNotFoundException e) {
                // Nothing
            }
        } else {
            if (hasForm()) ... // the rest of the method


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1708229&group_id=61302

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to