Hi HtmlUnit team,
We have one user having this error using JWebUnit + HtmlUnit.
[junit] Testcase: testSearch(xyz.ExampleWebTestCase): Caused an ERROR
[junit] null
[junit] java.lang.NullPointerException
[junit] at com.gargoylesoftware.htmlunit.javascript.host.Event.<init>(Event.java:280)
[junit] at com.gargoylesoftware.htmlunit.javascript.host.Event.<init>(Event.java:267)
[junit] at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1236)
[junit] at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:218)
[junit] at com.gargoylesoftware.htmlunit.TopLevelWindow.close(TopLevelWindow.java:104)
[junit] at com.gargoylesoftware.htmlunit.WebClient.closeAllWindows(WebClient.java:1937)
[junit] at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.closeBrowser(HtmlUnitTestingEngineImpl.java:204)
[junit] at net.sourceforge.jwebunit.junit.WebTester.closeBrowser(WebTester.java:145)
[junit] at net.sourceforge.jwebunit.junit.WebTestCase.closeBrowser(WebTestCase.java:129)
[junit] at net.sourceforge.jwebunit.junit.WebTestCase.tearDown(WebTestCase.java:55)
[junit] at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79)
The test case simply consists in opening
http://www.google.com and doing a simple search. Then JWebUnit will automatically close the browser during the tearDown. According to the stack, the NPE occurs when calling WebTester.closeAllWindows().
Any idea of the cause of the issue? Is it possible that SgmlPage.getDocumentElement() returns null?
Thanks,
Julien
opensubscriber is not affiliated with the authors of this message nor responsible for its content.