title: How to set window-size to fullscreen for headless-chrome using chrome options?
body: <p>When executing UI tests, I get an error that selenium doesn't support automatic window resizing for chromedriver, which results in tests failing.</p>
  
  <p>Is there a way to set this using chrome-options for <code>headless-chrome</code> ?</p>
  
  <p>I have tried the following, </p>
  
  <pre><code>ChromeOptions options = new ChromeOptions();
  options.addArguments("--start-maximized");
  </code></pre>
  
  <p>Also, replacing <code>"--start-maximized"</code> with <code>"--start-fullscreen"</code> and <code>"--kiosk"</code>.</p>
  
  <p>But none of the above worked for me, the only option that works for me is <code>"--window-size=width,height"</code>.</p>
  
  <p>I do not want to hard-code values for width and height, is there some way I can do this to set fullscreen ?  </p>