rsrini7 / flexmonkey

Automatically exported from code.google.com/p/flexmonkey
0 stars 0 forks source link

Focus bug (HaloFocusRect) because of AirMonkeyLibrary.swc on build path #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
==================================
FlexMonkey Use Cases:

1) App under test and MonkeyAgent on remote server?

If you use the MonkeyAgent, are you running it in the FlexBuilder Debugger?
Yes and No, doesn't make a difference
==================================

What steps will reproduce the problem?
1. Download the attachment to this issue (it's a Flex Builder project) and
import in Flex Builder
2. Run the main file
3. Leave the browser window (to trigger a focusOut on the textfield)

What is the expected output? What do you see instead?

I expect this to not give an error, but it does.
Following error is throw when you leave the screen (focusOut on TextInput):
TypeError: Error #2007: Parameter blendMode must be non-null.
    at flash.display::DisplayObject/set blendMode()
    at
mx.skins.halo::HaloFocusRect/updateDisplayList()[C:\autobuild\3.2.0\frameworks\p
rojects\framework\src\mx\skins\halo\HaloFocusRect.as:156]
    at
mx.skins::ProgrammaticSkin/validateDisplayList()[C:\autobuild\3.3.0\frameworks\p
rojects\framework\src\mx\skins\ProgrammaticSkin.as:421]
    at
mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.3.0\frameworks\p
rojects\framework\src\mx\managers\LayoutManager.as:622]
    at
mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.3.0\frameworks
\projects\framework\src\mx\managers\LayoutManager.as:695]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at
mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.3.0\frameworks\projec
ts\framework\src\mx\core\UIComponent.as:8633]
    at
mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.3.0\frameworks\project
s\framework\src\mx\core\UIComponent.as:8573]

What version of the Flex SDK are you using?

Flex SDK 3.2.0

What version of the FlexMonkey are you using?

FlexMonkey 1.0 Beta 1, but the problem here is located in the AirMonkeyLibrary

What version of the MonkeyAgent are you using? (if applicable)
From MonkeyAccessoriesR1b1a (but again, even not used in the attachment)

On what operating system?
Windows XP Professional

I got the above error when using FlexMonkey and the MonkeyAgent to test a
Flex application.
To track down the cause, I minimalized the app and eventually it came down
to an app similar to the one that's attached.

The moment I put the AirMonkeyLibrary.swc in the lib folder (and thus on
the build path + clean project) I get the error. If I remove it from the
buildpath: everything works fine.

I tracked the problem to the following functions:
- HaloFocusRect set styleName()
- UIComponent drawFocus()
Apparently, when I put the AirMonkeyLibrary on the lib path and I debug
into UIComponent.drawFocus() (from the "else if (hasFocusRect)" statement)
on) some other code seems to be running if I step through the code. That
is, the "set styleName()" property is set of the "focusObj" with value
null. On the next validateDislayList of the HaloFocusRect, it's _styleName
will be null and so no "focusBlendMode" and as such the error (from above)
is thrown.
This "setting" of styleName on the HaloFocusRect isn't however in the
UIComponent source code (Flex 3.2.0)!! Though it appears to run (if
AirMonkeyLibrary is on lib path + clean project). I found out this kind of
code only appears in UIComponent in Flex SDK 3.3.0...
If no AirMonkeyLibrary on lib path, all works fine and when debugging, code
in drawFocus() as denoted in UIComponent source (Flex 3.2.0) is executed.

Question is: how is it possible that other UIComponent code runs when the
little test app is compiled with AirMonkeyLibrary in the /lib dir?

Does the Flex 3.3 code runs in some way?
Some mixin stuff?

Because of this error, we cannot use FlexMonkey to create test for our
application.

Thanks in advance!

Original issue reported on code.google.com by steven.r...@gmail.com on 28 Jul 2009 at 2:00

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Steven:

FlexMonkey and the MonkeyAgent are compiled with SDK 3.3.  When either loads 
your application.swf, it loads into a child domain of the monkey's 
ApplicationDomain.  This means that your application will use any Class 
definitions that have already been loaded by the monkey, which are 3.3 
definitions.

For more info on loading swf's, see: 
http://livedocs.adobe.com/flex/gumbo/html/WS2db454920e96a9e51e63e3d11c0bf619ab-7
fe2.html
(While this is a Flex 4 doc, it's the best to date from Adobe on this topic)

We have some constraints imposed by the Adobe Flex 3 Automation system when 
loading your application, so we can't load your app into a sibling 
domain and as a result, your 3.2 definitions get clobbered.

 Your options are

1) upgrade your project to 3.3 to be compatible with FlexMonkey binaries.
2) compile the MonkeyAgent from source with 3.2.  Note that to do this build 
from source, you'll need a FlexBuilder Pro license, because you'll 
need the Automation libraries. If you take this route, you should also 
recompile the libraries MonkeyAgent depends on:

AirMonkeyLibrary
FlexAutomationLib
aqadaptor
MonkeyGIF
MonkeyRegistrationLibrary

These are all FlexBuilder projects you can download from 

http://code.google.com/p/flexmonkey/source/checkout

In the near future, you will have a third option, to use the MonkeyLink, which 
is a version of the MonkeyAgent that you compile into your 
application, and as a result, there is no SWF loading.

