Issues with running funcunit from the command line

138 views
Skip to first unread message

eyeyen

unread,
Aug 25, 2010, 3:26:31 PM8/25/10
to FuncUnit
First off, I just wanted to say thank you so much for bringing this to
the scene. I was doing some testing with FireUnit and FuncUnit looks
very promising.

I downloaded the beta at:
http://github.com/downloads/jupiterjs/funcunit/funcunit-beta-4.zip

FWIW, is the most recent URL to use, and these sites are referencing
old URLs:
http://v3.javascriptmvc.com/index.html#&who=FuncUnit
http://funcunit.com/

I ran the demo and it worked out great.

So now I am trying to run it via the command line. I am using OSX
10.6.4 btw.

I had to change the permissions so that envjs could execute, and I had
some problems with ^M. I resolved it by making a completely new envjs,
copying the contents of the old envjs over and no more ^M. I think
maybe those were in envjs because they were created in a Windows
environment?

# cd funcunit-beta-4
# ls -lah envjs
-rw-r--r--@ 1 eyeyen staff 294B Jul 22 01:54 envjs
# chmod 755 envjs
# ./envjs demo/funcunit.html
./envjs: bad interpreter: /bin/sh^M: no such file or directory
# mv envjs envjs.bak
# touch envjs

So now my envjs file works, but it's throwing some error about not
being able to run firefox-bin.

# ls -lah envjs*
-rwxr-xr-x 1 eyeyen staff 283B Aug 25 12:05 envjs
-rwxr-xr-x@ 1 eyeyen staff 296B Aug 25 12:02 envjs.bak
-rw-r--r--@ 1 eyeyen staff 697B Jul 21 22:44 envjs.bat
# chmod 755 envjs
# ./envjs demo/funcunit.html
STARTING *firefox
JavaException: java.lang.RuntimeException: Could not start Selenium
session: Failed to start new browser session: Error while launching
browser
error loading script [object HTMLElement] JavaException:
java.lang.RuntimeException: Could not start Selenium session: Failed
to start new browser session: Error while launching browser
MODULE myapp

I'll spare you the code dump from here, but any idea on how I can get
this to work in the command line? Thanks in advance!

Brian Moschel

unread,
Aug 25, 2010, 3:31:52 PM8/25/10
to func...@googlegroups.com
One thing to try is setting the browser path directly in case you have it installed in a non-standard location:


Look at the part called Setting Browsers for info on how to do this.

There's also info here on this:


Let me know if this works.
--
Brian Moschel

Jupiter Consulting
\Development\Training\Support
847-727-1609
brian....@gmail.com

eyeyen

unread,
Aug 25, 2010, 4:04:38 PM8/25/10
to FuncUnit
Hi Brian, thanks for the reply.

I managed to fix the Firefox error by upgrading Selenium to 1.0.3,
here http://seleniumhq.wordpress.com/2010/02/23/selenium-1-0-3-released/

Not sure if this is the best way, but I copied over:
selenium-java-client-driver.jar
selenium-server.jar

To the selenium folder.

I fired it back up and then I got this error when it started running
Firefox/selenium:
JavaException: com.thoughtworks.selenium.SeleniumException: ERROR:
Threw an exception: jQuery is undefined

I looked in funcunit.js and saw that jQuery is included.

I tried manually include jquery before including funcunit.js, but I'm
still getting the same error.

Any ideas?

On Aug 25, 12:31 pm, Brian Moschel <brian.mosc...@gmail.com> wrote:
> One thing to try is setting the browser path directly in case you have it
> installed in a non-standard location:
>
> http://v3.javascriptmvc.com/index.html#&who=FuncUnit
>
> <http://v3.javascriptmvc.com/index.html#&who=FuncUnit>Look at the part
> called Setting Browsers for info on how to do this.
>
> There's also info here on this:
>
> http://release.seleniumhq.org/selenium-remote-control/0.9.0/doc/java/...,
> brian.mosc...@gmail.com

Justin Meyer

unread,
Aug 25, 2010, 4:12:02 PM8/25/10
to func...@googlegroups.com
I know that won't work because we rely on a custom version of selenium.  You can't swap out the selenium jar.

Can you provide more of the dump when it was breaking?

Justin Meyer


Jupiter Consulting
\Development\Training\Support

eyeyen

