Hi all,
I have started working to implement Alert for HtmlUnitDriver, with first step proposed in PR#774.
There are one main point I would like to discuss before moving forward:
- I understood that WebDriver expects the Browser to be run in a different thread, because for example:
- Browser in Page 1
- click() which goes to Page 2
- Alert is retrieved, then .accept()
- Browser would be in Page 2
Currently with HtmlUnit, clicking triggers the alert and browser is already at page 2, after returning from .click().
What I propose here:
a- Change HtmlUnit to stop processing until the Alert is accept(), this is currently happening for 'prompt', but not for 'alert'
b- Change HtmlUnitDriver so it runs on a different thread, which waits till the test/user thread accept() the Alert before continuing execution.
In other words, .click() to be asynchronous call.
As a side note, I guess it would be helpful if Alert is javadoc documented.
What do you think?
Thanks,
Ahmed