<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-4025315227623560366</atom:id><lastBuildDate>Wed, 23 Dec 2009 06:11:32 +0000</lastBuildDate><title>Peter's to did</title><description></description><link>http://peternic.blogspot.com/</link><managingEditor>noreply@blogger.com (Peter Motzfeldt)</managingEditor><generator>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-2183907101526640430</guid><pubDate>Mon, 09 Mar 2009 08:53:00 +0000</pubDate><atom:updated>2009-03-09T02:03:32.062-07:00</atom:updated><title>FunFX and Firewatir on JRuby</title><description>Hi&lt;br /&gt;&lt;br /&gt;Today we wanted to get FUNFX tests running by Maven and then it was easier to get things going with JRuby than with Ruby. We found that regular Firewatir for the moment does not support JRuby, but we found a patch by Sai Venkatakrishnan here http://rubyforge.org/pipermail/wtr-development/2008-November/000323.html&lt;br /&gt;&lt;br /&gt;This patch worked great for us on Firewatir 1.6.2. Maybe this patch has been entered into the next release candidate, I did not check. But copy the patch into the case statement in firewatir.rb where it checks for java and you are good to go.&lt;br /&gt;&lt;br /&gt;Works great for us.&lt;br /&gt;&lt;br /&gt;Thanks Sai!&lt;br /&gt;&lt;br /&gt;After installing JRuby and FunFX with the gem installer for JRuby and the same with Firewatir. Just run your scripts with jruby instead of ruby.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-2183907101526640430?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2009/03/funfx-and-firewatir-on-jruby.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>8</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-6437811752743162758</guid><pubDate>Fri, 30 Jan 2009 08:00:00 +0000</pubDate><atom:updated>2009-01-30T00:02:58.524-08:00</atom:updated><title>FunFX 0.2.2 released on Rubyforge</title><description>Hi everybody.&lt;br /&gt;&lt;br /&gt;Again I am so sorry that I have not updeted this blog.&lt;br /&gt;&lt;br /&gt;But now we have released the 0.2.2 version on Rubyforge. Have not yet had the time to get up and going a real getting started guide. But have started one here &lt;a href="http://wiki.github.com/peternic/funfx"&gt;http://wiki.github.com/peternic/funfx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please just edit the page and add what ever you find missing or is nice to know for the next person.&lt;br /&gt;&lt;br /&gt;To install FunFX: gem install funfx :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-6437811752743162758?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2009/01/funfx-022-released-on-rubyforge.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>7</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-2314836384745401157</guid><pubDate>Mon, 01 Dec 2008 15:03:00 +0000</pubDate><atom:updated>2008-12-01T07:06:29.235-08:00</atom:updated><title>FunFX 0.2.0</title><description>Hi everybody&lt;br /&gt;&lt;br /&gt;I am sorry about the slow update rate of this blog. I have lately been developing the new FunFX. It is still located at github.com &lt;br /&gt;(http://github.com/peternic/funfx/tree/master)&lt;br /&gt;&lt;br /&gt;We are going to release it on Rubyforge soon, but please try it by downloading it from github.&lt;br /&gt;&lt;br /&gt;It is much better that the first version, and there are just small changes you need to do to your test scripts.&lt;br /&gt;&lt;br /&gt;- Peter&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-2314836384745401157?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/12/funfx-020.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>18</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-7625817975364649075</guid><pubDate>Tue, 19 Aug 2008 15:55:00 +0000</pubDate><atom:updated>2008-08-19T09:06:04.841-07:00</atom:updated><title>Taking FunFX to the next level</title><description>Hi everybody&lt;br /&gt;&lt;br /&gt;FunFX have been needing a facelift for a while now. It works, but there are aspects of FunFX that bearly works.&lt;br /&gt;&lt;br /&gt;Aslak Hellesøy, a colleague from BEKK and creator of many fantastic Ruby applications, has taken the initiative to help me improve FunFX.&lt;br /&gt;&lt;br /&gt;The bad thing about this facelift will be that there will be some changes in the way test scripts are written, so some rewriting will be necessary.&lt;br /&gt;&lt;br /&gt;The first thing we have done is to base FunFX on Watir. This will make it simpler to get going with FunFX and alot of functionality is allready in place. &lt;br /&gt;&lt;br /&gt;In the current version, all ruby classes of the Flex objects are created at runtime and in memory. This has made it difficult to begin using FunFX due to bad documentation. In the next version, these classes will be created on file, so that there will be a nice rdoc explaining these classes making it easier to use.&lt;br /&gt;&lt;br /&gt;We have also changed to git instead of subversion, so it will be possible to create own versions, that we can merge.&lt;br /&gt;&lt;br /&gt;I will write more about the upcomming FunFX during development. For now it is possible to find the new FunFX source at github.com. But notice that it is still early in development.&lt;br /&gt;&lt;br /&gt;Hope you will use the new version!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-7625817975364649075?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/08/taking-funfx-to-next-level.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>21</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-5508143198637225896</guid><pubDate>Fri, 11 Jul 2008 14:04:00 +0000</pubDate><atom:updated>2008-07-11T07:11:26.915-07:00</atom:updated><title>Use the new Flex 3 components like AdvancedDatagrid</title><description>Hi&lt;br /&gt;&lt;br /&gt;I just recently (yesterday) needed to test a advanced datagrid. I have just tested it as a regular datagrid for the moment. I have not been able to release a fix for this, so I write about it here instead, since I am going on a holiday now for the next 2 weeks.&lt;br /&gt;&lt;br /&gt;To be able to utilize the advanceddatagrid you need to include a new file to the Flex project &lt;span style="font-weight:bold;"&gt;automation_dmv.swc&lt;/span&gt;. But with this file included the FunFX version out fails. But with a quick fix this will not be a problem.&lt;br /&gt;&lt;br /&gt;Ilkka Kudjoi have made a fix, which is located &lt;a href="http://dpaste.com/62646/"&gt;http://dpaste.com/62646/&lt;/a&gt;. His fix makes FunFX only care about automationchildren. I used to only care for automationchildren, but changed it for a while back, but do not remember that for the moment.&lt;br /&gt;&lt;br /&gt;So try it if you would like. But will release a new version i agust. &lt;br /&gt;&lt;br /&gt;Have good summer!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-5508143198637225896?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/07/use-new-flex-3-components-like.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-6399851255788614400</guid><pubDate>Mon, 23 Jun 2008 12:50:00 +0000</pubDate><atom:updated>2008-06-23T05:58:32.186-07:00</atom:updated><title>Automation.swc locks application</title><description>Hi, I had a strange problem at work last week. The problem was when I added automation.swc and automation_agent.swc to a new project I am working on, all controls was lokced. I was not able to click on any objects. But as soon as I removed the swc files, everything worked great. &lt;br /&gt;&lt;br /&gt;I did not have the time to take a closer look at the problem until today. And searched &lt;a href="http://tech.groups.yahoo.com/group/flexcoders"&gt;flexcoders&lt;/a&gt; (a great group by the way for information about Flex and Actionscript), to see if anyone else been through the same thing. And what do you know :-) At &lt;a href="http://tech.groups.yahoo.com/group/flexcoders/message/114275"&gt;this post&lt;/a&gt;, I got to &lt;a href="http://ranikumar.wordpress.com/2008/04/02/automation-issues-controls-non-clickable/"&gt;this site&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;The problem seems to be that if you have an invisible container of some sort that overlaps other containers, that container will steal all the focus from any other container.&lt;br /&gt;&lt;br /&gt;The solution to this problem is to add an eventlistener to the stage to be able to locate the container. And when you have discovered the container, add &lt;span style="font-weight:bold;"&gt;mouseEnabled="false"&lt;/span&gt; to it. Then everything should be working!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-6399851255788614400?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/06/automationswc-locks-application.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-40653090823215616</guid><pubDate>Thu, 12 Jun 2008 16:04:00 +0000</pubDate><atom:updated>2008-06-12T09:20:54.669-07:00</atom:updated><title>Use FunFX together with Watir</title><description>Usually Flex applications uses a regular HTML pages for authentication or by other support. When this is the case, FunFX alone is not able to get to the Flex part. In these situations you can use the excellent tool &lt;a href="http://wtr.rubyforge.org/"&gt;Watir&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;To make Watir work together with FunFX you do the same setup as usually with FunFX, but you also require watir, and attaches Watir to the browser FunFX started. With the example below I use the the title of the page to make Watir understand what browser to choose.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie = Funfx.instance&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.start(true)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.speed = 1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.goto("http://localhost/flexapplication.html", "flexapplication")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;$browser = Watir::IE.attach(:title, "PageTitle")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;When you have done this, both the FunFX instance and the Watir instance is able to control the browser. But one thing you should watch out for is that when FunFX enter the Flex application, it must set the flex object again, so either if you use FunFX to navigate to the Flex application, you can define the flex object in the goto statement. Or you can use the setFlexObject method.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.goto("www.google.com", nil)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;$browser.text_field(:name, "q").set "pickaxe"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;$browser.button(:name, "btnG").click&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.goto("http://localhost/flexapplication.html", "flexapplication")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.button("buttonName").click&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.set_flex_object("flexapplication")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-40653090823215616?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/06/use-funfx-together-with-watir.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>6</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-2442756822395894799</guid><pubDate>Tue, 15 Apr 2008 18:51:00 +0000</pubDate><atom:updated>2008-04-16T00:01:04.022-07:00</atom:updated><title>FunFX 0.0.4 Released</title><description>Hi, have been a while now, sorry about that. But now thanks to Neil Curzon, Bill Torla and Mario Sanchez a new version is available. This version has added a patch that makes it possible to access different browsers with in the tests, to look at different sessions.&lt;br /&gt;&lt;br /&gt;It is now also possible to use FunFX together with Watir. It was difficult before, due to FunFX's lack of ability to hook onto other browser windows.&lt;br /&gt;&lt;br /&gt;It is also now possible to select a row in a datagrid by index instead of text. It still uses the item_renderer option, but if you give a integer into it that is within the grids row count it chooses row by index.&lt;br /&gt;&lt;br /&gt;Let me know how things work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-2442756822395894799?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/04/funfx-004-released.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>15</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-4495853052136915896</guid><pubDate>Mon, 10 Mar 2008 19:00:00 +0000</pubDate><atom:updated>2008-03-10T12:07:43.592-07:00</atom:updated><title>Finding the right element in a combobox</title><description>This post might be usefull not only for a combobox but all other list type of controls. &lt;br /&gt;&lt;br /&gt;You have maybe found a better solution than this yourself, but I would like to show you a simple (maybe not the best) way to find specific item in a combobox. As you maybe know or have experienced Flex does only draw what you see and hence an item you do not see in the combobox is not possible to select. Due to this you will have to scroll the elements to make it visible.&lt;br /&gt;&lt;br /&gt;I played around a couple of minutes and just created this while loop that scrolls all the items, and picks out the item with the itemrenderer "12"&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;@ie.combo_box("cbTest").open&lt;br /&gt;num_rows = @ie.combo_box("cbTest").num_rows&lt;br /&gt;position = 0&lt;br /&gt;while(position &lt;= num_rows)&lt;br /&gt;  @ie.combo_box("cbTest").scroll(:position =&gt; position)&lt;br /&gt;  begin&lt;br /&gt;    @ie.combo_box("cbTest").select(:item_renderer =&gt; "12")&lt;br /&gt;    position = num_rows + 1&lt;br /&gt;  rescue&lt;br /&gt;    position += 1&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Support for this might be built into the FunFX framework, that it searches like that automatically, or what do you think?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-4495853052136915896?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/03/finding-right-element-in-combobox.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>13</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-4919355713127747160</guid><pubDate>Fri, 22 Feb 2008 11:41:00 +0000</pubDate><atom:updated>2008-02-22T09:38:47.699-08:00</atom:updated><title>FunFX and custom components</title><description>&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;Hi, I have for a while now been supposed build a custom component with custom events and post how to to this here.&lt;br /&gt;&lt;br /&gt;I am eventually finshed an example of how to create a custom component, which is not possible to act upon with the regular actions from FunFX.&lt;br /&gt;&lt;br /&gt;(By the way, I followed this tutorial, &lt;a href="http://livedocs.adobe.com/labs/flex3/html/functest_components2_18.html"&gt;Create custom component Flex&lt;/a&gt;, it is for QTP, but are in many ways the same way to create a custom component for FunFX.&lt;br /&gt;&lt;br /&gt;Thanks alot to Jarek for pointing out the problem I had. I used the wrong variable in the call to the super class' constructor. I used a couple of hours yesterday banging   my head in to the wall. But after the help from Jarek everything fell into place.&lt;br /&gt;&lt;br /&gt;It is actually very easy to implement an custom component, and use it with FunFX. What you need to do is 4 steps:&lt;br /&gt;&lt;br /&gt;1. Create the custom component&lt;/br&gt;&lt;br /&gt;2. Create the custom event&lt;/br&gt;&lt;br /&gt;3. Create the delegate that extends for instance UIComponentAutomationImpl&lt;/br&gt;&lt;br /&gt;4. Add the component to the AutomationGenericEnv.xml file&lt;/br&gt;&lt;br /&gt;&lt;br /&gt;(Does not need to do them in that order)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px; font-weight: bold;"&gt;&lt;br /&gt;Create the custom component&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;I chose to create a simple component listing different buttons, which could easily be done with a repeater, but that is not the point. I wanted to find out and hopefully share my findings with you guys, that haven't tried it yet. What I wanted to do was to implement my own event, so that I could use the itemrenderer tag in the event to make the buttons be pushed.&lt;br /&gt;&lt;br /&gt;Below is the code for the custom component. It just extends from a existing component and overrides the necessary methods like, createChildren etc. What is important to notice here is that you need to add you children, that you want to reach into the _renderers so that they can be used by the delagate as automationChildren. The top event sentence makes it possible for the delegate to replay that customevent, which I will create after this.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;[Event(name="itemClick", type="event.CustomItemClickEvent")]&lt;br /&gt;public class CustomComponent extends VBox&lt;br /&gt;{&lt;br /&gt;private var _dataProvider:Array;&lt;br /&gt;private var _renderers:Array = [];&lt;br /&gt;private var _itemRenderer:IFactory = new ClassFactory(Button);&lt;br /&gt;&lt;br /&gt;public function CustomComponent()&lt;br /&gt;{&lt;br /&gt;super();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override protected function createChildren():void{&lt;br /&gt;super.createChildren();&lt;br /&gt;for(var i:int=0; i&amp;lt;_dataProvider.length; i++){&lt;br /&gt;var inst:UIComponent = _itemRenderer.newInstance();&lt;br /&gt;inst.addEventListener(MouseEvent.CLICK, itemClickHandler);&lt;br /&gt;this.addChild(inst);&lt;br /&gt;_renderers.push(inst);&lt;br /&gt;&lt;br /&gt;Button(inst).label = _dataProvider[i];&lt;br /&gt;}&lt;br /&gt;invalidateSize();&lt;br /&gt;invalidateDisplayList();&lt;br /&gt;}&lt;br /&gt;//You must also implement an itemClickHandler, for the buttons, but that is nothing special&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px; font-weight: bold;"&gt;&lt;br /&gt;Create the custom event&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;To be able to click on the button, I need to create a custom event that makes this happen. This event holds a button which is the type of item the custom component is holding. It is probably possible to do this a bit more generic, but this was just to understand how things works.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;public class CustomItemClickEvent extends Event&lt;br /&gt;{&lt;br /&gt;public var itemRenderer:Button;&lt;br /&gt;public static const ITEM_CLICK:String = "itemClick";&lt;br /&gt;&lt;br /&gt;public function CustomItemClickEvent(type:String){&lt;br /&gt;super(type, bubbles, cancelable);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px; font-weight: bold;"&gt;&lt;br /&gt;Create the delegate&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;The delegate must be included to the application project that uses the custom component. I chose to build an swc of the delegate and add it as the FUnFXAdapter.swc file.&lt;br /&gt;&lt;br /&gt;Below is the code from the delegate. It is important to use the [Mixin] attribute, as this forces the delegate's init methd to be run when your application starts. The numAutomationChild and getAutomationChild methods you will have to implement concerning how your custom component added items to the renders array. Here you can do what you want.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;[Mixin]&lt;br /&gt;public class CustomComponentDelegate extends UIComponentAutomationImpl&lt;br /&gt;{&lt;br /&gt;public static function init(root:DisplayObject):void&lt;br /&gt;{&lt;br /&gt;    Automation.registerDelegateClass(CustomComponent, CustomComponentDelegate);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private var comp:CustomComponent;&lt;br /&gt;public function CustomComponentDelegate(component:CustomComponent)&lt;br /&gt;{&lt;br /&gt;super(component);&lt;br /&gt;comp = component;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override public function get numAutomationChildren():int&lt;br /&gt;{&lt;br /&gt;var renderers:Array = comp.getItemRenderers();&lt;br /&gt;if(renderers != null)&lt;br /&gt;return renderers.length;&lt;br /&gt;else return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override public function getAutomationChildAt(index:int):IAutomationObject&lt;br /&gt;{&lt;br /&gt;var renderers:Array = comp.getItemRenderers();&lt;br /&gt;if(renderers == null) return null;&lt;br /&gt;if(index &amp;gt;= 0 &amp;amp;&amp;amp; index &amp;lt; renderers.length)&lt;br /&gt;return renderers[index];&lt;br /&gt;else&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override public function replayAutomatableEvent(event:Event):Boolean&lt;br /&gt;{&lt;br /&gt;var help:IAutomationObjectHelper = Automation.automationObjectHelper;&lt;br /&gt;if (event is CustomItemClickEvent)&lt;br /&gt;{&lt;br /&gt;var rEvent:CustomItemClickEvent = event as CustomItemClickEvent&lt;br /&gt;help.replayClick(rEvent.itemRenderer);&lt;br /&gt;(uiComponent as IInvalidating).validateNow();&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;return super.replayAutomatableEvent(event);&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px; font-weight: bold;"&gt;&lt;br /&gt;Add the component to the AutomationGenericEnv.xml file&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;When everything is created you can add the component to the AutomationGenericEnv.xml file. Below is what I added somewhere in the file below the Object (because it is based on inheritance and the file is parsed.)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;&amp;lt;ClassInfo Name="CustomComponent" Extends="Object" SupportsTabularData="true"&amp;gt;&lt;br /&gt;&amp;lt;Implementation Class="CustomComponent"/&amp;gt;&lt;br /&gt;&amp;lt;Events&amp;gt;&lt;br /&gt;&amp;lt;Event  Name="ItemClick"&amp;gt;&lt;br /&gt;&amp;lt;Implementation Class="customEvent::CustomItemClickEvent" Type="itemClick"/&amp;gt;&lt;br /&gt;&amp;lt;Property Name="itemRenderer"&amp;gt;&lt;br /&gt;&amp;lt;PropertyType Type="String" /&amp;gt;&lt;br /&gt;&amp;lt;/Property&amp;gt;&lt;br /&gt;&amp;lt;/Event&amp;gt;&lt;br /&gt;&amp;lt;/Events&amp;gt;&lt;br /&gt;&amp;lt;Properties&amp;gt;&lt;br /&gt;&amp;lt;/Properties&amp;gt;&lt;br /&gt;&amp;lt;/ClassInfo&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px; font-weight: bold;"&gt;&lt;br /&gt;Building a test application and writing a test&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;Now you are ready to write an application using the component and a test which interacts with the component.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;&amp;lt;Application="" mx="http://www.adobe.com/2006/mxml" component="component.*"&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;component:CustomComponent="" id="cust" dataprovider="['Nr1','Nr2']"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px; font-family: courier new; font-size: 12px;"&gt;&lt;br /&gt;@ie.custom_component("cust").item_click(:item_renderer =&amp;gt; "Nr2")&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-size: 12px;"&gt;&lt;br /&gt;I hope this was helpfull, and possible to understand :-)&lt;br /&gt;&lt;br /&gt;Do not forget to read the post about RSpec and Stories that I wrote just before this post. Thanks!&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-4919355713127747160?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/02/funfx-and-custom-components.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>15</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-8212603700985338538</guid><pubDate>Fri, 22 Feb 2008 07:42:00 +0000</pubDate><atom:updated>2008-02-22T01:44:04.570-08:00</atom:updated><title>FunFX and RSpec with stories</title><description>Hi again&lt;br /&gt;&lt;br /&gt;I how now been playing around with &lt;a href="http://rspec.info/"&gt;RSpec&lt;/a&gt; and its story runner (rBehave). Its a fun way to write the tests as stories. This can work out nice with functional tests.&lt;br /&gt;&lt;br /&gt;First thing you will need to do is to install RSpec (gem install rspec).&lt;br /&gt;&lt;br /&gt;I have created the test towards the initial test application I put out, the one where you can add a product and a product item. A very simple application, but it shows how to work with FunFX in many ways.&lt;br /&gt;&lt;br /&gt;When writing there are three main files (when writing for FunFX, addtional class files if you write for traditional Ruby classes) that must be written. And that is the story, a plain text file, the steps, the code behind the story (actual @ie.button("name").click actions) and a file to runn the stories, this file is often called all.rb and is running all tests you define in it.&lt;br /&gt;&lt;br /&gt;When I searched the net for tips on how to organize the different files there were not created any best practice, as far as I could see. But when I asked &lt;a href="http://blog.aslakhellesoy.com/"&gt;Aslak Hellesøy&lt;/a&gt;   a collegue and one of the creators of RSpec, he provided me with an example.&lt;br /&gt;&lt;br /&gt;If you are to use some kind of ruby classes, they should go into a folder called lib, the step files should go into a folder called steps, and the story should go into a fodler called stories. The all.rb file and a Rake file is located at the root. This was not too spooky :-)&lt;br /&gt;&lt;br /&gt;The first thing I did was to write the story. The story is writen as plain text, but in a certain way. There are certain words that are mapped to the steps file, and these are &lt;span style="font-weight: bold;"&gt;Given&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;When&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;And&lt;/span&gt;, and &lt;span style="font-weight: bold;"&gt;Then&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Below is the text that is in the story file. I think this is a nice way to write tests. This way the business side of a project may read the tests too.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;Story: Add product&lt;br /&gt;&lt;br /&gt;  As an user&lt;br /&gt;  I want to be able to register and delete products&lt;br /&gt;  So that I can have control over the stock&lt;br /&gt;  &lt;br /&gt;  Scenario: Add and delete product&lt;br /&gt;    Given the user is logged into the application&lt;br /&gt; When the user click the Add product button &lt;br /&gt;    Then the product registration view is visible&lt;br /&gt; &lt;br /&gt;    Given the user enters Shirt into the product name textbox&lt;br /&gt; And inputs Tennis into the product category textbox&lt;br /&gt; And the user click the Add item button &lt;br /&gt; And the user enters Pro into the item name textbox&lt;br /&gt; And the user enters 9000 into the price textbox&lt;br /&gt; And the user click the Ok button&lt;br /&gt; Then the product registration view is closed&lt;br /&gt; &lt;br /&gt; When the user selects Shirt from the datagrid&lt;br /&gt; Then the screen shows the count of 1 item numbers&lt;br /&gt; &lt;br /&gt; When the user drags the Shirt item from the datagrid to the trash&lt;br /&gt; Then the datagrid has 0 number of products left&lt;br /&gt; &lt;br /&gt; Then close the application&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Since this was my first time implementing a rspec story I did not write entire story before I wrote the steps, but after you have written the story or in between as I did you will create the steps that will be taken at each line.&lt;br /&gt;&lt;br /&gt;I have created the test towards the initial test application I put out, the one where you can add a product and a product item. A very simple application, but it shows how to work with FunFX in many ways.&lt;br /&gt;&lt;br /&gt;Below is the steps file that implement the story file. One thing that you must remember is that the keyword &lt;span style="font-weight:bold;"&gt;And&lt;/span&gt;, is not used in the steps file. It just syas that the step is of the same type as the step above. And as I can see is only used for Given steps.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;require 'funfx'&lt;br /&gt;&lt;br /&gt;steps_for :product do&lt;br /&gt;  Given "the user is logged into the application" do&lt;br /&gt;    @ie = Funfx.instance&lt;br /&gt;    @ie.start(true)&lt;br /&gt;    @ie.speed = 1&lt;br /&gt;    @ie.goto("http://funfx.rubyforge.org/Flex/FlexRepeater/FlexRepeater.html", "FlexRepeater")&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;    When "the user click the $button_name button" do |button_name|&lt;br /&gt;    @ie.button(button_name).click&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Then "the product registration view is visible" do |balance|&lt;br /&gt;    @ie.title_window("Product registration").visible == "true"&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Given "the user enters $text into the product name textbox" do |text|&lt;br /&gt;    @ie.text_area("tName").input(:text =&gt; text)&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Given "inputs $text into the product category textbox" do |text|&lt;br /&gt;    @ie.text_area("tCategory").input(:text =&gt; text)&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Given "the user click the $button_name button" do |button_name|&lt;br /&gt;    @ie.button(button_name).click&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Given "the user enters $text into the item name textbox" do |text|&lt;br /&gt;    @ie.text_area("tfItemName").input(:text =&gt; text)&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Given "the user enters $text into the price textbox" do |text|&lt;br /&gt;    @ie.text_area("tfPrice").input(:text =&gt; text)&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  Then "the product registration view is closed" do&lt;br /&gt;    @ie.title_window("Product registration") == nil&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  When "the user selects $text from the datagrid" do |text|&lt;br /&gt;    @ie.data_grid("dgOffer").select(:item_renderer =&gt; text)&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Then "the screen shows the count of $item_number item numbers" do |item_number|&lt;br /&gt; @ie.label("lNumberItems").text == item_number&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  When "the user drags the $item item from the datagrid to the trash" do |item|&lt;br /&gt; @ie.data_grid("dgOffer").drag_start(:dragged_item =&gt; "Shirt")&lt;br /&gt;    @ie.box("deleteBox").drag_drop&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Then "the datagrid has $number number of products left" do |number|&lt;br /&gt; @ie.data_grid("dgOffer").num_rows == number&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  Then "close the application" do&lt;br /&gt;    @ie.unload&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;As Mark Anderson stated in the FunFX mailinglist, Rspec and stories does not provide a teardown method, the @ie.unload method must be played different. Michael Latta provided me with this solution. Add a step that might be called close the application, that will be added to all stories.&lt;br /&gt;&lt;br /&gt;The all.rb file looks like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;require 'rubygems'&lt;br /&gt;require 'spec/story'&lt;br /&gt;$:.unshift(File.dirname(__FILE__) + '/lib')&lt;br /&gt;require 'steps/product'&lt;br /&gt;&lt;br /&gt;with_steps_for :product do&lt;br /&gt;  run File.dirname(__FILE__) + '/stories/add_product'&lt;br /&gt;end&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now it is just to run the all.rb file with ruby.&lt;br /&gt;&lt;br /&gt;Tip: I have noticed that there are some problems with FunFX's ability to extract properties as text, automationName and so on with the Flex 3. Due to this one of the steps in the rspec example fail. But that is one more brilliant thing about rspec, it does not quit when it fails, it just states that the step failed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-8212603700985338538?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/02/funfx-and-rspec-with-stories.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-5526101620840544461</guid><pubDate>Fri, 08 Feb 2008 13:00:00 +0000</pubDate><atom:updated>2008-02-15T01:39:15.249-08:00</atom:updated><title>Test application is out</title><description>Hi&lt;br /&gt;&lt;br /&gt;Due to the lack of a good source to what FunFX is able to to and how to do it, I have created a test application, which is located at &lt;a href="http://funfx.rubyforge.org/Flex/FlexObjectTest/FlexObjectTest.html"&gt;http://funfx.rubyforge.org/Flex/FlexObjectTest/FlexObjectTest.html&lt;br /&gt;&lt;/a&gt;, the source is found at &lt;a href="http://funfx.rubyforge.org/Flex/FlexObjectTest/srcview/"&gt;http://funfx.rubyforge.org/Flex/FlexObjectTest/srcview/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This application contains many of the available display objects in the Flex language, and all display objects have related FunFX tests at &lt;a href="http://funfx.rubyforge.org/FunFXTests/"&gt;http://funfx.rubyforge.org/FunFXTests/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I hope this application will make it easier to understand FunFX and also be a knowledge base where we can exchange knowledge on how to test different controls.&lt;br /&gt;&lt;br /&gt;I hope everybody can contribute with sample code that is either difficult to test and you have tests written for this code, so that other people can learn. Or if you simply have code that you are not able to test, then others can help test the code.&lt;br /&gt;&lt;br /&gt;In this way, FunFX would be able to get better much faster.&lt;br /&gt;&lt;br /&gt;The test application and tests are under svn control at Rubyforge, but there is no automatic roll out, so I have also created an email &lt;span style="font-weight: bold;"&gt;funfx.tests at gmail.com&lt;/span&gt;, which could be used to contribute with code or tests.&lt;br /&gt;&lt;br /&gt;(Please add the word FunFX in the subject so I can sort the mail efficiently.)&lt;br /&gt;&lt;br /&gt;I hope this helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-5526101620840544461?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/02/test-application-is-out.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>8</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-8033324648061986163</guid><pubDate>Fri, 08 Feb 2008 12:56:00 +0000</pubDate><atom:updated>2008-02-08T05:37:02.862-08:00</atom:updated><title>Version 0.0.3 is out</title><description>Hi&lt;br /&gt;&lt;br /&gt;Now a new version is released, The one big change is the support for Safari browser on the OS X, thanks to Neil Curzon for implementing this.&lt;br /&gt;&lt;br /&gt;Other changes is that I have changed the way FunFX searches children. In the earlier versions, it used the getAutomationChild method but now I have switched to getChild method. This improves the support for repeaters.&lt;br /&gt;&lt;br /&gt;Let me know if something does not work with these changes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-8033324648061986163?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2008/02/version-003-is-out.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-8110212070817002611</guid><pubDate>Sat, 22 Dec 2007 17:22:00 +0000</pubDate><atom:updated>2007-12-22T09:55:02.401-08:00</atom:updated><title>FormItem problem</title><description>Hi!&lt;br /&gt;&lt;br /&gt;I just recently got a notice on my last post from Neil that when using FunFX a null pointer exception is thrown when any form item's label in a form is null as shown in the first listing. Neil pointed out that it was also happening when the label was set to an empty string.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&amp;lt;mx:form&amp;gt;&lt;br /&gt;&amp;lt;mx:formitem label="Form Label"&amp;gt;&lt;br /&gt;&amp;lt;mx:label id="lLabel"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:formitem&amp;gt;&lt;br /&gt;&amp;lt;mx:formitem&amp;gt;        &lt;br /&gt;&amp;lt;mx:textinput id="tTextInput"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:formitem&amp;gt;&lt;br /&gt;&amp;lt;/mx:form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Neil pointed out that it was something to do with the FunFX and FormItemAutomationImpl interaction. And that one need to set all the form items labels to a non empty string. And that using whitespaces as label affects the layout. He suggested a nice workaround until a fix with the FormItemAutomationImpl is done. And that is to set the label width to 0.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&amp;lt;mx:form&amp;gt;&lt;br /&gt;&amp;lt;mx:formitem label="Form Label"&amp;gt;&lt;br /&gt;&amp;lt;mx:label id="lLabel"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:formitem&amp;gt;&lt;br /&gt;&amp;lt;mx:formitem label="" labelWidth="0"&amp;gt;        &lt;br /&gt;&amp;lt;mx:textinput id="tTextInput"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:formitem&amp;gt;&lt;br /&gt;&amp;lt;/mx:form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I have created the error for my own, and the reason for the error is as Neil said. The FunFX uses the automation framework from Adobe to create string id of the display objects that it interacts with. And this method in the FormItemAutomationImpl.as as displayed in the following listing.  When the label of the formitem is null, there is no check that will prevent the method to call the length method of the label, which might be null.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;private function getItemAutomationName(child:IAutomationObject):String&lt;br /&gt; {&lt;br /&gt;//Have cut down the method&lt;br /&gt;         result = (&lt;span style="color: rgb(255, 0, 0);"&gt;label.length&lt;/span&gt; != 0 ? label + ":" + child.automationName : child.automationName);&lt;br /&gt;// More in the real method&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I have not yet been able to check wether it is possible to just add a null pointyer check in the method. But this will probably implie a change in th corresponding method that creates an object from the string id.&lt;br /&gt;&lt;br /&gt;I hope this will help people in the same situation as Neil. And I will see if it can be fixed. But so long you will need to do as Neil suggested and set the labelWidth of the form item to zero.&lt;br /&gt;&lt;br /&gt;Thanks alot Neil, for this valuable tip and solution!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-8110212070817002611?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2007/12/formitem-problem.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>10</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-126849641518306978</guid><pubDate>Wed, 05 Dec 2007 07:56:00 +0000</pubDate><atom:updated>2007-12-05T23:17:54.528-08:00</atom:updated><title>Some problems and solutions when using FunFX</title><description>Hi everyone.&lt;br /&gt;&lt;br /&gt;These past days I have used some time trying to set up FunFX for the project I am on at work. I have said to my self earlier (because some people have had some problems with custom components) that I would write a post about this. Because I do no know to much about this area, how FunXF actually handles, I have not had the time to do this yet, but I asure you that it will come.&lt;br /&gt;&lt;br /&gt;So instead I will use this post to talk about some of the problems and solutions I have had the last few days.&lt;br /&gt;&lt;br /&gt;First of all double clicking a row in a datagrid made me a bit frustrated today, because it would not replay the action that I wanted to do. The following line was what I tried to do (the datagrid contained a row with a column that held the value "Person".&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.data_grid("name").double_click(:item_renderer =&gt; "Person")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;After some error checking it seems that you must select the row before doing a double click. The following lines works perfect. I have not yet found a good reason why this behavior or a better solution if people think it should be handled better.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.data_grid("name").select(:item_renderer =&gt; "Person")&lt;br /&gt;@ie.data_grid("name").double_click(:item_renderer =&gt; "Person")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Anther thing I has some trouble with was accessing elements of an repeater when there is an hierarchy of display objects within the repeater, then the number of the single element I wanted waas multiplied with the number of parents abow. In the following example I would get 4 tLabels and 4 tData.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;mx:repeater id="rep" dataprovider="{}"&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;mx:vbox id="vboxen"&lt;/span&gt;&amp;gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;        &amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;mx:hbox id="hboxen"&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;mx:textinput id="tLabel" text="{rep.currentItem.label}"/&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;mx:textinput id="tData" text="{rep.currentItem.data}"/&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;/mx:hbox&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;/mx:vbox&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;/mx:repeater&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I am still testing the solution (and will probably put out a new version of FunFX in the next days), so I am not completely sure that it is the best solution. But I have up until now used the objects automationChildren when  try to reach the children, but this seems to multiply children of repeaters and like. So I have switched to used the rgular children instead, and for now it seems to do the trick, but I still have to test that all other displayobjects still are supported.&lt;br /&gt;&lt;br /&gt;With the new solution the issue where you had to write the repeater and then the object you wanted is now gone. Now the repeater will not exist as an display obejct. So you write as the last bulk says.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.repeater("rep").text_area("tLabel")[0].input(:text =&gt; "Test") # &lt;span style="color: rgb(255, 0, 0);"&gt;This is now wrong&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.text_area("tLabel")[0].input(:text =&gt; "Test") # &lt;span style="color: rgb(51, 204, 0);"&gt;This is correct&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;But so far I am able to do automatic functional testing of a registration form and to ensure that the calculation response from this registration is correct. Due to low speed these tests are not run too often, but I will try later to include the tests in the nightly build.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-126849641518306978?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2007/12/hi-everyone.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>23</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-1320094909854946709</guid><pubDate>Thu, 22 Nov 2007 12:39:00 +0000</pubDate><atom:updated>2008-02-08T01:57:33.346-08:00</atom:updated><title>FunFX - How to write tests</title><description>The last post talked about howto get started and how to make the Flex application ready for testing. I am sorry about the time it took me to post this sequel.&lt;br /&gt;&lt;br /&gt;FunFX is a framework that is composed of two parts, one adapter (the last post talked about this part) that enables the Flex application to be tested, and one Ruby framework that enables you to drive an Internet Explorer instance with the Flex application.&lt;br /&gt;&lt;br /&gt;Some people ask me if there is an easy way to implement support for either FireFox or other browsers, and the answer to this is both yes and no. It depends, there are currently only IE that is implemented and the reason for this is IE's support for COM objects. I will explain this implementation in a bit more detail in another post.&lt;br /&gt;&lt;br /&gt;This post will talk about the Ruby framework mentioned in the beginning. This Ruby framework is a Ruby gem. This framework creates an instance of a Internet Explorer window. Then with some initializing methods you will direct the IE window to the address of the Flex application.&lt;br /&gt;This is shown in the follwoing table. The first sentance creates an instance of FunFX. When executing the second line with the start method FunFX creates an instance of IE in the background with the help of &lt;a href="http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/classes/WIN32OLE.html"&gt;Win32OLE&lt;/a&gt;. The argument tells FunFX if you want the IE to be visible or not.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie = Funfx.instance&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.start(true)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.speed = 1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.goto("http://localhost/flexapplication.html", "flexapplication")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The last sentance in the initialization is the method that directs the browser to the Flex application and hooks on to the actual Flex object with the help from Win32OLE, and the name of the swf file. If you have an  html file named index.html that contains a swf file that is named flexApp.swf and is located at http://localhost/flexapplication/index.html. The&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.goto("http://localhost/flexapplication/index.html", "flexApp")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;After this initialization, the &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;@ie&lt;/span&gt;&lt;/span&gt; variable (which is an instance of FunFX) is ready to interact with the Flex application.&lt;br /&gt;&lt;br /&gt;The FunFX in itself does not test Flex applications in the sence of asserts, it just enables you to drive an Flex application programmatically and get the state and text of all display objects. To make assertions and create test scripts you will need to use FunFX together with a testing framework of your choice. A couple of examples are &lt;a href="http://rspec.rubyforge.org/"&gt;RSpec&lt;/a&gt;, and &lt;a href="http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html"&gt;Test::Unit&lt;/a&gt;. FunFX together with any of these tools make up an automated functional testing tool.&lt;br /&gt;&lt;br /&gt;Before I will show you an example of FunFX together with these tools, I will explain in short how to use FunFX in the sence of driving the Flex application programmatically.&lt;br /&gt;&lt;br /&gt;A Flex application is built as an hierarchy of different display objects, with the Application object as the root node. With FunFX you can think of &lt;span style="font-weight: bold;"&gt;@ie&lt;/span&gt; the root node of the Application object.&lt;br /&gt;&lt;br /&gt;An example of interacting with a display object is shown in the box below.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.button("buttonName").click&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This line of code will click the button with id or label named "buttonName". This button can be located anywhere in the Flex hierarchy. In version 0.0.1 FunFX only supported single elements, and then it stopped when it found a object matching this signature. But this was a problem with repeaters, which creates children with the same id's.&lt;br /&gt;&lt;br /&gt;So in 0.0.2 it finds all objects that matches that type and name, and delivers them as an array, as shown below:&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.button("buttonName")[0].click&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To interact with a display obejct you must provide the label or id.&lt;br /&gt;&lt;br /&gt;Some flex event needs arguments as when inserting text into a textbox.  This is done as follows:&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.text_area("price").input(:text =&gt; "This is the new text")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.data_grid("gridName").drag_start(:dragged_item =&gt; "Name of item")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.data_grid("gridName").drag_drop&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;There are many more methods. Unfortunately there are no good overview of all the methods and their arguments. But you should look at the &lt;span style="font-style: italic;"&gt;AutomationGenericEnv.xml, &lt;/span&gt;&lt;span&gt;which describes all the display object types and their events and arguments.&lt;br /&gt;&lt;br /&gt;When testing the functionality of an application it does not help being just able to drive the application. It must be possible to extract some information to assert with a testing tool such as RSpec or Test::Unit.&lt;br /&gt;&lt;br /&gt;You can get information about alot of thing, such as visibility, text, rows in a datagrid, enabled etc. These are called properties and are also described in the AutomationGenericEnv.xml.&lt;br /&gt;&lt;br /&gt;The following displays some examples of extracting data. It is possible to extract the selected index of an data grid, making it possible to extract information about that grid line with the &lt;span style="font-style: italic;"&gt;tabular_data&lt;/span&gt; property. This creates a comma separated string containing the row information. If there are images in the row, the name of the images will be displayed.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;pos = @ie.data_grid("gridName").selected_index &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;@ie.data_grid("gridName").tabular_data(:start =&gt; pos)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.label("labelName").text&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:85%;"  &gt;@ie.application("applicationName").current_state&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I have not yet tried how this works with the new upgraded grid in Flex 3.&lt;br /&gt;&lt;br /&gt;The following is an example test that tests an flex application that adds a product to a datagrid with the use of an  popup window. This test is test nr 1 at the bottom of this post.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-style: solid; border-width: 1px; padding: 5px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;require 'test/unit'&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;require 'funfx'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;class TestProductOne &lt;&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  def setup&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie = Funfx.instance&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.start(true)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.speed = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.goto("http://funfx.rubyforge.org/Flex/FlexRepeater.html", "FlexRepeater")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  def teardown&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.unload&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  def test_insert_product&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  assert_equal(0, @ie.data_grid("dgOffer").num_rows)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  add_product("Shirt", "Tennis")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.button("bOk").click&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  assert_equal(1, @ie.data_grid("dgOffer").num_rows)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  def add_product(name, category)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.button("bAddProduct").click&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.text_area("tName").input(:text =&gt; name)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  @ie.text_area("tCategory").input(:text =&gt; category)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;This post is a bit messy, but i tries to explain some of the basic elements. The following post will try to explain other concepts in more detail.&lt;br /&gt;&lt;br /&gt;I have put out an test application that set up for testing with a couple of simple actions to perform at &lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/FlexRepeater.html"&gt;TestApplication&lt;/a&gt;. At the following links I have also written a couple of tests that test this application. Please try them out and alter them to see if you get it going (the source code of the view files are available at view source, or this address &lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/srcview/"&gt;source-code&lt;/a&gt;).&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/Tests/test_product_one.rb"&gt;Test1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/Tests/test_product_two.rb"&gt;Test2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/Tests/test_product_three.rb"&gt;Test3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/Tests/test_product_four.rb"&gt;Test4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/Tests/test_product_five.rb"&gt;Test5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://funfx.rubyforge.org/Flex/FlexRepeater/Tests/all_tests.rb"&gt;AllTests&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;I hope this test application and test scripts help you to get going.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-1320094909854946709?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2007/11/funfx-how-to-write-tests.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>50</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-5836648176289629348</guid><pubDate>Sat, 17 Nov 2007 21:45:00 +0000</pubDate><atom:updated>2007-11-18T04:59:29.543-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Flex</category><category domain='http://www.blogger.com/atom/ns#'>FunFX</category><title>FunFX - Getting started</title><description>At the website for FunFX at Rubyforge, there are some old direction on how to get started with FunFX. I will now make a better up-to-date getting started with FunFX (and hopefully get to update the website).&lt;br /&gt;&lt;br /&gt;The first thing you need is to get &lt;a href="http://labs.adobe.com/technologies/flex/flexbuilder3/"&gt;Flex Builder&lt;/a&gt; from Adobe, and the &lt;a href="http://rubyforge.org/frs/?group_id=3898"&gt;FunFX&lt;/a&gt; zip file located at Rubyforge. The FunFX zip file contains three files; &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;AutomationGenericEnv.xml&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;FunFXAdapter.swc&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;FunFX-0.0.x.gem.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;To get things to workyou will need additional three files, but they are part of the Flex 3 SDK (with Flex 2 SDK these files are bundled with Flex Data Services and the automation package, but you will be able to get the files from Flex 3 SDK) ;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;automation_agent_rb.swc&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;automation_agent.swc&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;automation.swc.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;The automation_agent_rb.swc must be located in the language folder in use in the locale folder. In the Flex SDK 3 version this file is already in place in the correct folder.&lt;br /&gt;&lt;br /&gt;The FunFX gem file must be installed locally on your computer. It does not exist in any public repository yet, so you must choose the local gem file located in the FunFX zip file.&lt;br /&gt;&lt;br /&gt;All the other files will be used when creating the Flex project, which I will begin explaining now. I will explain using Eclipse as the IDE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Creating a new Flex Project&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:78%;"&gt;The first thing is to create the Flex project of choice. Then you must add the AutomationGenricEnv.xml to the root path of the project or just add it directly to the bin catalog or the output folder of choice. The adapter uses this file to build the automation environment of all display objects.&lt;br /&gt;&lt;br /&gt;To be able to take advantage of the FunFXAdapter file you must add it as a compiler option as shown in the picture below. The adapter is relying on the files automation_agent.swc and the automation.swc files, and thus they must also be added as a compiler option.&lt;br /&gt;&lt;br /&gt;I have tried to add these swc files as swc files in the build path but this does not work. I am not really sure why this is, so if anybody has any comments on this fact please let me know.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_mTdUW2z519M/R0ARNjDIRcI/AAAAAAAAAA4/6X6XDjJtN68/s1600-h/Compiler.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_mTdUW2z519M/R0ARNjDIRcI/AAAAAAAAAA4/6X6XDjJtN68/s400/Compiler.png" alt="" id="BLOGGER_PHOTO_ID_5134122499646703042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now your application is ready to be tested. Remember to be consistent with giving all your display object uniq id's and the testing will be more efficient.&lt;br /&gt;&lt;br /&gt;At the end of this post it is an important notice I have to give, and that is about different versions of Flex SDK's. It seems that Flex projects does not like swc files that is compiled with different SDK versions. Due to this the precompiled versions of the FunFXAdapter.s that is supplied with the FunFX zip file might not work with your application (the version out now ,FunFX version 0.0.2 is compiled with Flex SDK version 3.0.0). If this happens download the source code and compile your own version.&lt;br /&gt;&lt;br /&gt;I hope this post will help you get started with FunFX, allthough I know I have not talked about how to write the actual tests. The next post will talk about how to write these tests with Ruby.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-5836648176289629348?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2007/11/funfx-getting-started.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_mTdUW2z519M/R0ARNjDIRcI/AAAAAAAAAA4/6X6XDjJtN68/s72-c/Compiler.png' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>94</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-6328204057526622177</guid><pubDate>Sat, 17 Nov 2007 20:58:00 +0000</pubDate><atom:updated>2007-11-17T14:35:48.462-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Ruby</category><category domain='http://www.blogger.com/atom/ns#'>Framework</category><category domain='http://www.blogger.com/atom/ns#'>Flex</category><category domain='http://www.blogger.com/atom/ns#'>Automated Functional Testing</category><category domain='http://www.blogger.com/atom/ns#'>FunFX</category><title>FunFX - The background</title><description>FunFX is a framework for funcional testing of Adobe Flex applications. This post will talk about the background for this tool and some on the implementation decisions.&lt;br /&gt;&lt;br /&gt;According to &lt;a href="http://en.wikipedia.org/wiki/Adobe_Flex"&gt;Wikipedia&lt;/a&gt;,&lt;b&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;Adobe Flex&lt;/b&gt; is a collection of technologies released by &lt;a href="http://en.wikipedia.org/wiki/Adobe_Systems" title="Adobe Systems"&gt;Adobe Systems&lt;/a&gt; for the development and deployment of cross platform, &lt;a href="http://en.wikipedia.org/wiki/Rich_Internet_application" title="Rich Internet application"&gt;rich Internet applications&lt;/a&gt; based on the proprietary &lt;a href="http://en.wikipedia.org/wiki/Adobe_Flash" title="Adobe Flash"&gt;Adobe Flash&lt;/a&gt; platform.&lt;br /&gt;&lt;br /&gt;FunFX was initiated by Bekk Consulting in desember 2006 as a master thesis at the Norwegian University of Science and Technology.  This was due to Flex's lack of a proper tool for automated functional testing. The only tool was Mercury's Quick Test Professional, which does not support TDD and cost a whole lot of money. We wanted to create an open source version that would support TDD.&lt;br /&gt;&lt;br /&gt;I began the work on this framework January 2007, and did not have a lot of experience with Flex. I decided to use Ruby as the language for the actual framework for writing the test scripts.&lt;br /&gt;&lt;br /&gt;The first initial problem and the most critical part of this framework was how to be able to talk to the Flex application and make it replay certain events.  After some starting tips from Matt Chotin, Sreenivas Ramaswamy, and Matt Horn from Adobe, I decided to use the &lt;a href="http://livedocs.adobe.com/flex/2/langref/flash/external/ExternalInterface.html"&gt;ExternalInterface&lt;/a&gt; API. This enabled me to expose certain "generic" methods out, enabling Ruby scripts to make calls into the Flex application.&lt;br /&gt;&lt;br /&gt;I built a Flex library file that acts as an adapter between a Flex application and the Ruby tests. The Ruby framework is dynamically built from an XML file delivered by Adobe that describes all the different display objecs and their events and properties. This makes it possible to write test lines as the following:&lt;br /&gt;&lt;br /&gt;@ie.button("name").click&lt;br /&gt;@ie.button("name").label&lt;br /&gt;&lt;br /&gt;When running the Ruby script the adapter will try to find a display object by the type button with the name "name" and run either the click event or delivering the lebel text of the button.&lt;br /&gt;&lt;br /&gt;The Ruby framework uses the &lt;a href="http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/classes/WIN32OLE.html"&gt;WIN32OLE&lt;/a&gt; to drive an Internet Explorer window and the Flex application displayed.&lt;br /&gt;&lt;br /&gt;There are currently no support for other browsers or to test a Flex application in the Flash player.&lt;br /&gt;&lt;br /&gt;The next post will help getting started with FunFX.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-6328204057526622177?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2007/11/funfx-background.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>23</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4025315227623560366.post-5734856846172092808</guid><pubDate>Sat, 17 Nov 2007 14:19:00 +0000</pubDate><atom:updated>2007-11-17T06:25:12.993-08:00</atom:updated><title>First post</title><description>Hi everybody! Aye, caramba, my first blog post ever.&lt;br /&gt;&lt;br /&gt;Thought I would begin to tell what kind of topic this blog will have. And it will primarily contain post about my work, I am a computer engineer from Norway. And more specific I will post topics surrounding my little project &lt;a href="http://rubyforge.org/projects/funfx/"&gt;FunFX&lt;/a&gt; that tries to enable automatical functional testing of Flex applications.&lt;br /&gt;&lt;br /&gt;But you might even see a post about my regular life also.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4025315227623560366-5734856846172092808?l=peternic.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://peternic.blogspot.com/2007/11/first-post.html</link><author>noreply@blogger.com (Peter Motzfeldt)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>