I have some videos and i want to test their with automation Can you tell How does selenium work with video? How does he recognize it. I need to test if are videos on the page. Thanks!
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
There are a few ways to do handle this...
For Flash Videos:
Most flash videos show up in iFrames, so you'll want switch to the iFrame container (using selectFrame) and then do an element test to verify the video content shows up correctly (using waitForElementPresent or verifyElementPresent).
As others have mentioned, if you're going to need to interact with the videos, you'll need FlashSelenium or flex-ui-selenium, but you can get much of the job done without them.
For HTML5 Videos:
For verifying they show up, an element test will work as mentioned above.
Also, since HTML5 videos often have CSS elements as controls, you can verify their functionality and playback by interacting with those elements. Here's an example script (note: page may change layout in the future):
That's how we set up our monitoring scripts in our Rigor accounts. Hope this helps!
If you need to validate that the video is there then it is a simple element check. BUT if you need to validate if the video is LOADED than that's a completly other thing.
Is the video a flash object? Then use http://www.adobe.com/devnet/flash/articles/flash_selenium.html flash selenium.
If it is a flex object use http://code.google.com/p/flex-ui-selenium/ flex selenium.
Hope that I could help.