Class FirefoxProfile

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

public class FirefoxProfile extends Object
  • Constructor Details

    • FirefoxProfile

      public FirefoxProfile()
    • FirefoxProfile

      public FirefoxProfile(@Nullable File profileDir)
      Constructs a firefox profile from an existing profile directory.

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

      Parameters:
      profileDir - The profile directory to use as a model.
  • Method Details

    • fromJson

      public static FirefoxProfile fromJson(String json) throws IOException
      Throws:
      IOException
    • getStringPreference

      public String getStringPreference(String key, String defaultValue)
    • getIntegerPreference

      public int getIntegerPreference(String key, int defaultValue)
    • getBooleanPreference

      public boolean getBooleanPreference(String key, boolean defaultValue)
    • setPreference

      public FirefoxProfile setPreference(String key, Object value)
    • getAdditionalPreferences

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

      public void updateUserPrefs(File userPrefs)
    • deleteLockFiles

      protected void deleteLockFiles(File profileDir)
    • deleteExtensionsCacheIfItExists

      public void deleteExtensionsCacheIfItExists(File profileDir)
    • clean

      public void clean(@Nullable File profileDir)
    • cleanTemporaryModel

      public void cleanTemporaryModel()
    • layoutOnDisk

      public File layoutOnDisk()
      Call this to cause the current profile to be written to disk. The profile directory is returned. Note that this profile directory is a temporary one and will be deleted when the JVM exists (at the latest)

      This method should be called immediately before starting to use the profile and should only be called once per instance of the FirefoxDriver.

      Returns:
      The directory containing the profile.
    • copyModel

      protected void copyModel(@Nullable File sourceDir, File profileDir) throws IOException
      Throws:
      IOException