4 Replies Latest reply on Sep 24, 2013 11:25 AM by lfryc

    Graphene incompatible with SeleniumDrone?

    b69

      Hi,

      I need some help.

      Starting point:

      Running within Eclipse Kepler IDE, with java 6 on windows 7-64 professional. The aim is to have additional browser GUI tests using Graphene.

      I added the Graphene definition to my pom in a separated profile. If I activate this profile, I get the following Exceptions running my existing JUnit. If I disable the profile, everything is working as expected, using glassfish embedded container.

       

      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:160) at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:111) at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:97) at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52) at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:93) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156) ... 10 more Caused by: java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.core.impl.ManagerImpl at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:160) at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:111) at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:97) at org.jboss.arquillian.core.spi.ManagerBuilder.create(ManagerBuilder.java:77) at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.(EventTestRunnerAdaptor.java:55) ... 15 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:156) ... 19 more Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/drone/spi/Enhancer at org.jboss.arquillian.graphene.GrapheneExtension.register(GrapheneExtension.java:53) at org.jboss.arquillian.core.impl.loadable.LoadableExtensionLoader.load(LoadableExtensionLoader.java:78) 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:606) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) at org.jboss.arquillian.core.impl.ManagerImpl.fireProcessing(ManagerImpl.java:316) at org.jboss.arquillian.core.impl.ManagerImpl.(ManagerImpl.java:98) ... 24 more Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.drone.spi.Enhancer at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 37 more

       

      Pom Configuration (partial):

       

          <version.org.jboss.arquillian>1.1.1.Final</version.org.jboss.arquillian>
         <version.org.jboss.arquillian.extension.drone>1.1.1.Final</version.org.jboss.arquillian.extension.drone>
         <version.org.jboss.arquillian.selenium>2.35.0</version.org.jboss.arquillian.selenium>
         <version.org.jboss.arquillian.graphene>2.0.0.Beta1</version.org.jboss.arquillian.graphene>

       

      within dependencyManagement I declare among other:

      <dependency>

                      <groupId>org.jboss.arquillian</groupId>

                      <artifactId>arquillian-bom</artifactId>

                      <version>${version.org.jboss.arquillian}</version>

                      <scope>import</scope>

                      <type>pom</type>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.arquillian.extension</groupId>

                      <artifactId>arquillian-drone-bom</artifactId>

                      <version>${version.org.jboss.arquillian.extension.drone}</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.arquillian.selenium</groupId>

                      <artifactId>selenium-bom</artifactId>

                      <version>${version.org.jboss.arquillian.selenium}</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

      <!--            

                  <dependency>

                      <groupId>org.jboss.arquillian.graphene</groupId>

                      <artifactId>graphene-webdriver</artifactId>

                      <version>${version.org.jboss.arquillian.graphene}</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

      -->

       

      The Profiles are:

      <profile>

          <id>Graphene</id>

          <activation>

              <activeByDefault>true</activeByDefault>

          </activation>

          <dependencies>

              <dependency>

                  <groupId>org.jboss.arquillian.graphene</groupId>

                  <artifactId>graphene-webdriver-api</artifactId>

                  <version>${version.org.jboss.arquillian.graphene}</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.jboss.arquillian.graphene</groupId>

                  <artifactId>graphene-webdriver-spi</artifactId>

                  <version>${version.org.jboss.arquillian.graphene}</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.jboss.arquillian.graphene</groupId>

                  <artifactId>graphene-webdriver-impl</artifactId>

                  <version>${version.org.jboss.arquillian.graphene}</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.jboss.arquillian.extension</groupId>

                  <artifactId>arquillian-drone-webdriver-depchain</artifactId>

                  <type>pom</type>

              </dependency>

          </dependencies>

      </profile>

      <profile>

          <id>SeleniumDrone</id>

          <activation>

              <activeByDefault>true</activeByDefault>

          </activation>

          <dependencies>

              <dependency>

                  <groupId>org.jboss.arquillian.extension</groupId>

                  <artifactId>arquillian-drone-impl</artifactId>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.jboss.arquillian.extension</groupId>

                  <artifactId>arquillian-drone-selenium</artifactId>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.jboss.arquillian.extension</groupId>

                  <artifactId>arquillian-drone-selenium-server</artifactId>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.seleniumhq.selenium</groupId>

                  <artifactId>selenium-java</artifactId>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.seleniumhq.selenium</groupId>

                  <artifactId>selenium-server</artifactId>

                  <scope>test</scope>

                  <exclusions>

                      <exclusion>

                          <groupId>org.mortbay.jetty</groupId>

                          <artifactId>servlet-api-2.5</artifactId>

                      </exclusion>

                  </exclusions>

              </dependency>

          </dependencies>

      </profile>

       

      Of course there is an ArquillianTest profile and the profile for the embedded glassfish. As everything works on setting the Graphene profile to false, I think those other declarations doesn't matter.

      Maybe you saw the version declaration within the Graphene profile. Those are also required if the declaration in the depenencyManagment part is not commented out.

      Why, I don't understand. What is wrong, where is the incompatibility? Wrong jar version? or 2 different versions of the same jar?

       

      Thanks for any hint.

        • 1. Re: Graphene incompatible with SeleniumDrone?
          kwintesencja

          Hi there,

          have you tried with beta2? looks like a related issue has been fixed

          • 2. Re: Graphene incompatible with SeleniumDrone?
            b69

            Hi Raphael,

            Yes meanwhile I have tried the Beta2 version, but without any change or success. On the other hand I got a hint from Conor Restall, to reference in addition batik-ext-1.7.jar. This resolved the issue! batik-ext-1.6.1.jar is already referenced as dependency of tomahawk! I ignore how this could possibly be related. We have archives with the same name, but different versions and different content! This is for sure not a happy combination, but why the batik-ext-1.7 is missing when batik-ext-1.6.1 is present is beyond my understanding.

            • 3. Re: Graphene incompatible with SeleniumDrone?
              kpiwko

              Hi b69,

               

              please follow this guide http://arquillian.org/guides/functional_testing_using_graphene/ and Drone - Arquillian - Project Documentation Editor in order setup dependencies. I see a lot of stuff that's not needed in both <dependencies> and <dependencyManagement> sections. Note, you likely want to use Drone 1.2.0.CR1 and Graphene 1.2.0.CR1 version, as those were released today.

               

              In short, you want to have:

               

              in <dependencyManagement> section (all BOMs are imported with scope "import" and type "pom"):

              arquillian-bom

              arquillian-drone-bom

              [optionally] selenium-bom [if you want to use other version than 2.35.0 - the default set in Drone]

               

              in <dependencies> section (all depchains are imported with scope you want - likely "test", and type "pom" - in <dependencies> section never mention versions, they are managed by BOMs already)

              graphene-webdriver - that only think you need for Graphene2, no -*selenium, impls, etc

              [optionally] shrinkwrap-resolver-depchain - if you want to resolve jars, wars for Maven - seehttps://github.com/shrinkwrap/resolver/blob/master/README.asciidoc

               

              No other shrinkwrap-resolver-* and arquillian-drone*, arquillian-graphene* and selenium* related artifacts are needed.

               

              Hope that helps,

               

              Karel

              • 4. Re: Graphene incompatible with SeleniumDrone?
                lfryc

                Hey Raphael,

                 

                you need to use Drone 1.2.x with Graphene 2.0:

                 

                try Drone 1.2.0.CR1 and Graphene 2.0.0.CR1