Uploaded image for project: 'Arquillian Graphene'
  1. Arquillian Graphene
  2. ARQGRA-184

Using driver in test listener causes NullPointerException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.0.Alpha1
    • Fix Version/s: 2.0.0.Alpha3
    • Component/s: None
    • Labels:
    • Story Points:
      4

      Description

      This listener uses driver take a screenshot on test failure. Unfortunately it throws the following exception because the GrapheneContext doesn't contain any driver instance:

      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
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lfryc Lukáš Fryč
                  Reporter:
                  jpapouse Jan Papousek
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: