Integrating Flex Pilot with Robot Framework

184 views
Skip to first unread message

Pekka Klärck

unread,
Jun 21, 2010, 11:30:23 AM6/21/10
to flex-...@googlegroups.com, Janne Härkönen
Howdy Flex Pilots!

Janne (in Cc) and I are developers of a generic open source test
automation framework called Robot Framework [1]. One of the interface
specific test libraries that can be used with it is SeleniumLibrary
[2], and we are currently investigating how to extend it to Flex
testing. I learned about Flex Pilot when viewing demo videos from the
recent Selenium Testing Tools Demo Night [3] where also the
SeleniumLibrary was demoed. I also looked at some other open source
alternatives for Flex testing but FP looked most promising.

[1] http://robotframework.org
[2] http://code.google.com/p/robotframework-seleniumlibrary
[3] http://saucelabs.com/blog/index.php/2010/04/highlights-from-our-april-20th-selenium-testing-tools-demo-night

We today spent some time getting the Flex Pilot demo up and running.
We had zero Flex experience beforehand, our first step was downloading
the Flex SDK, but we were finally able to interact with the demo app
using JavaScript calling the Flex Pilot API [4]. This is, probably,
all we need because our plan is to extend the SeleniumLibrary with new
keywords that wrap this API pretty much directly.

[4] http://wiki.github.com/mde/flex-pilot/api

We did, however, encounter problems when trying to build a simple demo
ourselves. Building the flex app itself worked fine, but even though
we added the required bootstrap code we weren't able to interact with
the app via FP. After fighting with our app for some time we tried to
compile the original flex demo ourselves. Again compilation succeeded
and the application worked but we weren't able to interact with it.

Overall integrating Flex Pilot with the SeleniumLibrary and Robot
Framework looks very promising, but some pieces are still missing
before we can create a real proof-of-concept demo. This is where I
hope you guys on this list could help:

1) Is FP compatible with Flex 4 what we used? Should we use Flex 3 instead?

2) Is Linux, our preferred development platform, supported out-of-the-box?

3) How, exactly, should the application be compiled to link it with
FP? We tried first having both FlexPilot.swf and FPBootstrap.swf in
the same directory as our app and running `mxmlc TheDemo.mxml`. That
failed in bootstrap on line with `FPBootstrap.flex_pilotLibPath =
'FlexPilot.swf';` and the error message told that FPBootstrap didn't
exist. After this we cloned the GitHub tip and added `src` under it
into source path and were able to compile and run the application. As
I already wrote above, communicating with the app via FP still didn't
work.

4) Can you foresee any problems integrating FP with the
SeleniumLibrary this way? Any additional suggestions on how to make
the integration work smoothly?

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Adam Christian

unread,
Jun 21, 2010, 1:07:16 PM6/21/10
to flex-...@googlegroups.com, Janne Härkönen
Greetings,

So I am still trying to come up with the most precise set of instructions to get things up and running with flexpilot.

The cases where I have seen the most success is where people download the source tree, then import the boot loader and specify the src path on the command line as we do in our build.py scripts.

Then you can download the .swf and put it in the same directory as your app and the boot loader should load it.

A surprisingly high percentage of users have been successful doing it this way so far.

I am curious if there is a way I could build a swc or a pre-build binary form of the boot loader so that one could download the swc and swf files, import the swc and be done with it.

I'm really excited to hear that you are working to integrate, I have written hooks for selenium ide and windmill and would love to do whatever I can to get integration with robot.

I'm investigating the binary idea, but please let me know how I can improve the setup documentation in the meantime, to keep you unblocked!

Thanks,

Adam

2010/6/21 Pekka Klärck <pe...@iki.fi>

Pekka Klärck

unread,
Jun 21, 2010, 5:31:27 PM6/21/10
to flex-...@googlegroups.com, Janne Härkönen
Hi all,

2010/6/21 Adam Christian <adam.ch...@gmail.com>:


> Greetings,
> So I am still trying to come up with the most precise set of instructions to
> get things up and running with flexpilot.

At least for people with programming background, the best approach is
probably extending the current demo with more detailed explanations on
how to build it yourself.

> The cases where I have seen the most success is where people download the
> source tree, then import the boot loader and specify the src path on the
> command line as we do in our build.py scripts.
> Then you can download the .swf and put it in the same directory as your app
> and the boot loader should load it.
> A surprisingly high percentage of users have been successful doing it this
> way so far.

