Bugs item #1710809, was opened at 2007-05-01 22:56
Message generated for change (Comment added) made by henryju
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1710809&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: None
>Group: Release 1.4.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Joe Fisher (joebfisher)
>Assigned to: Julien HENRY (henryju)
Summary: Pages with multiple forms but same input id's 

Initial Comment:
When searching for id's in forms, rather then getting the input from the form 
set by setWorkingForm(), assertFormElementPresent searches all forms. It should 
search the selected form.

...
public boolean hasFormParameterNamed(String paramName) {
        if (hasFormSelectNamed(paramName))
            return true;
-->     return hasFormInputNamed(paramName);
    }

calls

...
private HtmlForm getFormWithInput(String inputName) {
        if (hasForm()) {
            for (int i = 0; i < getForms().size(); i++) {
                HtmlForm form = (HtmlForm) getForms().get(i);
                List inputElements = form.getHtmlElementsByAttribute("input",
                        "name", inputName);
                if (inputElements.isEmpty()) {
                    inputElements = form.getTextAreasByName(inputName);
                }
                if (!inputElements.isEmpty()) {
                    setWorkingForm(form);
                    return form;
                }
            }
        }
        return null;
    }


I will try to submit a fix later

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

>Comment By: Julien HENRY (henryju)
Date: 2007-05-05 19:42

Message:
Logged In: YES 
user_id=1235926
Originator: NO

I will be fixed in 1.4.1.

Thanks for your investigation.

Thanks for providing a patch, but I can't apply it. It seems your IDE
change many lines (auto refactor?). Moreover, I think this problem do not
need a new setTextField method, simply a fix of the existing one.

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

Comment By: Joe Fisher (joebfisher)
Date: 2007-05-02 17:31

Message:
Logged In: YES 
user_id=226182
Originator: YES

I don't know if this is the correct behavior, but once a person has
selected a form, it should not change, but getFormWithInput() will just
determine if there IS a form (which may not be the correct form) then set
the working form.
This won't work for me as we have two forms (different id's) but inputs
with same name/value (not id). 
This method finds the first form with the given name(zip) and assigns it.
I added some methods to pick the specific form (without setting the
current form) and attached the patches.
File Added: patch.tgz

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1710809&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