Error when trying to Test an application -

107 views
Skip to first unread message

$_

unread,
Nov 28, 2011, 1:36:21 PM11/28/11
to Marathon Java GUI Testing
Hello.

First time trying marathon. I'm setting up a test project as stated on
the User's Manual:
- Adding the application .jar to the classpath
- Adding (also to the classpath) everything else I usually add to the
classpath when launching the application via my .bat file

At some point, my main class tries to get a resource using:

URL url =
this.getClass().getClassLoader().getSystemResource(sFileName);

This throws me an exception:

Exception in thread "main" java.lang.NullPointerException
at sun.misc.MetaIndex.mayContain(MetaIndex.java:225)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:744)
at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
at sun.misc.URLClassPath.getResource(URLClassPath.java:220)
at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1126)
at java.lang.ClassLoader.getResource(ClassLoader.java:975)
at java.lang.ClassLoader.getResource(ClassLoader.java:973)
at java.lang.ClassLoader.getSystemResource(ClassLoader.java:1076)

Could it be that I am messing the classpath?

Regards.

Sampathkumar R

unread,
Nov 29, 2011, 1:15:13 AM11/29/11
to marathon...@googlegroups.com
I suspect the variable sFileName might be null at that point. This might be due to use of relative path while constructing the variable. If relative paths are used try setting the proper working directory option in Marathon Project Settings.

With regards,
__________________________________
Sampathkumar R
Jalian Systems Pvt. Ltd.
#44, Maruthi Complex,
CMR Road, Kalyana Nagar 2nd Block,
H.R.B.R Layout, Bengaluru - 560 043
INDIA
Telephone: +91-80-25457305
W: http://www.jaliansystems.com
W: http://www.marathontesting.com

Reply all
Reply to author
Forward
0 new messages