Problem with Flex unit testing in IntelliJ - apache-flex

I have some problems running FlexUnit tests in IntelliJ.
Every time I execute test, Internet Explorer (which is not even set as default browser) pops up and blocks unit test, i.e. blocks it as add so I must allow access through that dumb top bar and then another confirmation and then finally test runs. Is there any way to reconfigure it to another browser or to run it some other way so I just hit the Run button on Idea and I can see results right away?
Thank you for help

As you are using Windows have a look at the first comment by Alexander Doroshko in this bug report: http://youtrack.jetbrains.net/issue/IDEA-49795
Current behavior:
if 'Use system default browser' is selected at Settings | Web Browsers | Default Web Browser then swf/html is started in default OS application (either default browser of standalone Flash player)
if default browser is overridden in IDEA then it is always used both for swf/html.
It would be more convenient if standalone Flash player is used for swfs independently of this setting as soon as it is OS default program for sfws.
I recommend to configure the stand alone flashplayer executable for executing unit tests. As you can also see from the report this has been improved in IDEA 10.

Related

Ghost Inspector tests are failing on running

I record test using Ghost Inspector on a website. But when I run the test in Ghost Inspector, one of the buttons is always greyed (only in the test run), and the test fails. Not sure why this is happening. When I record the button is not greyed.
This is the console output in Ghost Inspector:
1788:23079 Uncaught Error: Error in attempt to create DIL instance
with DIL.c…pendency for DIL v8.0+: Invalid Visitor instance.
The same test if recorder and playback using Selenium IDE runs fine
I also tried exporting the failing test from Ghost Inspector as Selenium IDE (new) and opened in Selenium IDE, and test ran successfully
Without seeing the code/test its a bit hard to tell but I'll take a shot in the dark
1) could be ghost inspector test settings. I would go into settings at the top right corner when you are inside your test and look at browser settings. Make sure you're using the browser you want as well as the correct screen size.
2) Could be a timing issue. You might need to add an assertion to let the button load before trying to click that button.
If these don't help let us know a bit more about the test steps as well as the button you are targeting. what is its function and what are the circumstances when its supposed to be disabled.

chromium profile directory is already/used by another BrowserContext instance or process

I used an evaluated jxbrowser, which version is 6.14, I write an demo to use it. but i have a problem with it.
Use the demo app to start an application, which can show web UI, keep this applciation with opened, but then I start demo app again, system will throw below exception:
chromium profile directory is already/used by another BrowserContext instance or process
jxbrwowser cannot start two clients in one PC? if can, how to resolve it?
We strongly recommend that you don't use several BrowserContext instances with the same profile directory. Chromium engine wasn't designed for such usage and doesn't support it. Even if you don't see any issues right now, the issues will appear later in end user environments. For example, in macOS environment you will get the Chromium's error message dialog every time when you run your application instance developed in such way.
Since it's a critical requirement in the Chromium engine, I don't think we will make it configurable in next versions. This is how Chromium engine works. These is a recommendation we have to follow when working with the Chromium engine.

AEM Launcher run mode issue in Publish Instance

I am running a launcher in publish instance,the launcher doesn't invoke the workflow when run mode is publish or publish and author but it works when I make run mode as author
Can someone help me with this behaviour of AEM?
Wrokflow launchers are tied to run-modes and you can change the behavior to run to either or both of them. The default dialog height is less hence it is not visible you need to scroll down.
Taken from the Adobe documentation:
When using one of the above run modes (author, publish, samplecontent, nosamplecontent), the value used at installation time defines the run mode for the entire lifetime of that installation.
For these run modes you cannot change them after installation.
You cannot use runmodes author AND publish at the same time (I wonder what AEM will do if you try to set both runmodes) and switching the runmode is also a bad idea.
See https://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/configure-runmodes.html for details.
There must be something wrong with your instance. Any log messages?

Is it possible to run browsers in headless mode in a windows box?

I'm writing tests using webdriver in Java.
Is there a way to run browsers (ff / ie) in headless mode in a windows box?
I cant use a linux box and HtmlUnitDriver is not helping as our webapp has many ajax controls.
I have started a small project to supply a driver for WebDriver using SimpleBrowser. You may want to check it out: https://github.com/Teun/SimpleBrowser.WebDriver
It's still early days though. I would appreciate help in the form of contributions and testing.
At this point there is no headless version that I am aware of the Firefox or IE. Since Firefox is open source it's possible that you could get the source code for that browser and then remove the UI portion but there are a few problems with it that I can see. First you have to build a custom app to setup your own load testing engine. Second you are locked to one web render, though I think chrome is open source as well but it doesn't play as nicely as Firefox or IE (using the system .dlls vs. a custom executable). Third without a lot of testing I am sure there will be stability issues and potentially other unforseen issues with this option. That being said there is a .net headless browser that's fairly simple and would probably be decent for load testing called simple browser. However it depends on what you are wanting to load. If you just looking for bandwidth and server load then you should be find using multiple instances of the browser. I would be curious to know if using the headless browser in this fashion if you instantiated different WebDriver if it would play nicely. i.e.
WebDriver driver1 = new SimpleBrowser();
WebDriver driver2 = new SimpleBrowser();
.
.
.
.
.
WebDriver driver[n] = new SimpleBrowser();
and then you could run [n] parallel tests. Also of note in the above code SimpleBrowser() doesn't hook directly to the WebDriver interface you would have to Extend the interface to reference that .dll
Start the test program as a Windows service and the browsers will run just fine, even on a machine with no monitors. Technically speaking, they're running in a "session" that is disconnected, but it's essentially what you mean by "headless".
HtmlUnitDriver does support ajax, and can run in both java and c# (if ported via IKVM).
There is, however, no way to run IE and FF in headless mode. I can't tell you how many times I've wished for that...

Severe Flex issues

I seem to be having difficulties getting the trace function to output anything to the console in either Eclipse with the Flex Plug-in, Flex Builder, or even FlexBeans (the Netbeans plug-in for Flex). I have removed and then reinstalled the Flash player 10 debugger version for both Firefox and IE, rebooting after uninstalling them and then after re-installing them. I have removed all old versions of Java and updated to the most recent version.
mm.cfg is configured correctly to allow the trace actions to appear in flashlog.txt
I tried removing the Flex Plug-in for eclipse to re-install, and now that I re-installed, I cannot create new Flex projects. I would rather not uninstall Flex Builder for fear that it will also behave strangely.
ANY ideas would be useful. Ideally, I need the plug-in to work, but any way I could get tracing to output to the console (in ANY IDE) would be better than what I have now.
I'm not sure what you mean by "Flash debugger for both Firefox and IE"; are you referring the debugger versions of the Flash Player available here?
http://www.adobe.com/support/flashplayer/downloads.html
If not, you definitely need those installed in order to be able to write trace() output to the IDE console.
I'm almost positive that this is not the issue, but it has confused me on a couple of occasions.
The Debug Application (as opposed to Run Application) keyboard command is different on Mac and PC. I use both and have gotten them mixed up, which results in my Running when I think I am Debugging, which of course leads to know trace outputs in the console.
Most likely not it, but doesn't hurt to mention it (I hope) :)
-- Evan
How are you testing the debugger? Have you tried going somewhere like with lots of ads that generally still have their traces in? Or are you just testing it with your own swfs? Have you installed the projector debug version? How is eclipse / flex configured to launch test swfs? Is it in the browser, or in the stand alone player? Do you have any weird mxmlc settings?
I assume you've followed all these instructions?
http://kb2.adobe.com/cps/193/tn_19323.html
This is actually a combination of issues. The minor issue was that one application was interfering with Flex Builder Plug-in. The major issue had to do with a setting which had gotten changed on the Flash debugger.
If you right-click the running SWF and then click Debugger, you can (essencially) tell the VM where to listen for trace actions. This had been set to another machine on the network, and not my local machine. As soon as that was switched, everything restored itself.

Resources