Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1075

Problem with Drone when configuring WebDriver via Capabilities interface

XMLWordPrintable

    • Hide
      • Declare the following dependencies, where Drone version is 1.1.0.CR1/2:
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-webdriver</artifactId>
            <version>${drone.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-webdriver-depchain</artifactId>
            <version>${drone.version}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        
      • Create an arquillian.xml like this:
        <arquillian xmlns="http://jboss.org/schema/arquillian"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="
                http://jboss.org/schema/arquillian
                http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
            <extension qualifier="webdriver">
                <property name="browserCapabilities">firefox</property>
                <property name="capabilityWebdriverFirefoxBin">/usr/bin/firefox</property>
            </extension>
        </arquillian>
        
      • Create an Arquillian test using a WebDriver and run it
      • See an Exception like this:
        java.lang.NullPointerException
        	at org.openqa.selenium.remote.DesiredCapabilities.<init>(DesiredCapabilities.java:51)
        	at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration$5.invoke(TypedWebDriverConfiguration.java:268)
        	at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration$5.invoke(TypedWebDriverConfiguration.java:259)
        	at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration$CallInterceptor.intercept(TypedWebDriverConfiguration.java:65)
        	at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration.getCapabilities(TypedWebDriverConfiguration.java:274)
        	at org.jboss.arquillian.drone.webdriver.factory.FirefoxDriverFactory.createInstance(FirefoxDriverFactory.java:79)
        	at org.jboss.arquillian.drone.webdriver.factory.FirefoxDriverFactory.createInstance(FirefoxDriverFactory.java:42)
        	at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:129)
        	at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:43)
        	at org.jboss.arquillian.drone.impl.DroneCreator.createWebTestBrowser(DroneCreator.java:71)
        etc.
        
      Show
      Declare the following dependencies, where Drone version is 1.1.0.CR1/2: <dependency> <groupId>org.jboss.arquillian.extension</groupId> <artifactId>arquillian-drone-webdriver</artifactId> <version>${drone.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.extension</groupId> <artifactId>arquillian-drone-webdriver-depchain</artifactId> <version>${drone.version}</version> <type>pom</type> <scope>test</scope> </dependency> Create an arquillian.xml like this: <arquillian xmlns= "http: //jboss.org/schema/arquillian" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http: //jboss.org/schema/arquillian http: //jboss.org/schema/arquillian/arquillian_1_0.xsd"> <extension qualifier= "webdriver" > <property name= "browserCapabilities" >firefox</property> <property name= "capabilityWebdriverFirefoxBin" >/usr/bin/firefox</property> </extension> </arquillian> Create an Arquillian test using a WebDriver and run it See an Exception like this: java.lang.NullPointerException at org.openqa.selenium.remote.DesiredCapabilities.<init>(DesiredCapabilities.java:51) at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration$5.invoke(TypedWebDriverConfiguration.java:268) at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration$5.invoke(TypedWebDriverConfiguration.java:259) at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration$CallInterceptor.intercept(TypedWebDriverConfiguration.java:65) at org.jboss.arquillian.drone.webdriver.configuration.TypedWebDriverConfiguration.getCapabilities(TypedWebDriverConfiguration.java:274) at org.jboss.arquillian.drone.webdriver.factory.FirefoxDriverFactory.createInstance(FirefoxDriverFactory.java:79) at org.jboss.arquillian.drone.webdriver.factory.FirefoxDriverFactory.createInstance(FirefoxDriverFactory.java:42) at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:129) at org.jboss.arquillian.drone.webdriver.factory.WebDriverFactory.createInstance(WebDriverFactory.java:43) at org.jboss.arquillian.drone.impl.DroneCreator.createWebTestBrowser(DroneCreator.java:71) etc.

      According to the release highlights at http://planet.jboss.org/post/arquillian_drone_extension_1_1_0_cr1_released, Drone should now have the capability to configure WebDriver using the Capabilities interface. However, when attempted, a NullPointerException is thrown by the TypedWebDriverConfiguration class, which attempts to run the code

      new DesiredCapabilities(TypedWebDriverConfiguration.this.capabilityMap)

      on the class variable 'capabilityMap', which does not seem to be initialised anywhere. This occurs both in version 1.1.0.CR1 of the Drone WebDriver extension and version 1.1.0.CR2.

      Note that in order to use version 1.1.0.CR1/2 of the WebDriver extension, the artifact 'arquillian-drone-webdriver' must be declared as a Maven dependency. If only 'arquillian-drone-webdriver-depchain' is declared as a dependency, the version of 'arquillian-drone-webdriver' used is one older than 1.1.0.CR1, even if the version given for the depchain is 1.1.0.CR1 or higher. Going through the same steps described in 'Steps to Reproduce' with only the depchain dependency declared results in the capability configuration not being recognised at all and the tests running with HtmlUnitDriver.

              kpiwko Karel Piwko
              codemiller Katie Miller (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: