title: Selenium - Mobile Emulation - how do I add user Agent to Chrome options while automating the emulator?
body: <p>Below are the capabilities I added. I am getting a Google reCAPTCHA
  in my website which can be trespassed by adding user agent.</p>
  
  <p>But even after the addition of user agent I am still getting the captcha. Is there another way to add it?</p>
  
  <pre><code>Map&lt;String, String&gt; mobileEmulation = new HashMap&lt;&gt;();
  mobileEmulation.put("deviceName", "Pixel 2");
  
  Map&lt;String, Object&gt; chromeOptions = new HashMap&lt;&gt;();
  chromeOptions.put("mobileEmulation", mobileEmulation);
  
  chromeOptions.put("args",
                    Arrays.asList("disable-bundled-ppapi-flash",
                    "disable-extensions",
                    "profile-directory=Default",
                    "disable-plugins-discovery",
                    "--user-agent=" + userAgent));
  
  ChromeOptions co = new ChromeOptions();
  co.addArguments("mobileEmulation="+mobileEmulation);
  
  DesiredCapabilities capabilities = DesiredCapabilities.chrome();
  capabilities.setCapability(ChromeOptions.CAPABILITY,chromeOptions);
  
  System.setProperty("webdriver.chrome.driver", RunConfig.CHROME_DRIVER_EXE);
  
  driver = new ChromeDriver(capabilities);
  </code></pre>