Recently Updated - January 08, 2017
This post demonstrates how to set Chrome, Firefox and PhantomJS's User Agent using Selenium WebDriver C# and Ruby bindings.
Mac OS Sierra, Ruby 2.3.1p112, Selenium 3.0.5, ChromDriver 2.26, GeckoDriver 0.13
Firefox 50.1, Chrome 55, PhantomJS 1.9.8
Example User Agent (ipad):
Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
Sadly but as expected, IE doesn't allow Selenium WebDriver to override the User Agent natively. Quote from IE driver's developer Jim Evans:
The IE driver does not support changing the user agent, using capabilities or otherwise. Full stop.