问题
I have encountered a problem I believe to be related to what's stated in the topic.
With selenium I'm currently automating tests for a website having flash elements for user inputs. While everything works fine when executing these tests on my computer locally, it fails to load the embeded flash if I start selenium on a remote Windows XP machine.
However, the flash just loads fine if I start the tests while I'm logged in via remote desktop.
This leads me to the assumption that whithout any desktop environment loaded or user logged in the firefox window is treated just as though it was minimized or the current tab was inactive, which I know prevents flash from loading until that window/tab is activated.
So, my question now is: Do you guys have any idea if there is a way to enable firefox to load flash even if it's not currently displayed in an active window?
回答1:
Finally, I've found a solution: The Flash object's param "wmode" must be set to "window". It then works flawlessly.
<object ...>
<param name="wmode" value="window">
</object>
I simply added a function to my selenium user-extensions that modify that tag's attribute and is run every time, the flash is accessed.
Daniel
来源:https://stackoverflow.com/questions/5704968/firefox-flash-not-loading-if-tab-inactive-window-minimized