Salut Marc, and thanks for the time you spend (waste) talking with me...
I've tested
your example of nested forms and HtmlUnit handles this exactly like
browsers do: it ignores the nested form and puts its children to the
enclosing one.
You're right for the browsers... As I see with HtmlUnit 1.13 and the
asXml() method on
the current response before clicking the submit button, I've got *two*
forms in the xml, the second
nested in the first. In that case (and i precise *that* case), the
parsing does not lead to an unique
form with the children of the nested one as its own children...
So, with the getEnclosingForm() method which loops from the first
DomParent and then
higher in the hierarchy until it find a form, you can get only the
nested form, ie the lower in form hierarchy...
"Dommage pour moi", but as the nested forms are not a good way to code,
I can't blame HtmlUnit !!!
Do you see an obvious workaround from Webtest code (groovy way, for
instance) ?
Cheers
Florent
Marc Guillemot a écrit :
Salut Florent,
you can surely handle this with a small Groovy script for instance, but
I'm not sure if this is really the cause of the problem. I've tested
your example of nested forms and HtmlUnit handles this exactly like
browsers do: it ignores the nested form and puts its children to the
enclosing one.
Perhaps should you look how the page gets parsed:
<groovy>
println step.context.currentResponse.asXml()
</groovy>
Cheers,
Marc.
--
Pingwy
27, rue des arènes
49100 Angers
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest