org.openqa.selenium.firefox
Class FirefoxProfile

java.lang.Object
  extended by org.openqa.selenium.firefox.FirefoxProfile

public class FirefoxProfile
extends java.lang.Object


Constructor Summary
  FirefoxProfile()
           
protected FirefoxProfile(java.io.File profileDir)
          Constructs a firefox profile from an existing, physical profile directory.
 
Method Summary
 java.io.File addExtension(java.lang.Class<?> loadResourcesUsing, java.lang.String loadFrom)
           
 void addExtension(java.io.File extensionToInstall)
          Attempt to add an extension to install into this instance.
protected  void addWebDriverExtensionIfNeeded(boolean forceCreation)
           
 boolean alwaysLoadNoFocusLib()
          Returns whether the no focus library should be loaded for Firefox profiles launched on Linux, even if native events are disabled.
 void clean()
           
 FirefoxProfile createCopy(int port)
           
 void deleteExtensionsCacheIfItExists()
           
 boolean enableNativeEvents()
           
protected  org.openqa.selenium.firefox.Preferences getAdditionalPreferences()
           
 java.io.File getExtensionsDir()
           
 int getPort()
           
 java.io.File getProfileDir()
           
protected  void installDevelopmentExtension()
           
 boolean isRunning()
           
 void setAcceptUntrustedCertificates(boolean acceptUntrustedSsl)
          Sets whether Firefox should accept SSL certificates which have expired, signed by an unknown authority or are generally untrusted.
 void setAlwaysLoadNoFocusLib(boolean loadNoFocusLib)
          Sets whether the no focus library should always be loaded on Linux.
 void setEnableNativeEvents(boolean enableNativeEvents)
           
 void setPort(int port)
           
 void setPreference(java.lang.String key, boolean value)
          Set a preference for this particular profile.
 void setPreference(java.lang.String key, int value)
          Set a preference for this particular profile.
 void setPreference(java.lang.String key, java.lang.String value)
          Set a preference for this particular profile.
 void updateUserPrefs()
           
protected  void writeNewPrefs(java.util.Map<java.lang.String,java.lang.String> prefs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirefoxProfile

protected FirefoxProfile(java.io.File profileDir)
Constructs a firefox profile from an existing, physical profile directory. Not a good idea, please don't.

Users who need this functionality should be using a named profile.

Parameters:
profileDir -

FirefoxProfile

public FirefoxProfile()
Method Detail

addWebDriverExtensionIfNeeded

protected void addWebDriverExtensionIfNeeded(boolean forceCreation)

addExtension

public java.io.File addExtension(java.lang.Class<?> loadResourcesUsing,
                                 java.lang.String loadFrom)
                          throws java.io.IOException
Throws:
java.io.IOException

addExtension

public void addExtension(java.io.File extensionToInstall)
                  throws java.io.IOException
Attempt to add an extension to install into this instance.

Parameters:
extensionToInstall -
Throws:
java.io.IOException

installDevelopmentExtension

protected void installDevelopmentExtension()
                                    throws java.io.IOException
Throws:
java.io.IOException

getProfileDir

public java.io.File getProfileDir()

getExtensionsDir

public java.io.File getExtensionsDir()

setPreference

public void setPreference(java.lang.String key,
                          java.lang.String value)
Set a preference for this particular profile. The value will be properly quoted before use. Note that if a value looks as if it is a quoted string (that is, starts with a quote character and ends with one too) an IllegalArgumentException is thrown: Firefox fails to start properly when some values are set to this.

Parameters:
key - The key
value - The new value.

setPreference

public void setPreference(java.lang.String key,
                          boolean value)
Set a preference for this particular profile.

Parameters:
key - The key
value - The new value.

setPreference

public void setPreference(java.lang.String key,
                          int value)
Set a preference for this particular profile.

Parameters:
key - The key
value - The new value.

getAdditionalPreferences

protected org.openqa.selenium.firefox.Preferences getAdditionalPreferences()

updateUserPrefs

public void updateUserPrefs()

deleteExtensionsCacheIfItExists

public void deleteExtensionsCacheIfItExists()

writeNewPrefs

protected void writeNewPrefs(java.util.Map<java.lang.String,java.lang.String> prefs)

getPort

public int getPort()

setPort

public void setPort(int port)

enableNativeEvents

public boolean enableNativeEvents()

setEnableNativeEvents

public void setEnableNativeEvents(boolean enableNativeEvents)

alwaysLoadNoFocusLib

public boolean alwaysLoadNoFocusLib()
Returns whether the no focus library should be loaded for Firefox profiles launched on Linux, even if native events are disabled.

Returns:
Whether the no focus library should always be loaded for Firefox on Linux.

setAlwaysLoadNoFocusLib

public void setAlwaysLoadNoFocusLib(boolean loadNoFocusLib)
Sets whether the no focus library should always be loaded on Linux.

Parameters:
loadNoFocusLib - Whether to always load the no focus library.

setAcceptUntrustedCertificates

public void setAcceptUntrustedCertificates(boolean acceptUntrustedSsl)
Sets whether Firefox should accept SSL certificates which have expired, signed by an unknown authority or are generally untrusted. This is set to true by defaul.t

Parameters:
acceptUntrustedSsl - Whether untrusted SSL certificates should be accepted.

isRunning

public boolean isRunning()

clean

public void clean()

createCopy

public FirefoxProfile createCopy(int port)


Copyright © 2009. All Rights Reserved.