public static WebDriver getFirefoxDriverWithUserAgent ( final String userAgent ) { ProfilesIni allProfiles = new ProfilesIni ( ) ; FirefoxProfile profile = allProfiles . getProfile ( "default" ) ; profile . setPreference ( "general.useragent.override" , userAgent ) ; profile . setAcceptUntrustedCertificates ( true ) ; profile . setAssumeUntrustedCertificateIssuer ( true ) ; WebDriver driver = new FirefoxDriver ( profile ) ; return driver ; }
Creates a FirefoxDriver that has the supplied user agent .