« Return to Thread: Running selenium

Running selenium

by cressie176 :: Rate this Message:

Reply to Author | View in Thread

I'm writing a noddy web app to evaluate whether I can use gradle on future java/groovy projects. So far I can start up jetty and run the app, but am struggling to launch selenium. Our existing build system has (among others) a RunSelenium.groovy script which I'd like to reuse. With a lot of functionality removed the script boils down to something like this...
task runSelenium << {
   File report = new File('test/selenium/report/suite.html')
   File suite = new File('test/selenium/selenese/suite.html')
   
   def server = new org.openqa.selenium.server.SeleniumServer()
   server.start()
    
    def launcher = new org.openqa.selenium.server.htmlrunner.HTMLLauncher(server)
    if (launcher.runHTMLSuite('*firefox', 'http://localhost:8080/blah', suite, report, 10000, false) == 'PASSED') {
        println "YIP!"
    }	
}
The problem I'm getting is that org.openqa.selenium.server.SeleniumServer is not on the classpath. I added it via settings.gradle
mavenRepo urls: ['http://archiva.openqa.org/repository/snapshots/']
dependencies 'org.openqa.selenium.server:selenium-server:1.0-SNAPSHOT'
but this resulted in
Execution failed for task ':runSelenium'.
Cause: sealing violation: can't seal package org.mortbay.util: already loaded
which I'm guessing is some class loading conflict between gradle and selenium. I've seen posts explaining how to do this using ant.java, but we've got a lot of custom functionality in our existing build scripts and I'd like to re-use them if possible.

 « Return to Thread: Running selenium