title: Browser is not opening when running Jenkins as a service
body: <p>I am running my selenium tests in IE in a Windows VM with the help of Jenkins. When running java -jar jenkins.war, my suite is working fine..</p>
  
  <p>But when Jenkins is running as a service, browser is not opening and always it is failing.</p>
  
  <p>I have opened the service properties and given Allow service to interact with desktop.</p>
  
  <p>The alternate way I am running java -jar jenkins.war as a start up.. But this is starting jenkins when I login VM but if some circumstances due to windows patch update if machine gets restarted this is not working until I login the VM which is not i want. </p>
  
  <pre><code>Driver info: org.openqa.selenium.chrome.ChromeDriver
  Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73), userDataDir=C:\Windows\TEMP\scoped_dir6052_18573}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=70.0.3538.102, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=false, acceptInsecureCerts=false, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
  Session ID: e6ef32b1e294ce9644a5078d9b8bf8c4
  Failed ***********
  Started InternetExplorerDriver server (32-bit)
  2.51.0.0
  Listening on port 45007
  Only local connections are allowed
  org.openqa.selenium.UnhandledAlertException: Modal dialog present: 
  Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15'
  System info: host: 'xx-xx-xx', ip: 'xx.xx.xxx.xxx', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_191'
  Driver info: org.openqa.selenium.ie.InternetExplorerDriver
  Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:45007/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
  Session ID: dbbe2316-a3b3-4e39-82e3-04dae698ec73
  Nov 16, 2018 6:17:43 PM org.openqa.selenium.support.ui.ExpectedConditions findElement
  WARNING: WebDriverException thrown by findElement(By.id: txtUserName)
  org.openqa.selenium.UnhandledAlertException: Modal dialog present: 
  Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15'
  System info: host: 'xxx-xx-xx', ip: 'xx.xx.xxx.xxx', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_191'
  Driver info: org.openqa.selenium.ie.InternetExplorerDriver
  </code></pre>