1 Reply Latest reply on Jan 2, 2013 8:54 AM by kpiwko

    Drone DesiredCapabilities issues

    jwatts

      Hello,

       

      I'm having issue running Drone Webdriver

       

      I have a Struts2 web app that I'm attempting to test with arquillian with the drone extension, when I run my test I recieved this exception:

       

      java.lang.NullPointerException at org.openqa.selenium.remote.DesiredCapabilities.<init>(DesiredCapabilities.java:51)

       

      I debuged the arquillian-drone-webdriver.jar; inside the TypedWebDriverConfiguration.java at getCapabilities() method, a new DesiredCapabilities class is created with TypedWebDriverConfiguration.this.capabilityMap, however the capabilityMap is never instaniated hence the NPE. I instaniated and hard-coded  some values for capabilityMap:

       

      TypedWebDriverConfiguration.this.capabilityMap = new HashMap<String, String>();

      TypedWebDriverConfiguration.this.capabilityMap.put("browserName", "chrome");

                                              TypedWebDriverConfiguration.this.capabilityMap.put("platform", "WINDOWS");

       

       

       

      recompile and rerun and everything works as expected...struts.war is deployed, browser comes and selenium executes.

       

      I'm not sure if this is a bug or I'm missing something in my arquillian.xml configuration or something.

       

      my pom.xml is exactly as https://github.com/arquillian/arquillian-extension-drone so should not be any version issues as reported in http://stackoverflow.com/questions/12030946/how-to-configure-webdriver-with-arquillian-using-the-capabilities-interface

       

      here's my arquillian.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <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">

         

          <engine>

               <property name="deploymentExportPath">.</property>

          </engine>

       

       

        <container qualifier="dev" default="true">

          <configuration>

            <property name="jbossHome">installs/jboss/jboss-as-7.1.0.Final</property>

                  <property name="allowConnectingToRunningServer">true</property>

            <property name="javaVmArguments">-Djboss.modules.system.pkgs=com.sun.tools.attach,org.jboss.byteman -Xbootclasspath/a:lib/jboss/byteMan/lib/tools.jar</property>

            <property name="outputToConsole">true</property>

          </configuration>

        </container>

       

        <extension qualifier="webdriver">

              <property name="browserCapabilities">chrome</property>

              <property name="chromeDriverBinary">lib/chromedriver/chromedriver.exe</property>

               <property name="chromeBinary">lib/chromedriver/chromedriver.exe</property>

          </extension>

        

        <extension qualifier="byteman">

          <property name="autoInstallAgent">true</property>

          <property name="agentProperties">org.jboss.byteman.verbose=true</property>

        </extension>

      </arquillian>

       

      Any additional insight would be greatly appreciated, Thanks

        • 1. Re: Drone DesiredCapabilities issues
          kpiwko

          Hi Jerry,

           

          arquillian.xml looks right to me. Did I got right that your pom.xml file contains following code?

           

           

          <dependencies>
                  <dependency>
                      <groupId>org.jboss.arquillian.extension</groupId>
                      <artifactId>arquillian-drone-webdriver-depchain</artifactId>
                      <version>${drone.version}</version>
                      <type>pom</type>
                      <scope>test</scope>
                  </dependency>
              </dependencies>
              <dependencyManagement>
                  <dependencies>
                      <dependency>
                          <groupId>org.jboss.arquillian</groupId>
                          <artifactId>arquillian-bom</artifactId>
                          <version>${arquillian.version}</version>
                          <type>pom</type>
                          <scope>import</scope>
                      </dependency>
                      <dependency>
                          <groupId>org.jboss.arquillian.extension</groupId>
                          <artifactId>arquillian-drone-bom</artifactId>
                          <version>${drone.version}</version>
                          <type>pom</type>
                          <scope>import</scope>
                      </dependency>    
                  </dependencies>
              </dependencyManagement>
          

           

          with Drone version 1.1.0.Final and Arquillian core versioned from 1.0.x stream (e.g. 1.0.3.Final)?