Selenium remote webdriver error when running a build with ant/ivy - java

Here is my error message, I'll explain below.
<error message="Mouse is not implemented yet for the remote WebDriver." type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException: Mouse is not implemented yet for the remote WebDriver
The problem is when I run my selenium automation scripts using ant/ivy I get that error. This code runs fine on it's own, but i'm trying to use ant/ivy to get it built so I can run it on jenkins. It does build ok, I get this problem when running the build suite.
I have the following selenium packages being pulled from the central repository
<dependency org="org.seleniumhq.selenium" name="selenium-server" rev="2.5.0"/>
<dependency org="org.seleniumhq.selenium" name="selenium-java" rev="2.5.0"/>
<dependency org="org.seleniumhq.selenium" name="selenium-firefox-driver" rev="2.5.0"/>
<dependency org="org.seleniumhq.selenium" name="selenium-api" rev="2.5.0"/>
<dependency org="org.seleniumhq.selenium" name="selenium-remote-client" rev="2.0b1"/>
<dependency org="org.seleniumhq.selenium" name="selenium-remote-driver" rev="2.5.0" >
<artifact name="selenium-remote-driver" type="jar" />
</dependency>
<dependency org="org.seleniumhq.webdriver" name="webdriver-common" rev="0.9.7376" >
<artifact name="webdriver-common" type="jar" />
</dependency>
<dependency org="org.seleniumhq.webdriver" name="webdriver-remote-client" rev="0.9.7376" >
<artifact name="webdriver-remote-client" type="jar" />
</dependency>
<dependency org="org.seleniumhq.webdriver" name="webdriver-remote-server" rev="0.9.7376" >
<artifact name="webdriver-remote-server" type="jar" />
</dependency>
<dependency org="org.seleniumhq.webdriver" name="webdriver-remote-common" rev="0.9.7376" >
<artifact name="webdriver-remote-common" type="jar" />
I wasn't able to find a place in the central repository to pull down the selenium-server-standalone.jar so I don't have that. Is there a package that might work better or a workaround for this issues?
Please let me know if my question is not clear enough, I'm new to ant/ivy.

Is it possible that you are hitting this issue? It seems like you are using an older version (2.5.0) of most of those Selenium packages. According to Maven Central those packages are all at version 2.19.0 now. Maybe updating to the most recent ones may fix the problem.

Related

Adding JaCoCo to Ivy?

I have tried to find the right org=".. address for JaCoCo so that I can simply add the address to my ivy.xml file and it will take care of the dependency.
But I have trouble finding the right link and was wondering if anyone knew what it was?
I am going to use Ant to build my project, so I'd have to put JaCoCo to use in there.
None of the below are correct:
<!-- JaCoCo -->
<dependency org="org.jacoco.agent" name="jacoco-agent" rev="0.6.2.2" />
<dependency org="org.jacoco.core" name="jacoco-core" rev="0.6.2.2" />
<dependency org="org.jacoco.report" name="jacoco-report" rev="0.6.2.2" />
You'll only need a single dependency declaration:
<dependency org="org.jacoco" name="org.jacoco.ant" rev="0.7.2.201409121644" />
The "core", "agent" and "report" jars get pulled in as dependencies.
Jacoco ANT task jar in Maven Central
The following is an build example that uses ivy to manage Jacoco and Sonar plugins. It's worth noting how it uses a "build" configuration mapping to create a classpath for just the ANT task jars.
integrating JaCoCo in sonar using Ant
I use following dependencies:
<dependency org="org.jacoco" name="org.jacoco.ant" rev="0.6.3.201306030806"/>
<dependency org="org.jacoco" name="org.jacoco.core" rev="0.6.3.201306030806"/>
<dependency org="org.jacoco" name="org.jacoco.agent" rev="0.6.3.201306030806"/>
<dependency org="org.jacoco" name="org.jacoco.report" rev="0.6.3.201306030806"/>

Ivy's transitive="false" gets simply ignored when downloading from Nexus

