title: Fitting objects in window screen using Selenium Java
body: <p>I am trying to fit all the objects in the window (Chrome browser). Manually when I am doing it(the dimensions that I am using is 1024X786 using toggle bar, but when I am automating it using the same dimension, it's not showing the same as it was manually.</p>
  
  <p>The following is the code: </p>
  
  <pre><code>driver = new ChromeDriver();
  Map&lt;String, Object&gt; deviceMetrics = new HashMap&lt;String, Object&gt;();
  deviceMetrics.put("width", 768);
  deviceMetrics.put("height", 1024);
  Map&lt;String, Object&gt; mobileEmulation = new HashMap&lt;String, Object&gt;();
  mobileEmulation.put("deviceMetrics", deviceMetrics);
  mobileEmulation.put("userAgent", "Mobile S");
  Map&lt;String, Object&gt; chromeOptions = new HashMap&lt;String, Object&gt;();
  chromeOptions.put("mobileEmulation", mobileEmulation);
  DesiredCapabilities capabilities = DesiredCapabilities.chrome();
  capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
  System.out.println("Driver is now ChromeDriver");
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  </code></pre>
  
  <p>The footer is getting lost in this. What I am getting is: 
  <a href="https://i.stack.imgur.com/w9JY2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w9JY2.png" alt="enter image description here"></a></p>
  
  <p>What I am suppose to get is this:
  <a href="https://i.stack.imgur.com/vLvQp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vLvQp.png" alt="enter image description here"></a></p>
  
  <p>Another code I used is:</p>
  
  <pre><code>driver.manage().window().setSize(new Dimension(1024, 786));
  </code></pre>
  
  <p>Can anyone please help? Thanks</p>