tags:

views:

1002

answers:

1

hello,

I am creating test cases using Junit framework and eclipse. Once I complete my execution of script I am getting below error:

It also gives me the option to attach the source.

    java.lang.NullPointerException
    at com.thoughtworks.selenium.SeleneseTestCase.tearDown(SeleneseTestCase.java:395)
    at junit.framework.TestCase.runBare(TestCase.java:140)
    at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:71)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Please please please help me.

Saara

A: 

Saara,

It seems you are describing two separate problems.

Firstly, your NPE (NullPointerException) which is being thrown by the SeleneseTestCase.java on line 395 is causing your test to fail. You have not supplied enough information to determine the cause for this exception, but it's likely to be your configuration of the software. You might want to at least include the version numbers of the client libraries you are using.

The second problem is that you are trying to browse into the source of a client library (selenium-java-client-driver.jar) which has no source attachment. I'll assume you're using eclipse (something else you should mention: the ide you are using) in which case, you can attach an archive, folder or url pointing to the source code for a client library and eclipse will be able to browse to the offending line (SeleneseTestCase.java line 395). Doing this might help you determine what is causing the exception to be thrown.

Really though, you haven't included enough information to receive any more help than that.

pstanton
hey...Sorry for inconvenience...I am using selenium RC AND I have added Junit-4.7.jar and selenium-java-client-driver.jar files to my library.just tell me why i am getting that "source not found" error.Once I solve this problem then will discuss about the nullpointer one.Thanks in advance.
Saara
selenium-java-client-driver.jar only has class files. Most open source java projects provide a jar of the source code (often with a filename ending in -src.jar). Some do not and you have to download the source code. If you are using Eclipse, you can find instructions on telling Eclipse where to find the source of your jar by searching for "eclipse source attachment" in your favorite search engine.
NamshubWriter