Thanks for these instructions. We'll try them out and report back how
things worked out.

> I am curious if there is a way I could build a swc or a pre-build binary
> form of the boot loader so that one could download the swc and swf files,
> import the swc and be done with it.

This would be awesome.

> I'm really excited to hear that you are working to integrate, I have written
> hooks for selenium ide and windmill and would love to do whatever I can to
> get integration with robot.

Nice to hear! I felt fairly positive on this already before but if you
can help if/when we get stuck I'm sure we can make the integration
work.

> I'm investigating the binary idea, but please let me know how I can improve
> the setup documentation in the meantime, to keep you unblocked!

I already mentioned enhancing the current demo with "how-to build
yourself" instructions. Other things we found missing were 1) which
Flex versions are supported, 2) which OSes are supported, and 3) is a
web server needed or is it enough to open the swf to browser as a
local file. At least we needed to have a web server to get the demo
running, and if that's a real requirement and not user error,
providing a simple web server might be a good idea. We can even
provide you a _very_ simple Python web server if you want.

Adam Christian

unread,
Jun 21, 2010, 5:45:04 PM6/21/10
to flex-...@googlegroups.com, Janne Härkönen
I'll put your recommended documentation on my list!

The SWF must be served from a web server, I am suggesting 'python -m SimpleHTTPServer' for development purposes, works great for me.

Adam

2010/6/21 Pekka Klärck <pe...@iki.fi>
Hi all,

Pekka Klärck

unread,
Jun 21, 2010, 5:54:50 PM6/21/10
to flex-...@googlegroups.com, Janne Härkönen
2010/6/22 Adam Christian <adam.ch...@gmail.com>:

> I'll put your recommended documentation on my list!

Great!

> The SWF must be served from a web server, I am suggesting 'python -m
> SimpleHTTPServer' for development purposes, works great for me.

This is pretty much what our super simple web server for
SeleniumLibrary testing purposes does. Mentioning this, and similar
ruby etc. equivalents in the docs is probably a good idea too.

Cheers,
.peke

Adam Christian

unread,
Jun 22, 2010, 9:10:14 PM6/22/10
to flex-...@googlegroups.com
Greetings, I just did some doco work, please let me know what you think:


Adam

2010/6/21 Pekka Klärck <pe...@iki.fi>
2010/6/22 Adam Christian <adam.ch...@gmail.com>:

Pekka Klärck

unread,
Jun 25, 2010, 4:20:21 AM6/25/10
to flex-...@googlegroups.com
2010/6/23 Adam Christian <adam.ch...@gmail.com>:

> Greetings, I just did some doco work, please let me know what you think:
> http://wiki.github.com/mde/flex-pilot/getting-started

I briefly looked at the new docs and liked them and the new demo a
lot. Here in Finland we have midsummer celebration this weekend, but
I'll try the new instructions and the new demo next week.

Thanks!

Pekka Klärck

unread,
Jul 17, 2010, 10:23:00 AM7/17/10
to flex-...@googlegroups.com
2010/6/23 Adam Christian <adam.ch...@gmail.com>:

> Greetings, I just did some doco work, please let me know what you think:
> http://wiki.github.com/mde/flex-pilot/getting-started

Summer holiday has kept me busy but I finally had time to look at this
again. I was able to get the demo running based on these instructions.
Yay! Things that caused some problems, and perhaps should be noted in
the documentation, are listed below:

1) Flex 3 SDK is needed. I tried first with Flex 4 but compiling Flex
Store failed with cryptic error messages.
2) Also beige.css and blue.css needs to be compiled. The docs mention
only flexstore.mxml.

Now that I have the demo running, and can use Selenium IDE + Flex
Pilot to test it, I can start with the actual Robot Framework
SeleniumLibrary integration. I probably won't have time for that today
but I'll keep you posted.

Adam Christian

unread,
Jul 19, 2010, 2:10:30 PM7/19/10
to flex-...@googlegroups.com
So cool, thanks for all your work! Let me know how it goes.

Adam

Pekka Klärck

unread,
Aug 5, 2010, 8:29:35 AM8/5/10
to flex-...@googlegroups.com, Janne Härkönen
Hello all,