At our company, we are migrating our old ivy repository to Nexus.
After uploading our own artifacts to Nexus, I tried downloading a few projects' dependencies to test the setup, but I'm failing with spring-web. Let me explain how.
Here is the ivy-settings.xml file pointing only to our local Nexus installation
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivysettings>
<settings defaultResolver="default" />
<resolvers>
<ibiblio name="nexus" m2compatible="true" root="http://nexus.local/nexus/content/repositories/central/" />
<ibiblio name="our-nexus" m2compatible="true" root="http://nexus/nexus/content/repositories/repo" />
<chain name="default" returnFirst="true">
<resolver ref="our-nexus" />
<resolver ref="nexus" />
</chain>
</resolvers>
</ivysettings>
In one of our projects we use Spring Web, but not all of its dependencies, so I declared
<dependency org="org.springframework" name="spring-web" rev="3.0.5.RELEASE" transitive="false" />
This worked fine when using Ivy repository. However today I can't perform an <ivy:retrieve> task because it can't find com.caucho#hessian#3.2.1
<ivy:report> task says that such version of hessian is required by spring-web 3.2.11.RELEASE
But I have declared transitive="false"!!!
Why isn't it working? What am I missing/messing?
Should work. Personally I prefer configuration mappings. Try the following instead:
<dependency org="org.springframework" name="spring-web" rev="3.0.5.RELEASE" conf="default->master" />
For more details see:
How can I include the Ivy dependency and none of its dependencies?

Ant Ivy: How to retrieve source code for all levels of dependencies?

I tried to configure Ivy to download source code for dependencies. It works, but only for the top-level dependency. Maven will get sources for all levels of dependencies. How can I do this using Ivy?
Here is my ivy.xml file:
<ivy-module version="2.0">
<info organisation="com.ubs" module="IMQuant"/>
<dependencies defaultconfmapping="*->default,sources">
<dependency org="junit" name="junit" rev="4.11"/>
<dependency org="org.apache.maven.surefire" name="common-java5" rev="2.17"/>
<dependency org="com.googlecode.kevinarpe-papaya" name="kevinarpe-papaya" rev="0.0.15"/>
</dependencies>
</ivy-module>
Here is my retreive statement:
<ivy:retrieve pattern="${libs.dir}/ivy/all/[artifact]-[revision]-[type].[ext]" />
Above, dependency kevinarpe-papaya requires Google Guava. I see the JAR downloaded (actually a bundle), but I don't see the sources. I checked my Ivy cache. The sources are also missing for Google Guava.
Also, dependency junit requires Hamcrest (core). Again, I see the JAR downloaded, but I don't see the sources. (Also, I checked my Ivy cache.)
You could try to specify the type:
type="sources"
E.g.:
<dependency org="junit" name="junit" type="sources" rev="4.11"/>
If you want to retrieve different types, mention the same dependendy multiple times:
<dependency org="junit" name="junit" type="sources" rev="4.11"/>
<dependency org="junit" name="junit" type="jar" rev="4.11"/>

com.ibm.websphere#uow;6.0.2.17: not found

I am new to Ivy and am a chronic ant user, so repositories are still sort of new to me.
I have a Spring 4 project and I'm attempting to build my data access stuff using Hibernate. I have the following ivy.mxl file being imported into my build.
<ivy-module version="2.0">
<info organisation="apache" module="data"/>
<dependencies>
<dependency org="org.eclipse.persistence" name="org.eclipse.persistence.core" rev="2.5.2-M1" />
<dependency org="org.eclipse.persistence" name="org.eclipse.persistence.jpa" rev="2.5.2-M1" />
<dependency org="com.ibm.websphere" name="com.springsource.com.ibm.websphere.uow" rev="6.0.2.17" />
<dependency org="org.springframework" name="spring-beans" rev="4.0.3.RELEASE" />
<dependency org="org.springframework" name="spring-context" rev="4.0.3.RELEASE" />
<dependency org="org.springframework" name="spring-orm" rev="4.0.3.RELEASE" />
<dependency org="org.springframework" name="spring-tx" rev="4.0.3.RELEASE" />
</dependencies>
</ivy-module>
I added the uow line as a result of this problem. When I build, I get the following message:
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: com.ibm.websphere#uow;6.0.2.17: not found
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
I google for this error and found nothing.
I found the library here: http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.com.ibm.websphere.uow&version=6.0.2.17 and added the following to my ivysettings.xml file as a result of the FAQ from this link:
<url name="com.springsource.repository.bundles.release">
<ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.bundles.external">
<ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
And then added to my chain:
<resolver ref="com.springsource.repository.bundles.release"/>
<resolver ref="com.springsource.repository.bundles.external"/>
None of this has made any impact to my error. Any ideas?
Based on what I found here: Find hidden dependencies in Ivy I added transitive="false" to my dependency and it quit bringing it in.
Using this dependency statement I was able to resolve the problem.
<dependency org="org.springframework" name="spring-tx" rev="3.2.9.RELEASE"
transitive="false" conf="compile->default;runtime->default;"/>
It is located in the Redhat GA repo.
I added the repo to the resolvers in ivysettings.xml.
<resolvers>
<chain name="chained" returnFirst="true">
<ibiblio name="redhat" root="https://maven.repository.redhat.com/ga/" m2compatible="true"/>
</chain>
</resolvers>
I use the search facilities at http://mvnrepository.com/ . This lists where a library/artefact can be found.

