javaseleniumselenium-webdriverjboss-arquillianarquillian-drone

Cannot use Arquillian Graphene with Arquillian Drone


I'm using Arquillian 1.1.6.Final for testing the JSF by using the Arquillian Drone 2.0.0.Alpha3. It works great. But when I'm adding the feature further by using the Arquillian Graphene 2.1.0.Alpha1, there is an exception as

java.lang.NullPointerException
at org.jboss.arquillian.graphene.enricher.WebElementEnricher.enrich(WebElementEnricher.java:68)
at org.jboss.arquillian.graphene.enricher.GrapheneEnricher.enrich(GrapheneEnricher.java:55)
at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52)

Even I revert the Arquillian Graphene to version 2.0.3.Final, the exception still thrown. Here is my pom.xml

<properties>
    <my.arquillian.drone.version>2.0.0.Alpha3</my.arquillian.drone.version>
    <my.arquillian.version>1.1.6.Final</my.arquillian.version>
    <!--my.arquillian.graphene.version>2.1.0.Alpha1</my.arquillian.graphene.version-->
    <my.arquillian.graphene.version>2.0.3.Final</my.arquillian.graphene.version>
    <my.arquillian.recorder.version>1.0.0.Beta1</my.arquillian.recorder.version>
    <my.arquillian.selenium.version>2.44.0</my.arquillian.selenium.version>
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>${my.arquillian.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.selenium</groupId>
            <artifactId>selenium-bom</artifactId>
            <version>${my.arquillian.selenium.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
            <dependency>
                  <groupId>org.jboss.arquillian.extension</groupId>
                  <artifactId>arquillian-drone-bom</artifactId>
                  <version>${my.arquillian.drone.version}</version>
            <type>pom</type>
            <scope>import</scope>
            </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-drone-webdriver-depchain</artifactId>
        <type>pom</type>
        <scope>test</scope>
    </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.graphene</groupId>
            <artifactId>graphene-webdriver</artifactId>
            <version>${my.arquillian.graphene.version}</version>
            <type>pom</type>
      <scope>test</scope>
        </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <scope>${my.project.dependency.test.scope}</scope>
        <exclusions>
            <exclusion>
                <artifactId>servlet-api-2.5</artifactId>
                <groupId>org.mortbay.jetty</groupId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

My unit test is

@RunWith(Arquillian.class)
public class DroneTest {

    @Drone
    private WebDriver browser;

    @Test
    @RunAsClient
    public void ensureIndexPage() {
        try{
            browser.get("http://www.google.com")
        } catch (Exception e){
            e.printStackTrace(); //<---- Exception in thrown here
        }
    }

}

As mention above, the unit test works fine without Arquillian Graphene. Could you please help to advise further?


Solution

  • I'm looking for another Arquillian Suite Extension rather than the rhq-arquillian-suite-extension which is able to works with Arquillian 1.1.6.Final, Arquillian Drone 2.0.0.Alpha3 and Arquillian Graphene 2.1.0.Alpha1. I've found the ingwarsw/arquillian-suite-extension it works great for all of them.

    Anyhow there is some limitation which it is a known issue that it cannot work with Arquillian Warp as issue-16.

    If we would like to achieve the code coverage without Arquillian Warp, the Jacoco may help as mentioned at JBoss Developer Forum: How to generate Code Coverage reports from Drone tests.