title: Changing the user agent using selenium webdriver in Java
body: <p>Can someone pls tell me how to switch the user agent using webdriver in Java?
  I tried below, but getting errors.</p>
  
  <pre><code>FirefoxProfile ffp = new FirefoxProfile(); 
  ffp.setPreference("general.useragent.override",
  "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0");
  WebDriver fd = new FirefoxDriver(ffp);
  </code></pre>