Ivy appears to fetch javadoc jars only

I'm using Ivy on my project, with the Ivy Eclipse plugin.
It appears that certain jars which are downloaded and added to my project are the javadoc jars, not the jars with the actual code. Note - this doesn't happen with all jars.
For example, adding this to my ivy.xml file:
<dependency org="junit" name="junit" rev="4.8.2"/>
caused the javadocs for junit to be downloaded and added to my classpath:
This breaks compilation for my project, as none of the unit tests are working.
This was working fine until I added a reference to Spring, and everything broke. I've tried removing the reference, and deleting junit from my local cache to force ivy to fetch it again, but the problem persists.
Here's my total dependency block (with spring removed):
<dependencies>
<dependency org="org.hamcrest" name="hamcrest-library" rev="1.3.RC2"/>
<dependency org="junit" name="junit" rev="4.8.2"/>
<dependency org="org.mockito" name="mockito-core" rev="1.8.5"/>
<dependency org="javax.persistence" name="persistence-api" rev="1.0"/>
</dependencies>
Here's my ivysettings.xml for the project:
<ivysettings>
<caches artifactPattern="[organisation]/[module]/[revision]/[artifact].[ext]" />
<settings defaultResolver="local.ibiblio.jboss.java-net.springsource" checkUpToDate="true" />
<resolvers>
<chain name="local.ibiblio.jboss.java-net.springsource">
<filesystem name="libraries">
<artifact pattern="${basedir}/ivy-repo/[artifact]-[revision].[type]" />
</filesystem>
<ibiblio name="ibiblio" m2compatible="true" />
<ibiblio name="jboss" m2compatible="true"
root="https://repository.jboss.org/nexus/content/groups/public-jboss" />
<ibiblio name="java.net" m2compatible="true"
root="https://repository.jboss.org/nexus/content/repositories/java.net-m2/" />
<ibiblio name="java.net" m2compatible="true"
root="http://repository.codehaus.org/" />
<url name="com.springsource.repository.libraries.release">
<ivy pattern="http://repository.springsource.com/ivy/libraries/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/libraries/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.libraries.external">
<ivy pattern="http://repository.springsource.com/ivy/libraries/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/libraries/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.bundles.release">
<ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.bundles.external">
<ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
</chain>
</resolvers>
</ivysettings>
Some open source modules include optional java doc jars. To remove them add a configuration mapping to each of your dependencies:
<dependency org="junit" name="junit" rev="4.8.2" conf="default"/>
The default configuration in ivy is equivalent to the the compile scope in a maven module. This is how the optional libraries can be automatically omitted. (Check their POMs).
A better approach is to declare your own configurations and the default mapping as follows:
<configurations defaultconfmapping="compile->default">
<conf name="compile" description="Required to compile code"/>
<conf name="test" description="Additional test dependencies" extends="compile" />
</configurations>
Then in your ivy file you only need to declare the non-standard configurations:
<dependencies>
<dependency org="org.hamcrest" name="hamcrest-library" rev="1.3.RC2" conf="test->default"/>
<dependency org="junit" name="junit" rev="4.8.2" conf="test->default"/>
<dependency org="org.mockito" name="mockito-core" rev="1.8.5" conf="test->default"/>
<dependency org="javax.persistence" name="persistence-api" rev="1.0"/>
</dependencies>
In this case we only want the 3 test libraries to appear on the test configuration.
Still confused? The magic of ivy configurations is when you use them to manage your build's class path
<target name='dependencies' description='Resolve project dependencies and set classpaths'>
<ivy:resolve/>
<ivy:cachepath pathid="compile.path" conf="compile"/>
<ivy:cachepath pathid="test.path" conf="test"/>
</target>
This is what Maven is doing when you declare a scope tag on a dependency, for example:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
The scopes in Maven are fixed. In ivy you can have as many as you need.

Categories

Resources