Sponsored Ad

Monday, November 2, 2009

Software Testing - Automation object using Flash Selenium

Test Tools - Test run-

If you work in web application testing, you probably know that selenium is one of the best tools for the automation of web applications. Although it can be used to test various aspects of web application at some point have to find your way around using selenium, one of those situations is the flash component testing using selenium. Developers use Flash to embellish their sites, but it makes test automation a difficult task, because selenium cannot read or burn any action on the flash objects.

There are two main issues to be addressed, while the automation of web applications involving flash objects --

* Verification of a given set value exists or not, or in simple terms, it is necessary to 'get' certain properties of the object and compare it with benchmarks

* Taking action on an object or 'certain values.

These two issues could be easily handled by selenium for most things around, except for flash.

This article describes how to automate the testing of Flash based web application components. The basic steps involved in any automation are:

* Monitor and analyze

* Develop a common pattern

* Use this pattern for automation.

These three steps are very important, while understanding of automation components for Flash based web applications. Most of the time you use Flash in web applications --

* To play the static content in film. The reason I am saying is that the static content of the film content remains the same.

* To make the dynamic content using Flash, as representing the content of an image strip or a strip of clips in Flash or display the title of a page in Flash. The reason I am mentioning these as dynamic content, is that Flash is only collect this data on any system and displaying it in Flash format. Contents may vary depending on the context of the page. For example, Flash can be used to show a strip of pictures uploaded to a particular program for a web site media. In this case the behavior of the Flash is the same for all programs; only the content shown is changing.

Both cases could be automated in a different way depending on the information available in the DOM (Document Object Model). We will take 1st and 2nd case describes how to use the information for our automation DOM and headed to one of two issues (i.e. the verification of certain values). We used the 3 steps above to automate the Flash-based component of a web site media. If you have a website where information is read into dynamic Flash ' flashvars ', then you could follow the same steps.

So how to know if the Flash components of your site using the information flashovers' or not? Well, not that hard to find out. All you need do is:

* Install Firebug plug-in for Firefox, if you do not already have.

* Search for the 'flash' in the div tag burner will get some information on Flash content and contains an object tag for flash player.

* This object tag search for 'par am' mostly called 'flashovers' and the value it contains all the information that the flash will be displayed.

Alternatively you can search directly for 'flashvars':) As below

* For this you can easily get its X Path (only navigate mouse over the item that appears at the top of Firebug some editing) or use another Firefox plug-in, spell X Path.

* After the x path you can get the value of this 'par am' or 'flashvars' in a string using get Attribute () function of selenium.

* This chain is a bit odd at first glance, but in analyzing this chain which is a common pattern and it would be easy for you to then parse this string to obtain the required values.

This technique is very useful at least in the verification of certain values. you can always search for 'flash' on the burner and see if any information in its parameters or other labels that could be exploited for automation. We will apply this technique at www.youtube.com because we know that all of you tube videos are displayed through Flash. A very interesting application of this technique might be testing whether the ID of the video played on YouTube is the same as the one shown to embed or not. This is the appropriation of the screen of a random YouTube video.

As you can see we have followed the same steps mentioned in this article and search 'flashvars' flashvars we found that contains some words like "video_id' in the chain and after signing the '=' containing the value of the ID. Yes, we have to analyze the value chain 'video_id and compared with the value specified in the URL!

In the technique presented above, there is nothing which is applicable only for flash objects. You can follow the three steps above for any kind of automation and can reach a similar technique to something else and on the basis of context. In the next article we will discuss a specific technique for selenium Flash using flash-selenium.jar to automate more advanced interactions with Flash using selenium.

0 comments:

Post a Comment

Sponsored Ad

Development Updates

Tech Updates