The focus thing is a real problem for Firefox (in particular) and
becomes even harder when tests are run in parallel for obvious
reasons.
We have avoided stealing focus for a window because people tend to run
a suite of webdriver tests and then get on with something else whilst
they're running. The best bet would be to call "window.focus" using
the JavascriptExecutor service immediately before calling the flex
app. If this doesn't work, you might consider using a tool to handle
the window focusing in addition to webdriver: Windows exposes a few
methods that might be useful and which could be accessed by JNA[1] for
example.
Is this something that other people have been struggling with too?
Regards,
Simon
The message from Simon suggesting that tests invoke javascript window.focus() was cited in a SQA stackoverflow answer. I didn't bother to reply to this when I first saw it because it was so old. Over the past couple of months, I've come to the conclusion that tests must be able to bring their browser to the front (at least in the case of Firefox) because not only is Flash media disabled if the window is occluded, but the javascript onchange events don't fire if sendkeys is working on a window that is on in focus. We've tried a few things to get the javascript window.focus() call to do what we want, to no avail. There are a number of threads referring to this problem that make it look like Selenium 1 handles the situation fairly directly. It does seem as if Selenium 2.x will gain the capability someday. Life on this end would be easier if the capability were added in 2.0.
--
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.