Cheers,
Eric

Original comment by eric.owe...@gtempaccount.com on 28 Jul 2009 at 2:44

GoogleCodeExporter commented 9 years ago
Ok, it's like that.
I will take a look at the 2 options.

Anyway: thanks very much for the quick answer!!
Let's hope we can start behaving like monkeys soon ;-)

Original comment by steven.r...@gmail.com on 28 Jul 2009 at 3:29

GoogleCodeExporter commented 9 years ago
Hi Eric,

I tried the second solution, as I don't want to upgrade immediately to 3.3.
But that didn't work. Debugging still shows me UIComponent from SDK 3.3 that's 
running.

I checked out the projects you listed above in Flex Builder and as my default 
SDK is
3.2, all of them build nice against it. I ran the resulting MonkeyAgent.html in 
the
browser and with my app set in FlexMonkey, I got the same error..

Original comment by steven.r...@gmail.com on 3 Aug 2009 at 11:44

GoogleCodeExporter commented 9 years ago
Ok, I found the guilty one.
It's the FlexSpy.swc library in the /libs folder of AirMonkeyLibrary.
That one contains a UIComponent, version 3.3. That is, the FlexSpy project is
propably compiled against 3.3 and all framework classes are taken along in swc.
Strange thing is, if I download and inspect one of the downloads on their 
Google code
project, then they all look as compiled against 3.2.0.
Did you guys compile the FlexSpy yourselfs in any way (against a 3.3)?

I've put a latest FlexSpy.swc, version 1.3,  on the lib of the AirMonkeyLibrary
project, did a clean and now everything works fine.

Do you guys change your dependency on the latest FlexSpy then?

Thanks!

Original comment by steven.r...@gmail.com on 3 Aug 2009 at 2:30

GoogleCodeExporter commented 9 years ago
Hi all,

There seems to be an implication that MonkeyLink should not have this issue, 
but I 
encountered the same error whilst integrating my project with MonkeyLink (by 
following the instructions as suggested in the user guide).

I tried recompiling and cleaning all the projects mentioned above including 
FlexSpy. 
However, I still have the same error popping up. Are there any ways I can 
verify 
each of the libraries to ensure it's compatible with v3.3 SDK?

Would there be any other causes that would lead to this problem?

Thanks!

Original comment by jeffwo...@gmail.com on 10 Sep 2009 at 10:08

GoogleCodeExporter commented 9 years ago
I've had the same experience as JeffWoo87, I have encountered this error using 
MonkeyLink.  So far I have tried:

- The same action in the normal non-FlexMonkey build, it works fine.  So the 
problem 
has to do with FlexMonkey.

- Recompiled all the FlexMonkey libraries in Flex 3.2, no change
- Upgraded FlexSpy to the latest version; no change.

Has anyone else had this problem with MonkeyLink?  Any clever solutions?

My next step will be to recompile FlexMonkey and all of its dependent libraries 
(like FlexSpy) in 3.2.

Original comment by puzzle...@gmail.com on 23 Oct 2009 at 4:36

GoogleCodeExporter commented 9 years ago
Hi puzzle123,

I solved the issue by downloading ALL dependent libraries' source code and 
recompiled every one of them using 3.2 SDK. 

I'm afraid Flex doesn't have any cross-version verification at compile time to 
check 
for compatibility issues. I find that as long as your dependencies are at an 
older 
version, generally it should be fine. 

Good luck!

Original comment by jeffwo...@gmail.com on 23 Oct 2009 at 5:34

GoogleCodeExporter commented 9 years ago
Also wanted to add that is this unclean environment with mixed SDK version 
situation 
caused my application to have empty popup alertboxes / messagedialogs showing 
up at 
random locations. This happened to me with other automation tools too. The 
issue 
stopped appearing after I performed the recompilation. 

Original comment by jeffwo...@gmail.com on 23 Oct 2009 at 5:37

GoogleCodeExporter commented 9 years ago
Thanks Jeff, any chance you could zip up your 3.2 version of FlexMonkey and 
just 
email it to me?  My email is puzzle123 at gmail.  If not, no worries, I'll do 
it, it 
would just speed things up.   Many thanks.

Original comment by puzzle...@gmail.com on 27 Oct 2009 at 12:31

GoogleCodeExporter commented 9 years ago
Sadly, we have given up on flexmonkey and I deleted all the files. So I can't 
send 
you anything now.

Original comment by jeffwo...@gmail.com on 27 Oct 2009 at 1:35

GoogleCodeExporter commented 9 years ago
Thanks Jeff, if you have time to let me know what you switched to, could you 
write 
me by email?  My email is puzzle123 at gmail.  If not, thanks anyway.  Best, 
Sanford.

Original comment by puzzle...@gmail.com on 27 Oct 2009 at 5:53

GoogleCodeExporter commented 9 years ago
Hi Guys,
I have the same problem.
We want to use FM to test our flex app.
We use MonkeyAgent (compiled local with Flex 3.0) on our 3.0 app.
Same error "Parameter blendMode must be non-null" with all stack trace of the 
above post.
Can you please help?
Thanks,
Kobi.

Original comment by kobi.s...@gmail.com on 30 Nov 2009 at 1:07