[
https://issues.jboss.org/browse/ARQGRA-184?page=com.atlassian.jira.plugin...
]
Lukáš Fryč commented on ARQGRA-184:
-----------------------------------
Jan, I think you can use Arquillian extension instead of TestNG listener in order to avoid
timing issues.
Using driver in test listener causes NullPointerException
---------------------------------------------------------
Key: ARQGRA-184
URL:
https://issues.jboss.org/browse/ARQGRA-184
Project: Arquillian Graphene
Issue Type: Bug
Affects Versions: 2.0.0.Alpha1
Reporter: Jan Papousek
Assignee: Lukáš Fryč
Priority: Critical
Labels: richfaces
Fix For: 2.0.0.Alpha3
[This
listener|https://github.com/richfaces/qa/blob/master/testng-listeners/src...]
uses driver take a screenshot on test failure. Unfortunately it throws the following
exception because the GrapheneContext doesn't contain any driver instance:
{code}
org.apache.maven.surefire.util.SurefireReflectionException:
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NullPointerException: context is null - it needs to be setup before
starting to use it
at org.jboss.arquillian.graphene.context.GrapheneContext.get(GrapheneContext.java:88)
at
org.jboss.arquillian.graphene.context.GrapheneContext$1.getTarget(GrapheneContext.java:145)
at
org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.getTarget(GrapheneProxyHandler.java:222)
at
org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:204)
at
org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler$1.invoke(GrapheneProxyHandler.java:137)
at
org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invoke(GrapheneProxyHandler.java:166)
at $Proxy1.getScreenshotAs(Unknown Source)
at
org.jboss.test.selenium.listener.FailureLoggingTestListener.onFailureForSelenium2(FailureLoggingTestListener.java:174)
at
org.richfaces.tests.metamer.ftest.MetamerFailureLoggingTestListener.onFailure(MetamerFailureLoggingTestListener.java:59)
at
org.jboss.test.selenium.listener.FailureLoggingTestListener.onConfigurationFailure(FailureLoggingTestListener.java:79)
at org.testng.internal.Invoker.runConfigurationListeners(Invoker.java:1797)
at org.testng.internal.Invoker.handleConfigurationFailure(Invoker.java:323)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:226)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
at
org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:173)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
at org.testng.TestRunner.privateRun(TestRunner.java:757)
at org.testng.TestRunner.run(TestRunner.java:608)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
at org.testng.TestNG.run(TestNG.java:999)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
... 9 more
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira