title: Browser is not maximized when running selenium scripts via Jenkins as windows service
body: <p>I am running my selenium scripts written in Java using chromedriver on Windows Server 2008 R2 Server VDI (acting as slave) and have done the setup as windows service. Problem is browser size is coming as(1036, 780) with no browser getting opened on UI during execution. If I run the same script on local (not via Jenkins), then the browser size would be (1554, 843) and hence the reason script is getting failed as it's not able to find the element id.</p>
  
  <p>I've tried the options below but nothing worked out for me till now.</p>
  
  <p>1) Tried to maximize the browser using the below code but still the browser size didn't changed.</p>
  
  <pre><code>Dimension d = new Dimension(1554,843);
  //Resize current window to the set dimension
  driver.manage().window().setSize(d);
  </code></pre>
  
  <p>2) Tried to run in fullscreen mode using below code.</p>
  
  <pre><code>driver.manage().window().fullscreen();
  </code></pre>
  
  <p>3) On VDI (slave), in services.msc, selected the check box 'Allow service to interact with desktop' but no result</p>
  
  <p>4) Tried to launch slave using Windows scheduler but even in this case script failed and no browser was opened on UI. Referred below link.</p>
  
  <p><a href="https://wiki.jenkins.io/display/JENKINS/Launch+Java+Web+Start+slave+agent+via+Windows+Scheduler" rel="nofollow noreferrer">https://wiki.jenkins.io/display/JENKINS/Launch+Java+Web+Start+slave+agent+via+Windows+Scheduler</a></p>
  
  <p>My requirement is to run the selenium scripts on the particular VDI (acting as slave) and the reason behind the configuration of Jenkins set up as windows service is, whenever the VDI reboots it automatically establishes the JNLP connection with slave node using slave.jar.</p>
  
  <p>Can anyone suggest me workaround for this problem. Thanks in advance.</p>