How to handle Flex grid with selenium web driver?
Right now I am using sikuli api (image processing) but it is not a good solution. if you have solution for it please give step wise answer which you have tested.
In order to be able to automate a flex application you need to add instrumentation features to your compiled SWF. This can usually be done using a loader application, that applies the instrumentation, or you compile this in to the application you are intending to automate. The webdriver then communicates with these automation-stubs and is able to take full control of the application.
Here is a description of the general Automation concepts:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ec5.html
This article should explain the actual steps needed for Selenium2 with Webdriver:
http://www.blackpepper.co.uk/driving-a-flex-application-via-selenium-2-webdriver/
Handling flex grid in selenium is not a simple task, After some research, this task has been done successfully , Although selenium is providing SeleniumFlexAPI API by which you can perform actions in flex grid.
These are the steps which we need to follow:
you have to download selenium flex API .
you will get a SeleniumFlexAPI.swc file here.
a. you need to put this file in your flex application (In the repository or in your project libs folder).
b. you need to add lib path in flex compiler like this and compile the code
-include-libraries "libs\SeleniumFlexAPI.swc"
Source with Example
Related
can any one help me that where is the SWC or run time library for the flex controls exist in the system?
Or can we provide our own library by using the controls in the dir
C:\Program Files\Adobe\flex_sdk_3.2\frameworks\projects\framework\src\mx
It is not very obvious what are you trying to ask but I'll try to guess :)
So the SWC with Flex controls is located here {Flex.SDK.root}/frameworks/libs/framework.swc and the corresponding RSLs are located here {Flex.SDK.root}/frameworks/rsls.
What about providing your own library to replace Flex controls I think it is not the right way. The best practice is not modify Flex SDK installation to have possibility to build your project on every computer with different environments (on a different developers computers or on client site).
And you should take in mind there are 4 standard ways to use code in Flash application:
Compile your code into SWF.
Use Runtime Shared Library aka RSL (which is SWF too).
Use SWZ which is signed and can be cached by Flash Player.
Use modules which are SWFs.
None of these ways doesn't suppose using Flex SDK in runtime. Flex SDK is being used only in process of building of your application.
So the best way to use some custom controls is to build them with your application using one of the ways I described above (excluding SWZ's which can be produced only by Adobe).
Just leave Flex SDK installation without changes and place classes/SWCs with custom controls in your project's classpath.
Hope this helps.
We have a Adobe AIR desktop client which talks to a WAMP server. How can i convert this AIR app to a Flex app to be used in the browser.
Please let me know.
Thanks
vish.
I would create a new empty Flex application and copy your files into that project. Then move any code in your main app component (which is derived from WindowedApplication) into the main app component in your new project (which is derived from Application). You'll also have to go through your app and determine which components are used that are specific to AIR and rework them to use other Flex components (the compiler will complain if you don't). This should give you a good start.
I would move everything into a Flex library project. Then have an AIR project as well as a Flex app project which accesses the common code in the Flex Library project. This way you don't have to maintain two different codebases for common code and you can also have code which is specific to each version.
I have a flex application build with actionscript 3 on flex builder with unit testing on it using flexUnit4. I want to build this project on my cruise control and i don't know how?
The easiest way is to have AIR installed so it can write directly to the file system, although there are other ways. From there, your buildbot can examine the output programmatically and pass or fail as desired. See the description on the Digital Dump Truck blog post for one such method.
Would this blog post be useful?
http://www.aaronspjut.com/mind/index.php/2009/05/23/continuous-integration-with-flex-3-cruisecontrolrb-and-flexunit4/
Sorry for the lack of information from me, I am not familiar with cruise-control.
Thanks Guys for the help,
Finally i managed to run flex on CI which generate my test results in html file. What i actually have to do is create a build.xml file which can run with ant. Build file has path to all the libraries of flex unit installed on pc or CC unit and the path to main file in your application. To build our project on Cruise Control you just need to edit the build.bat file on your CC.
For a normal Flash/Flex application I would include my Unit Tests in my application project (perhaps in a tests source folder alongside my main src folder). I'd then have two application entry points: the app, and it's tests.
How are people doing this for their Flex Library Projects? You know, the kind that produces a SWC file. As far as I can tell, you can't set an executable entry-point for these projects (to run the tests).
Normally, Flash Builder only allows you to use the debugger from a Flex/AIR application, not a library project. So best thing to do here is load the library into a Flex application and write+debug tests there.
Here are step-by-step instructions to be able to test your library project, with debugging/stepping enabled:
Create a Flex Library project that you want to test + debug
Create a normal, empty Flex Application. We will write the tests in this dummy Flex Application so we can utilise the debugging features.
Set the library's build-path to the 'libs' folder of the Flex Application so it builds most recent code into a swc loaded by the Flex Application.
Optionally, set the
Flex Application to 'reference'
the library project in Project
Properties->Project References, this
ensures the library code is built first.
Write your tests in the Flex
Application
Debug and run your tests: you
should be able to step through your library
source code! Nice.
Optionally, once you're satisfied your tests are all good
copy your tests back into the
library project to keep all the library's associated code together in one project. Make sure you're not including the test classes in the actual library swc.
This is how I do it anyway.
If we assume that you need an mx:Application entry point to run the unit tests, then it would seem to make sense to generate a separate application project solely to run the tests.
Would you really want to include the unit tests in the compiled SWC anyway? (For an application this wouldn't be a problem since they're, presumably, not referenced, but for a SWC library I think they'd be compiled in if they're in the folder hierarchy somewhere)
In Flash Builder Beta 1 onwards itself, you can write and execute Flexunit tests from a library project.
You can use the IDE integration feauture of FlexUnit, and select the project, folder , class or method from the context menu and use "Execute Flex Unit Tests". This will create the application file of the required syntax, run the application and show the results in the FB. You can even select from the result and run the tests are requried.
There isn't currently a way to test a library project. You must have an application as the entry point to the tests. This would be a great feature request for Flash Builder 4.
I'm using Flexbuilder as an IDE, and I'm working on automating the process of building my application.
In the process of setting up the ant build file, I noticed that there's no way to call the project using the list of dependancies that Flex builder stores - each library or library project has to be added to the flex compiler commands manually. This creates an enormous burden on the developers to update the build scripts, and makes the build process very uncomfortably fragile.
Is there an option or third party project that addresses this? Failing that, is it possible to build using Flex builder's process via command line?
This answer might be of use.
automating component libraries