class Profile
webdriver.Serializable
└ Profile
Models a Firefox proifle directory for use with the FirefoxDriver. The
Proifle
directory uses an in-memory model until #writeToDisk
is called.
new Profile(opt_dir)
Parameters
- opt_dir
string=
Path to an existing Firefox profile directory to
use a template for this profile. If not specified, a blank profile will
be used.
Instance Methods
acceptUntrustedCerts()code »
Returns
boolean
Whether the FirefoxDriver is configured to automatically
accept untrusted SSL certificates.
addExtension(extension)code »
Registers an extension to be included with this profile.
Parameters
- extension
string
Path to the extension to include, as either an
unpacked extension directory or the path to a xpi file.
assumeUntrustedCertIssuer()code »
Returns
boolean
Whether to assume untrusted certs come from untrusted
issuers.
Encodes this profile as a zipped, base64 encoded directory.
Returns
number
The port this profile is currently configured to use, or
0 if the port will be selected at random when the profile is written
to disk.
getPreference(key)code »
Returns the currently configured value of a profile preference. This does
not include any defaults defined in the profile's template directory user.js
file (if a template were specified on construction).
Parameters
- key
string
The desired preference.
nativeEventsEnabled()code »
Returns whether native events are enabled in this profile.
setAcceptUntrustedCerts(value)code »
Sets whether the FirefoxDriver should automatically accept untrusted SSL
certificates.
setAssumeUntrustedCertIssuer(value)code »
Sets whether to assume untrusted certificates come from untrusted issuers.
setNativeEventsEnabled(enabled)code »
Sets whether to use native events with this profile.
setPort(port)code »
Sets the port to use for the WebDriver extension loaded by this profile.
Parameters
- port
number
The desired port, or 0 to use any free port.
setPreference(key, value)code »
Sets a desired preference for this profile.
Throws
Error
If attempting to set a frozen preference.
writeToDisk(opt_excludeWebDriverExt)code »
Writes this profile to disk.
Parameters
- opt_excludeWebDriverExt
boolean=
Whether to exclude the WebDriver
extension from the generated profile. Used to reduce the size of an
encoded profile
since the server will always install
the extension itself.