Search code examples
javaubuntuseleniumeasyb

Selenium server is not starting for easyb project


[FAILURE: Could not contact Selenium Server; have you started it on 'localhost:4444' ? Read more at http://seleniumhq.org/projects/remote-control/not-started.html Connection refused]

Hi.. I am working on easyB and encounters the above problem how can start the selenium rc server and what this problem is all about?

Thanks...


Solution

  • Well you could write a groovy script into [your-webapp]/scripts/_Events.groovy to start and stop selenium (You would have to install selenium-rc plugin before to have access to the seleniumConfig or selenium Server scripts. )

       includeTargets << new File("$seleniumRcPluginDir/scripts/_SeleniumConfig.groovy")
    includeTargets << new File("$seleniumRcPluginDir/scripts/_SeleniumServer.groovy")
    
    eventTestPhaseStart = { phase ->
        if(isAcceptance(phase)){
          startSeleniumServer()
        }
    }
    eventTestPhaseEnd = { phase ->
        if(isAcceptance(phase)){
          stopSeleniumServer()
        }
    }
    isAcceptance = { phase->
         phase?.contains("acceptance");
    }