我正在尝试通过 Jenkins 运行 rake 任务。我已经安装了插件。当我运行该任务时,它会遇到一行代码,该代码会杀死所有现有的 IE 实例,但是下一行创建 IE 的新实例似乎没有被命中。我已经通过命令提示符运行了任务,并且以这种方式运行良好。
这是我遇到问题的代码片段:
case ENV['BROWSER']
when "IE"
`taskkill /im iexplore.exe /f /t >nul 2>&1` #Runs this line
@browser = Watir::Browser.new :ie #Doesn't run this line
when "FIREFOX"
`taskkill /im firefox.exe /f /t >nul 2>&1`
@browser = Watir::Browser.new :firefox
when "CHROME"
`taskkill /im chrome.exe /f /t >nul 2>&1`
@browser = Watir::Browser.new :chrome
else
puts "Cue Ragemonkey.... Someone changed the names of the browser!!!"
结尾
编辑/回答:
好的,这就是我为使其正常工作所做的工作...事实证明,因为我将 Jenkins 作为服务运行,它正在将其作为系统启动...它不太喜欢那样,所以我更改了服务以在我的profile,我可以毫无问题地开始我的测试。