I'm attempting to run a rake task through Jenkins. I have the plugin installed. When I run the task it hits one line of code that kills all existing instances of IE, however the very next line that creates a new instance of IE doesn't seem to be hit. I've run the task through command prompt and it runs fine when done that way.
Here's the code snippet I'm having problems with:
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!!!"
end
EDIT/ANSWER:
Ok here's what I did to get it to work... Turns out since I'm running Jenkins as a service it was kicking it off as System... It didn't quite like that so I altered the service to run under my profile and I'm able to kick off my tests without any problems.
Ok here's what I did to get it to work... Turns out since I'm running Jenkins as a service it was kicking it off as System... It didn't quite like that so I altered the service to run under my profile and I'm able to kick off my tests without any problems.