My Bad Start

303 views
Skip to first unread message

axio

unread,
Jun 10, 2010, 11:19:33 PM6/10/10
to JsTestDriver
I've been trying to get JsTestDriver going but have been unable to run
my tests.

I am running Windows Vista, and java.exe is on the path (as I can run
it from anywhere).
Both the jsTestDriver.conf and JsTestDriver-1.2.2.jar are located at a
path with no spaces, hereafter referred to as installPath.

To execute the program I have opened up the windows command line (cmd)
and changed directory to installPath.
I have been able to start the server and capture browsers without any
problems using the command
installPath>java -jar jsTestDriver-1.2.2.jar --port 9876 --browser
"pathToFirefox"

However when I then do the following:
installPath>java -jar jsTestDriver-1.2.2.jar --tests all
I get an exception "No server defined!".

I tried manually setting the config path by adding --config
"installPath\jsTestDriver.conf" but this did not change anything.

I also tried jsTestDriver-1.2.1.jar, but this did not change anything.

The contents of jsTestDriver.conf are:
server: http://localhost:9876

load:
- testing/*.js


The full exception is here:
c:\inetpub\wwwroot\WebSite3\Tests>java -jar JsTestDriver-1.2.2.jar --
config "C:\inetpub\wwwroot\WebSite3\Tests\jsTestDriver.conf" --tests
all

java.lang.RuntimeException: Oh Snap! No server defined!
at
com.google.jstestdriver.config.ResolvedConfiguration.createServerAddress(ResolvedConfiguration.java:
55)
at
com.google.jstestdriver.config.Initializer.initialize(Initializer.java:
76)
at com.google.jstestdriver.JsTestDriver.main(JsTestDriver.java:
79)
Unexpected Runner Condition: Oh Snap! No server defined!

Unfortunately I don't have a java development environment so I can't
debug this manually, however I did take a look at the source and that
exception implied the port was wrong which didn't really make sense to
me.

I can only assume I've missed something simple somewhere...

Your help is most appreciated

Thanks

axio

unread,
Jun 13, 2010, 5:54:50 PM6/13/10
to JsTestDriver
So I got hold of the source code and Eclipse and lo and behold...

The jsTestDriver.conf was a UTF-8 file (since that's what my text
editor defaults to) rather than ANSI as expected by jsTestDriver.

The net result was that the Yaml.load() call on line 39 of
YamlParser.java returned a mangled key for server: instead of creating
a key called 'server' it created one called '###server' where ### are
the ef bb bf characters that prefix a UTF-8 file (in Windows at
least...).

It would be nice if jsTestDriver handled opening UTF-8 files in
Windows. I don't know what Java has built into it to handle this.

Thanks

Integralist

unread,
Jan 27, 2011, 4:32:44 PM1/27/11
to js-test...@googlegroups.com
I'm still getting this error no matter how hard I try.

I've downloaded the source code files and have used the jsTestDriver.conf file provided (which should be set-up in ANSI mode?) and I still get that error about a server not being defined.

I've just seen someone else here: https://groups.google.com/forum/#!msg/js-test-driver/K3ImAJ6F5CY/kJAWuT4A_EkJ having a similar issue and the solution was to manually set --server http://localhost:4224 (which by the way worked!)

But why is this .conf not working and not being recognised in the correct format by Mac OSX?

M.
Reply all
Reply to author
Forward
0 new messages