Friday, January 30, 2009

FunFX 0.2.2 released on Rubyforge

Hi everybody.

Again I am so sorry that I have not updeted this blog.

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

Please just edit the page and add what ever you find missing or is nice to know for the next person.

To install FunFX: gem install funfx :-)


Kaustubh said...

'Getting the Flex application ready for testing' in

Can you please add details for 'how to get ready with flex app with the regular Flex compiler either with Flex Builder or the command line Flex compiler?'

Are we using same old 'AutomationGenricEnv.xml' or the new 'AutoQuickEnv.xml' for new version of funfx?

Peter Motzfeldt said...

Hi, sorry for this extremely late response.

I have updated the wiki now. And for you question about the xml file, it is now compiled into the funfx swc file, so you do not need to think about it.

But I have realised that we should be able to use a custom xml file if one wants to, because of custom components.

taho said...

How can we define custom components without the AutomationGenericEnv.xml ?

Thanks a lot for your work and your answer.


Peter Motzfeldt said...

Hi, I am currently trying to do a fix for that. I am making it so that you can choose by a specific flashvar if you want to use your own custom xml file.

It is out on github, but will document it soon.

taho said...


Great! Thanks for your anwser.

I will try to figure it out from github.

Please keep up the good work.

Ralf Bokelberg (rbokel) said...

Trying to run it from Vista with Firefox i get the following error. Any pointers would be very much appreciated.


dencies.rb:443:in `load_missing_constant': uninitialized constant Element (NameE
from C:/apps/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_
support/dependencies.rb:80:in `const_missing'
from C:/apps/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_
support/dependencies.rb:92:in `const_missing'
from C:/apps/ruby/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx/browser/f
from C:/apps/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:i
n `gem_original_require'
from C:/apps/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:i
n `require'
from C:/workspace/fb-3.0.1/ds/TestFunFx/build/run-test.rb:2

Ralf Bokelberg (rbokel) said...

Ok, i think i found waht was missing.
1. The test script was missing a include FireWatir statement
2. in browser/firewatir.rb you need to replace DOCUMENT_VAR with the lowercase version of it

I'm a ruby beginner and found this by try and error, so bear with me, if it is not the correct way.

XeandeR said...

Hi all,
I am a newbie to flash and watir . I followed your instructions as per the url:

require 'funfx'
require 'funfx/browser/firewatir'

@flex_app = BROWSER.flex_app('FlexTest', 'FlexTest')

#@flex_app.button(:automationName => 'Buttton').click
@flex_app.button(:id => 'a3120').click

Now when i run this watir script, browser opens , but the button click (or any other actions)doesn't happen. No errors are thrown also(The id and automationName was found out using the Adobe spy that will be shown down in the FF browser.)

I am using the following:
Firefox 3.5.6, JSSH 1.0 plugin, funfx-0.2.2.swc, Flex builder process (not FunFX with Maven)

Please help . Thanks in advance

stepu said...

I have identical problem as Ralf Bokelberg, when i change DOCUMENT_VAR with the lowercase version. All runs without errors, browser opens, but no action on page.
I try with windows and linux.

AbhishekSreepal said...

Hi Ralf Bokelberg (rbokel)

There is one more change we need to make in browser\firewatir.rb file

class FlexApp < ::Element should be changed to Class FlexApp < FunFX::Flex::Element

AbhishekSreepal said...


When i change ::Element ->Element and DOCUMENT_VAR to lower case.

Everything runs without errors but with no action i.e button is not clicked.

Maxim said...

Hi All,

What do you need to fix "DOCUMENT_VAR" ?
First step here is to use firewatir 1.6.2.If this does not help you will need to edit funfx\browser\firewatir.rb. Add "include FireWatir::Container" to the FlexApp class:
class FlexApp # < ::Element #:nodoc:
include FunFX::Flex::Elements
include FunFX::Flex::FlexAppId
include FireWatir::Container

lemuel said...

Hi All,

I followed this tutorial at There are no issues in Safari Browser, it ran smoothly. But when I use Firefox, it throws an error. It looks like it could not communicate well with the Firefox. Here is the error:

Feature: Counter
In order to count something
As a flex rock star
I want to use my great flex app

Scenario: Increment index # feature/counter.feature:6
/Library/Ruby/Gems/1.8/gems/firewatir-1.6.2/lib/firewatir/firefox.rb:158: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Given I open my flex app # feature/step_definitions/counter_steps.rb:1
And I click the increment button # feature/step_definitions/counter_steps.rb:5
Then the label text should be "1" # feature/step_definitions/counter_steps.rb:9
expected: "1",
got: "Error: NPMethod called on non-NPObject wrapped JSObject!" (using ==)

@@ -1,2 +1,2 @@
+Error: NPMethod called on non-NPObject wrapped JSObject!
./feature/step_definitions/counter_steps.rb:10:in `/^the label text should be "([^\"]*)"$/'
feature/counter.feature:9:in `Then the label text should be "1"'
When I click the decrement button # feature/step_definitions/counter_steps.rb:5
Then the label text should be "0" # feature/step_definitions/counter_steps.rb:9
When I click the decrement button # feature/step_definitions/counter_steps.rb:5
Then the label text should be "-1" # feature/step_definitions/counter_steps.rb:9
And I enter admin in the textinput # feature/step_definitions/counter_steps.rb:13
Then I click the login button # feature/step_definitions/counter_steps.rb:17

Failing Scenarios:
cucumber feature/counter.feature:6 # Scenario: Increment index

1 scenario (1 failed)
9 steps (1 failed, 6 skipped, 2 passed)

I'm using Firefox 3.6.6, Firewatir 1.6.2, FunFx 0.2.2

Thanks for the help.

Lyle W. Anderson said...

I am having the same problem as lemuel.

I'm using Firefox 3.5.11, Firewatir 1.6.2, FunFx 0.2.2 with the mods suggested in previous posts (adding 'include FireWatir::Container', ::Element -> Element).

Any progress on this?

$ telnet localhost 9997
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Welcome to the Mozilla JavaScript Shell!
> var window=getWindows()[0];
> var browser=window.getBrowser();
> browser.loadURI("http://localhost:3000")
> var document=browser.contentDocument
> var flex_app=document.getElementById('fc_converter_id')
> var from=flex_app.getFunFXPropertyValue('text_input','fahrenheit')
Error: NPMethod called on non-NPObject wrapped JSObject!
> ^]
telnet> quit
Connection closed.

Neela said...

Hi Peter,

This is Neela Shyam. Using 0.2.2 version.
For combo box:-
when given as flex.combo_box(:id,'qCurrency').select '€'

`build_flex_locator': undefined method `keys' for :id:Symbol (NoMethodError)

