Learn, Share and Keep Learning
| Software Testing - Flash Object Automation using Selenium |
| Testing Tools - Test Execution |
|
If you work in web application testing, you probably know that Selenium is one of the best tool for automating web applications. Though it can be used to test various aspects of web application, sometime you need to find your way around when using Selenium, one such situation is testing flash component using Selenium. Developers use Flash to beautify their websites, but it makes test automation a challenging task because Selenium can not read or record any actions on flash objects. There are two main issues that needs to be addressed while automating web applications involving flash objects -
In this article we will describe how to automate testing of Flash based components of web applications. The basic steps involved in any automation are:
These three steps are very important while understanding the automation of Flash based components for web applications . Most of the time Flash is used in the web applications for -
So how do you know whether the Flash components of your website are using the 'flashvars' information or not? Well its not that difficult to find it out. All you need to do is:
Alternatively you could search directly for 'flashvars' :) As displayed below
This technique is very useful in at least verifying certain values. you could always search for 'flash' in the firebug and see if there is any information in its parameters or other tags that could be exploited for automation. Let us apply this technique on www.youtube.com because we know all the videos on you tube are displayed through Flash. A very interesting case of applying this technique could be testing whether the id of the video played on youtube is the same as the one displayed for embedding or not. Here is the screen grab of a random video on youtube. As you can see we have followed the same steps mentioned in this article and searched for 'flashvars' we found that flashvars contains some words as 'video_id' in the string and then after the '=' sign it contains the value of the id. Yes we got it we could parse this string for value of 'video_id' and compare it with the value specified in the url !!! In the technique presented above, there is nothing which is only applicable for only Flash objects. You can follow the three steps mentioned above for any kind of automation and might come up with similar technique for something else as well based on your context. In the next article we will discuss a Flash specific technique for the Selenium using flash-selenium.jar to automate more advanced interactions with Flash using Selenium. |