Simon
> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>
If you *really* need to values to be returned on-submit, the only way
I can really think of doing this is:
1) Go to site
2) Click on link to make form appear
3) Execute script which registers an onsubmit handler on the form,
along the lines of driver.executeScript("arguments[0].onsubmit =
function() { ... }", formElement)
4) Fill in form
5) Press submit
6) Onclick you injected stalls the page load
7) Execute script which polls the stalled page for the data, and then
executes some callback which continues the submit action
Where the function in 3) looks something like
* Initialise global variable somewhere to contents you want
* return false, so submit isn't processed
And the injected script in 7: looks something like:
* Check if global variable has value; if so, get it, if not, return
false and retry
* Remove the onclick handler that was injected in 3)
* Call submit() on the form
* Return the value you retrieved.
There are a number of problems with this approach. It hugely changes
the behaviour of the web app under test, it relies on timing quite
awkwardly, and it relies on the fact that you can stall submits and
resume them without worry (which isn't necessarily the case).
If you can give us a more concrete idea of what you're trying to do,
we can probably help better.