when given as flex.combo_box(:id => 'qCurrency').select '€'
says - `method_missing': wrong number of arguments (1 for 2) (ArgumentError)

For link_button it says FunFX:Flex::Elements::FlexLinkButton (NameError) - in elements.rb file link_button is not available.

Struggling a lot in order to identify the elements and trigger them.

With 0.2.2 flexSpy and record options are coming, when try to record link_button it works there. Where as in code it's not working.

Please help me out.

code snippet:-
browser =
flex = browser.flex_app('app','app')

flex.link_button({:id => 'nextPage', :automationName => 'Next >', :automationIndex => 'index:11', :automationValue => 'Next >'}).click('0')
flex.combo_box(:id,'qCurrency').select '€'

Neela said...

Gem list:-
*** LOCAL GEMS ***

activesupport (2.3.9)
builder (3.0.0)
commonwatir (1.7.1, 1.6.2)
fastercsv (1.5.4)
firewatir (1.7.1)
funfx (0.2.2)
hoe (2.9.1)
nokogiri ( x86-mingw32
rake (0.8.7)
rubygems-update (1.5.2)
s4t-utils (1.0.4)
user-choices (
watir (1.7.1)
win32-api (1.4.8 x86-mingw32)
win32-process (0.6.5)
windows-api (0.4.0)
windows-pr (1.1.3)
xml-simple (1.0.14)

Neela said...

Even tried with

@flex.text_input({:id => 'tTestInput'}).input('Test')

still gives me this error
C:/Ruby187/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx\browser\firewatir.rb:25:in `method_missing': wrong number of arguments (1 for 2) (ArgumentErro
from C:/Ruby187/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx\browser\firewatir.rb:25:in `fire_event'
from C:/Ruby187/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx/flex/element.rb:27:in `fire_event'
from C:/Ruby187/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx/flex/element.rb:55:in `flex_invoke'
from C:/Ruby187/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx/flex/element.rb:26:in `fire_event'
from C:/Ruby187/lib/ruby/gems/1.8/gems/funfx-0.2.2/lib/funfx/flex/elements.rb:755:in `input'
from ./TestFirst.rb:56:in `testFlex'
from C:/coding/watir/firstTest.rb:4