I have created a suite of functional UI tests for my web based application using Arquillian Done which I would like to run on a Selenium Grid as opposed to running them locally.
The problem I've got that despite setting the host/port details for the Selenium hub server in the arquillian.xml
file, the UI tests are executed locally rather than on one of the Selenium nodes. I've even tried entering the details for a host that doesn't exist but the tests are still run locally and there are no error messages generated. It appears as though Drone is ignoring the configuration in the arquillian.xml
file.
Is there something wrong with my configuration in the arquillian.xml
file, or is there something else I'm doing wrong? Unfortunately there seems to be very little documentation on using Arquillian Drone with Selenium Grid.
The content of the arquillian.xml
file is as follows:
<?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">
<extension qualifier="webdriver">
<property name="browser">${arquillian.browser}</property>
<property name="remoteAddress">http://selenium-hub:4444</property>
</extension>
<extension qualifier="selenium-server">
<property name="host">selenium-hub</property>
<property name="port">4444</property>
<property name="skip">true</property>
</extension>
<container qualifier="arquillian-glassfish-remote">
<configuration>
...
</configuration>
</container>
</arquillian>
My Maven pom.xml file contains the following dependency and dependencyManagement sections:
<dependencies>
<!-- Various Java EE and Internal Dependencies -->
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>2.0.3.Final</version>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.8.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.selenium</groupId>
<artifactId>selenium-bom</artifactId>
<version>2.46.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>1.3.1.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
It appears there were two issues preventing the Arquillian Drone tests being executed against a Selenium Grid.
The first issue is that the webdriver
section of the arquillian.xml
file needs to include either <property name="remote">true</property>
or <property name="remoteReusable">true</property>
in addition to the remoteAddress
property. Without either the remote
or remoteReusable
then the tests will be run locally.
The second issue was that the remoteAddress
did not contain the full URL for the Selenium Grid hub server. The property should be set to <property name="remoteAddress">http://selenium-hub:4444/wd/hub</property>
. Obviously selenium-hub
needs to be set to the hostname of your Selenium hub server. What through me was accessing this URL via a browser returned a NullPointerException
however this appears to be normal behaviour as there are other parameters set when the URL is accessed correctly.
In addition the selenium-server
section of the arquillian.xml
file appears to be unnecessary.