0

I am trying to run my arquillian tests on sauce labs. In our project, We use build.gradle instead of Pom.xml. I tried following this link

Since we dont use pom.xml, I tried to add these dependencies to build.gradle

in build.gradle file:

repositories {
.
.
maven { url 'https://repository-saucelabs.forge.cloudbees.com/release' }
}

dependencies {
.
.
// Libraries needed for Remote Weblogic Testing
.
.
testRuntime "com.saucelabs:arquillian-sauce-drone:0.0.4"
}


**in arquillian.xml:**
<extension qualifier="sauce-webdriver">
        <property name="userName">swxxxxxxx</property>
        <property name="accessKey">63xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</property>
        <property name="browser">firefox</property>     
        <property name="os">Windows 2008</property>
        <property name="version">4.</property>
</extension>

Can someone please shed some light here on how to run arquillian tests on sauclabs (gradle project)

java.lang.NoClassDefFoundError: org/jboss/arquillian/drone/webdriver/configuration/TypedWebDriverConfiguration
at com.saucelabs.drone.webdriver.SauceWebDriverFactory.createConfiguration(SauceWebDriverFactory.java:55)
at com.saucelabs.drone.webdriver.SauceWebDriverFactory.createConfiguration(SauceWebDriverFactory.java:33)
at org.jboss.arquillian.drone.impl.DroneConfigurator.configureDrone(DroneConfigurator.java:172)
at org.jboss.arquillian.drone.impl.DroneConfigurator.prepareDroneConfiguration(DroneConfigurator.java:122)
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.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

I get the following error.

Junaid
  • 2,572
  • 6
  • 41
  • 77
Swaroop Tata
  • 89
  • 10
  • Add maven dependencies. Then it will work. – Junaid Nov 24 '14 at 18:03
  • @Junaid, thank you. I have added "testRuntime "com.saucelabs:arquillian-sauce-drone:0.0.4"" to the dependencies. Is that wrong? – Swaroop Tata Nov 24 '14 at 18:08
  • Well I used arquillian before with and without maven dependencies. But, for me, arquillian always run with maven dependencies. Its stupid but I can't figure the other way out. And here is the link http://stackoverflow.com/questions/13001371/adding-all-maven-dependencies-to-arquillian – Junaid Nov 24 '14 at 18:12
  • Shot in the dark here but would the way you specify dependencies matter? Based on [gradle documentation](http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html) you could try `testRuntime group: 'com.saucelabs', name: 'arquillian-sauce-drone', version: '0.0.4'`. – shri046 Nov 24 '14 at 19:27
  • @shri046, It did not make any difference. Thanks for the info though. – Swaroop Tata Nov 25 '14 at 04:14

1 Answers1

0

This might be an issue with transitive dependency. If you look at the arquillian-sauce-drone-0.0.4.pom the project depends on

<dependency>
    <groupId>org.jboss.arquillian.extension</groupId>
    <artifactId>arquillian-drone-webdriver</artifactId>
    <version>${version.arquillian.drone}</version>
</dependency>

Looking at the drone webdriver jar it contains the class you are seeing missing per the exception. This could be just one of the required dependencies that may be missing. To that effect you could try to look up transitive dependency management by gradle to see if it is setup/working as expected in your project.

Based on this SO post you could add a transitive attribute for the dependency. I could be way off base though as I have no experience with any of these tools except maven and sauce.

Snippet from the SO post

compile ('com.somepackage:LIBRARY_NAME:1.0.0@aar'){
    transitive=true
}
Community
  • 1
  • 1
shri046
  • 1,148
  • 11
  • 12