13 Jun 2010 @ 8:02 PM 

When testing flash and flex applications there are some approaches to it. Well this may vary but to make it more “highly skilled” some testers or managers go for some tool usage. Here are some usual approaches:

  • Selenium Flash. Selenium is free tool and can be found here http://seleniumhq.org/. For simple web applications it works like this:
  1. (You must have Mozilla Firefox for this) Download Selenium IDE from http://seleniumhq.org/download/ and install the plugin for Firefox.
  2. Selenium intro shows how can you record and playback one simple script. Its good when you are not familiar with Selenium commands. Export also, for later steps described here, in some programming language that you are familiar like Python the script.
  3. Download and unzip Selenium RC. It will contain, among the clients, a folder selenium-server-*. (You will need Java JRE for this) Run from that folder the selenium server in one console(Linux) or command-prompt (Windows) “java -jar selenium-server.jar“.
  4. In another console or command prompt launch the exported script. If you exported in python and the script name is seleniumtest.py run it like this “python seleniumtest.py“.
  5. Firefox(by default) will open and run the test than if successful the browser will close. You can enhance, modify and build on that also.

So this was for simple usage. When trying on flash or flex you will notice that this will not work anymore. You need something extra FlexUISelenium.
For this you need this steps:

1)Download and install Selenium RC

2)Download Selenium Flex API, and rebuild your Flex application with SeleniumFlexAPI.swc

3)Download FlashSelenium and add to your test project

4)Download FlexUISelenium and add to your test project

5)Write and run your test cases against your Flex applications

Here is a sample code also:


@Test
public void sumForValidNumbers() {

flexUITester.type(“2″).at(“arg1″);
flexUITester.type(“3″).at(“arg2″);
flexUITester.click(“submit”);
assertEquals(“5″, flexUITester.readFrom(“result”));

}

But the idea is that you need the code compiled with extra stuff and you cannot test in this way any flash application on web. Also you will not be able to record and to know the IDs of a button or edit box within flash, you will need to build within the application Flex Spy.

Now the idea here: This might work fine and look cool in the begging or for demo presentation, but if you really want to test you should be very careful. Setting up and running is VERY time consuming. Debugging is VERY time consuming. Doing complex stuff is again time consuming. You will think you have a lot of similar sub-functions or area that will need to work with Selenium. Think again because if you set up scripts to run for hours the run can break for X number of reasons. Do not compare what you have in a text description or a simple demo with real usage of it. Although you can do stuff like testing a login with different inputs or include a simple test run after each build automatically let’s say its worth, but for actual tests you need something better, a good tester for example. Thing again at what is your purpose to test in this application. If it has flash or flex it doesn’t mean instantly that it needs a tool for flash testing. You should think about the context, maybe its better to generate relevant data for input and output. Test the load, test different browsers not launching Selenium(which it apparently supposed to do). Think about the time lost with Selenium and that can be done by exploratory testing. You will think that it should be more faster because in the organization are lot of projects and you need every possible test case in advance (which is something impossible BTW) and lots of scripts to do everything fast. THIS DOESN’T WORK LIKE THIS. I am not saying its a totally un-useful tool but there you must decide the context of that usage and think if its really useful. (I mean really useful for testing not impressing managers temporary).


Besides Selenium we can have different tools related to Flash/Flex like:

  • Flash Debugger. For flash debugger you don’t need the code or to pre-compile the code with anything. The flash debugger can be used From Adobe releases, it is basically the same way of installing as normal flash player but once installed you have extra functionality. You can best use this in Firefox with Flash Tracer plugin. To make the plugin work use the steps here https://addons.mozilla.org/en-US/firefox/addon/3469/.

You can obtain a valuable log and logs shows you possible errors that you didn’t spot, records your activity, and a log is always good. The disadvantage here is that your browser with this plugin will work a little slower. But its not a bad tool in my opinion.

  • Eggplant is a tool that I am very little familiar. But apparently it operates by images using remote desktop connections like with VNC. I don’t know actually anyone who ever used it but I have serious doubts about the limits of the tool. I think its good for simple stuff, like Selenium maybe for login testing some penetration testing by repetitive different inputs. But this could be done also in other ways probably more efficient. Tool is also NOT free. I don’t care how much its costs but I wouldn’t purchase it. I think it has a lot of limitations that tools have when dealing with GUI and I am not referring at only exceptions, delays ,waiting for next screen/window but the time to set up and create and debug this. Also stuff that will never be possible to do with this tools. Also a tool gives the false impression an area is fully tested to testers also managers.
  • Other expensive automated tools I won’t even consider. There are a few but again limited, time consuming, extra cost for it when you can better pay a better tester.

So this is my view on this Flash testing. Consider only simple tools that really help, don’t go into the deep dark valley of tools that actually make it worse. Some testers due to lack of technical background will try this because looks like high skill stuff or just because are bored or just because the company is threatening them to use it.

But the catch is not only here. Let’s say an organization realizes this and goes only for tester decisions. But what type of tester will be is hard to know. The risk is choosing speculative testers or friends of the boss or a cousin to decide how to test. Sometimes if its not scripted its just “manual testing” and they can hire anyone. Its worst if this can be a test lead.

  • Download and install Selenium RC
  • Download Selenium Flex API, and rebuild your Flex application with SeleniumFlexAPI.swc
  • Download FlashSelenium and add to your test project
  • Download FlexUISelenium and add to your test project
  • Write and run your test cases against your Flex applications
  • ShareThis
    Posted By: Eusebiu Blindu
    Last Edit: 13 Jun 2010 @ 08:05 PM

    EmailPermalink
    Tags
    Categories: Uncategorized


     

    Responses to this post » (3 Total)

     
    1. rahul says:

      how to read the content of a particular cell in the dataGrid using flashselenium/flexselenium ?

    2. clive says:

      What about using Funit (Flex unit Testing) with ant build scripts?

    Post a Comment

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


     Last 50 Posts
    • Users » 1
    • Posts/Pages » 106
    • Comments » 94
    Change Theme...
    • VoidVoid
    • LifeLife
    • EarthEarth
    • WindWind
    • WaterWater
    • FireFire
    • LightLight « Default

    Bugs

    • No categories

    Carnivals

    • No categories

    Classic Tests

    • No categories

    EWT

    • No categories

    funny

    • No categories

    General

    • No categories

    Linux

    • No categories

    Spelling and identation

    • No categories