开发者

getting NullPointerException error after executing my test script

I am using selenium RC with Junit framework and Eclipse. In whole test script, I am just opening one form and update some values in grid table. Some ending lines of code..

selenium.type(prop.gridtxtboxACTL, "test123");
selenium.click("link=Update");
selenium.waitForPageToLoad("30000");

}

public void teardown() throws Exception
{
    selenium.stop();
}

Once the execution is completed I am getting this NullPointerException error:

java.lang.NullPointerException at com.thoughtworks.selenium.SeleneseTestCase.tearDown(SeleneseTestCase.java:395) at junit.开发者_C百科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)

Even when I debug the same code, after teardown I am getting "NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available" error.

Please let me know for more details.


This

java.lang.NullPointerException at 
com.thoughtworks.selenium.SeleneseTestCase.tearDown(SeleneseTestCase.java:395)

implies to me that your variable selenium is null. Is that not the case ? Is that set during your setup method ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