[失敗:無法聯繫Selenium服務器;你是否在'localhost:4444'上開始了它?更多詳情http://seleniumhq.org/projects/remote-control/not-started.html連接被拒絕]Selenium服務器未啓動easyb項目
嗨.. 我工作的easyb並遇到上述問題 如何啓動Selenium RC服務器。這個問題是怎麼一回事?
謝謝...
[失敗:無法聯繫Selenium服務器;你是否在'localhost:4444'上開始了它?更多詳情http://seleniumhq.org/projects/remote-control/not-started.html連接被拒絕]Selenium服務器未啓動easyb項目
嗨.. 我工作的easyb並遇到上述問題 如何啓動Selenium RC服務器。這個問題是怎麼一回事?
謝謝...
那麼你可以寫一個Groovy腳本到[您-web應用程序] /腳本/ _Events.groovy啓動和停止硒 (你將不得不安裝硒-RC插件之前有機會獲得seleniumConfig或硒服務器腳本)。
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");
}
您需要首先啓動Selenium服務器,然後才能使用該客戶端實例。
因此,在調用defaultSelenium實例創建之前,可以使用RemoteControlConfiguration(Link to javadoc)對象啓動服務器,並將其用作SeleniumServer構造函數調用的參數,然後使用serverinstance.boot()調用引導服務器。
喜歡的東西
RemoteControlConfiguration rcc = new RemoteControlConfiguration()
//set whatever values you want your rc to start with:port,logoutfile,profile etc.
SeleniumServer ss = new SeleniumServer(rcc)
ss.boot()
確保您關閉它,當你用測試來完成。