[失败:无法联系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()
确保您关闭它,当你用测试来完成。