Here's an update on how integrating Flex Pilot with Robot Framework's
SeleniumLibrary is proceeding. In short, things are looking pretty
good.

I did some prototyping during holidays and yesterday I created a
flex-pilot branch to SeleniumLibrary with my colleague Janne (in Cc).
The current code is still pretty much on prototype level but at least
we got something that works. What we did was following:

1) We created a very simple demo application with the required Flex
Pilot bootstrap.

2) Copied user-extensions.js from flex-pilot-x project to allow
testing via Selenium RC. We did few simple changes to it to make it
work with Firefox 3.6 and to hide the injected bridge component. If
you are interested to incorporate the changes back, we can submit a
patch somewhere or you can view these diffs:
http://code.google.com/p/robotframework-seleniumlibrary/source/list?path=/src/SeleniumLibrary/lib/user-extensions.js&r=1dfc617e8d2f08a77185c87454f8033316524e37

3) Implemented few Flex keywords to SeleniumLibrary based on the
selenium.py distributed with flex-pilot-x. We decided not to use this
selenium.py directly, because we have fix for a socket leak that
occurs on Jython in our version
(http://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=79).
The current code is here:
http://code.google.com/p/robotframework-seleniumlibrary/source/browse/src/SeleniumLibrary/flex.py?r=2e8ee6aefbb70da97ab6ee62ee78459aecda8734

4) Created very simple example test case that interacts with the demo app.

Does this approach good from Flex Pilot point of view? If someone is
interested to test the current prototype, you can follow the steps
below. We'll continue this work next week and ought to have better
demo with much better example tests and instructions done then.

0) Install Robot Framework
1) Clone the SeleniumLibrary repository (hg clone
https://robotframework-seleniumlibrary.googlecode.com/hg/
seleniumlibrary) and switch to flex-pilot branch (hg branch
flex-pilot).
2) Go to `test/resources/html/flex` directory and run `python -m
SimpleHTTPServer`. You should have the demo app available in
http://localhost:8000/Hello.html afterwards.
3) Execute the example test by running the following command in the
SeleniumLibrary root directory (or update the paths accordingly if you
run it elsewhere):
pybot --pythonpath src test/resources/html/flex/flex_tests.txt

All kind of comments and questions are welcome!

Adam Christian

unread,
Aug 7, 2010, 3:14:52 AM8/7/10
to flex-...@googlegroups.com
Hi Pekka,

I finally got a chance to play with this stuff and have it up and running! Very cool stuff, I am also going to take your update to the user-extensions.js file to hide the bridge for the next release.

Do you have any intention of writing a blog post? I would certainly love to have something that I could point people at when they email me asking how to do this.

I just merged a bunch of code up last night support data grids and sliders etc from Mahesh, so if you find that functionality interesting you may want to check it out.

Keep up the great work!

Adam

2010/8/5 Pekka Klärck <pe...@iki.fi>

Pekka Klärck

unread,
Aug 10, 2010, 8:05:29 AM8/10/10
to flex-...@googlegroups.com
2010/8/7 Adam Christian <adam.ch...@gmail.com>:

> Hi Pekka,
> I finally got a chance to play with this stuff and have it up and running!

Great! Very good to hear that it works also on someone else's machine.

> Very cool stuff, I am also going to take your update to the
> user-extensions.js file to hide the bridge for the next release.

Cool, I hope you can include the simple Firefox 3.6 fix too [1]. Do
you announce new versions here or should we just keep an eye on the
repository?

[1] http://code.google.com/p/robotframework-seleniumlibrary/source/detail?r=524237f21c7b8c6a8a2152706c784a722114c2b3

> Do you have any intention of writing a blog post? I would certainly love to
> have something that I could point people at when they email me asking how to
> do this.

We are going to document all this after the code is a bit more ready.
In addition to documenting how to set up everything and use the
provided keywords, I'm thinking about creating a demo like there is
for SeleniumLibrary itself [2].

[2] http://code.google.com/p/robotframework-seleniumlibrary/wiki/Demo

> I just merged a bunch of code up last night support data grids and sliders
> etc from Mahesh, so if you find that functionality interesting you may want
> to check it out.

Great to see the project is going forward. We'll definitely grab the
latest user-extensions.js version.

> Keep up the great work!

Thanks, same to you!

Reply all
Reply to author
Forward
0 new messages