Hi Paul & Christian,
Paul explainations are ok for me.
I think that onblur could and should be handled transparently.
Concerning keys events, I see the necessity of an additional steps only
to generate events outside form fields. For form fields I think that it
would be nicer to have an additional optional attribute to determine how
a field is set. For instance with <setInputField text="foo".../>, the
text can be:
1- typed on the keyboard
2- paste with keyboard shortcut
3- paste with mouse menu
4- other way?
I could imagine a "mode" attribute (other propositions are welcome)
which would say how the value is set. In the case of typed text this
should ideally generates the whole key down, key up, key pressed events
sequence.
Marc.
Paul King wrote:
I am sure Marc will step in if I get this slightly wrong
but my understanding is that:
onkeyup has 'hooks' in place within htmlunit but no implementation
(and nothing within webtest)
onblur has 'hooks' and an implementation within htmlunit but nothing
at all in webtest
A question I have with many of these events and how they would look
within WebTest is what granularity do people want to support.
The easiest hook would be to cause setInputField to trigger some events
but that doesn't match exactly what a browser would do. In a browser
you would get events for each keystroke as you typed it. Whereas
in the simplest form we would be just having one lot of events
for all the keystrokes.
We could of course add a <sendKeyStroke> or <addKeyStrokeToField>
step but we would need to make it clear that these weren't used
for testing normal form functionality but just browser js functionality.
Cheers, Paul.
bat wrote:
hi marc,
i'm afraid i don't have the skills to fix the problem ;-)
but i've taken a cursory glance at the
http://htmlunit.sourceforge.net/javascript-howto.html htmlunit site
and i
was quite surprised to read this:
"Some event handlers are already implemented and will be triggered at the
appropriate time (see table below).
...
onblur: The method WebClient.moveFocusToElement(...) will change the
focus
to the appropriate element. This event will be triggered when an element
loses focus."
it must be a misunderstanding on my part, but that statement leaves me
rather confused.
greetings
christian
So you may find a workaround this way but the safer way would surely
be to submit a patch allowing htmlunit/webtest to handle these events
natively ;-)
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest