How to launch phantomjs in background? - phantomjs

I'm trying to start a few phantomjs's scripts via cron, but as it waiting for phantom.exit (but i keep the pages open some time) in the first script, next scripts will not launch. Who knows solution of this problem?

In linux you can run background processes by adding & at the end of the command.

Related

Testing frontend webpages solve selenium-ide issues or change to so?

i'm using selenium ide to test webapp frontend webpages.
I'd like to test via cli AND via gui having to mantain one scripts only.
When automating tests via selenium-side-runner it does not handle alert/confirm command if i don't change any "choose ok on next confirmation" with "webdriver choose ok on visible confirmation", but after change it side gui does not handle it.
Even exporting to python has some incokmpatiblity with gui.
Anyone knows the proper way to record a side.script with gui and run with cli without having to modify it and letting run the tests with the gui again?
I've see many complaining about this without solution, do you advise to use another fronted tester in the place of side? Why?
Thanks.
Just reporting what said on github's bug tracker issue 1270 by toddtarsi.
There's no way to have one script only to handle gui and cli tests. We have to wait for selenium-ide v4 (not SELENIUM).
The correct way is webdriver one.

CGI Scripts display as text on OSX 10.9

These scripts executed perfectly on "Lion". When I upgraded to "Mavericks" they only display as text. The scripts still execute (from the command line) perfectly, but when called from the browser you get the text (not the web page that it should be generating).
A simple step-by-step would be greatly appreciated.
Thanks!
I assume you are trying to run these in a browser? Have you made sure that the web worker executing the script has the correct level of permissions required to do so?

How to to run separate processes on iOS

How can I run a separate process (the executable will be in the main bundle) on iOS? NSTask seems to be missing...
BTW I don't care if this will be rejected by Apple, as it will never be submitted.
There is no way to run a seperate process other than launching a process that can run in background from xcode or the home screen.
If you want process 1 to kick off process 2 then you're out of luck.
However, if you want process 1 to run in background and then process 2 to be launched later and communicate with process 1 (via memory-mapped files or network) then you can do that as xcode will allow you to run more than one application on the simulator at a time.
Alternatively, you can emulate a process via a thread but that depends on what you want to do.

How to distribute a self developed mac application?

I've developed an application on XCode, compiled and built it.
If I run the app on the same machine using Finder, it starts normally.
But if I copy the app to another machine and try to run it, the application does not start.
Is there another step that I forgot after building the application on XCode?
I think it seems to be a simple issue, but I really need some help on it...
Thanks!
On a machine where it doesn't start, open the Console utility, try launching your program, and see if any new messages appear in the Console window.
OK, It was a very stupid error...
I was sending the app to the other machine through iChat. When the download completes the execute permission of the executable file inside the app is automatically removed.
So, I was trying to execute a non executable app.
Thanks everybody!

LSOpenURLSpec error

I have created a minimal OS X boot stick (basically the Snow Leopard DVD with all the packages and installer stripped out). I've written a basic Cocoa app launcher to launch other apps that I put in the Applications folder (the minimal install lacks Dock and Finder).
When I try to launch an app I get this error:
LSOpenFromURLSpec() returned -10810 for application (null) path /Applications/MyApp.app
Where "MyApp.app" is the app I tried to launch. I've tried this with both NSWorkspace's openFile method and the UNIX "open" utility and I get more or less the same error. One way that launching an app works is if I just execute the main executable of the app itself. (e.g. /Applications/MyApp.app/Contents/MacOS/MyApp). However this method is kind of inconvenient as it stalls the launcher until the app I launched exits. Any alternate ways to launch an app (or fix the LSOpenFromURL error)?
Thanks
Found a workaround:
/Applications/MyApp.app/Contents/MacOS/MyApp >/dev/null 2>/dev/null &
Using that command starts apps without stalling the launcher.
open relies on Launch Services, which relies on the Finder. Your script workaround starts a new background process executing the application's code with its standard out and standard error open to /dev/null. That should work fine.
The C equivalent under Mac OS X would be to either posix_spawn or fork/vfork then exec the executable file.