unread,
Aug 25, 2010, 5:03:25 PM8/25/10
to FuncUnit
Sure, this is the output from the terminal (I restored the original
jar files):
STARTING *firefox
could not load script http://localhost/funcunit-beta-4/demo/funcunit.js
JavaException: java.lang.RuntimeException: Could not start Selenium
session: Failed to start new browser session: Error while launching
browser
error loading script [object HTMLElement] JavaException:
java.lang.RuntimeException: Could not start Selenium session: Failed
to start new browser session: Error while launching browser
MODULE myapp

And heres what we have in my selenium.err:
13:55:58.990 WARN - It looks like your baseUrl (http://localhost/
funcunit-beta-4/demo/funcunit.html) is pointing to a file, not a
directory (it doesn't end with a /). We're going to have to strip off
the last part of the pathname.
dyld: Library not loaded: /usr/lib/libsqlite3.dylib
Referenced from: /System/Library/Frameworks/Security.framework/
Versions/A/Security
Reason: Incompatible library version: Security requires version
9.0.0 or later, but libsqlite3.dylib provides version 1.0.0
13:56:19.089 ERROR - Failed to start new browser session, shutdown
browser and clear all session data
java.lang.RuntimeException: Timed out waiting for profile to be
created!
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:
305)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:
106)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:
83)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:
350)
at
org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRemoteSession(FirefoxLauncher.java:
98)
at
org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:
357)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:
122)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:
84)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:
699)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:
393)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:
364)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:
125)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:
986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

By the way, I tried doing this (copying over the system
libsqlite3.dylib to Firefox's version):
http://agilesoftwaretesting.com/?p=105

This didn't work. Is there anyway the custom version of selenium can
be updated to work with Snow Leopard? Thanks, you guys respond very
quick.

On Aug 25, 1:12 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> I know that won't work because we rely on a custom version of selenium.  You
> can't swap out the selenium jar.
>
> Can you provide more of the dump when it was breaking?
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
> 847-924-6039
> justinbme...@gmail.com
>
> On Wed, Aug 25, 2010 at 3:04 PM, eyeyen <eyeyenblack...@gmail.com> wrote:
> > Hi Brian, thanks for the reply.
>
> > I managed to fix the Firefox error by upgrading Selenium to 1.0.3,
> > herehttp://seleniumhq.wordpress.com/2010/02/23/selenium-1-0-3-released/

Brian Moschel

unread,
Aug 26, 2010, 2:19:26 AM8/26/10
to func...@googlegroups.com
I can confirm something is wrong in os x (its not just you).  Jeremy was able to reproduce this issue.  I'm out of town not near a mac until this weekend, but I'll fix it as soon as I'm back.

- Brian

eyeyen

unread,
Aug 27, 2010, 5:30:58 PM8/27/10
to FuncUnit
Sweet, thank you for the response, it's very appreciated.
> brian.mosc...@gmail.com

Brian Moschel

unread,
Aug 30, 2010, 4:21:35 PM8/30/10
to func...@googlegroups.com
We looked into this a little further today.  Our theory (not confirmed) is that this is a problem with OS X 10.6 and latest Firefox.  It does seem to work on OS X 10.5 and latest Firefox.  My guess is Selenium released an update that fixed some FF issue with latest OS X.

The latest selenium (2.0.5) seems to open firefox fine in a quick test, but its not as simple as dropping that into the project and zipping a new download.  We've made some slight changes to selenium for FuncUnit, and the API of version 2.0 is slightly different.  The latest Selenium also doesn't work on IE on the filesystem.  So this might not be a quick fix.  I'll do some more investigation tonight and email back with an update.

- Brian

Brian Moschel

unread,
Aug 30, 2010, 5:15:57 PM8/30/10
to func...@googlegroups.com
It seems the latest Selenium does work in IE on the filesystem, so they resolved that issue recently.  Just have to change things to use the latest Selenium API and add our hooks back in for asynchronous behavior.  This might take a night of work, if there are no unexpected issues.

- Brian

Brian Moschel

unread,
Aug 31, 2010, 2:46:00 PM8/31/10
to func...@googlegroups.com
All done!  This new download should work in the latest version of OS X.  It has the latest selenium.

http://github.com/downloads/jupiterjs/funcunit/funcunit-beta-5.zip

Please let me know if that works for you.

- Brian
Reply all
Reply to author
Forward
0 new messages