Class FirefoxProfile
java.lang.Object
org.openqa.selenium.firefox.FirefoxProfile
-
Constructor Summary
ConstructorsConstructorDescriptionFirefoxProfile(@Nullable File profileDir) Constructs a firefox profile from an existing profile directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected voidvoiddeleteExtensionsCacheIfItExists(File profileDir) protected voiddeleteLockFiles(File profileDir) static FirefoxProfileprotected org.openqa.selenium.firefox.PreferencesbooleangetBooleanPreference(String key, boolean defaultValue) intgetIntegerPreference(String key, int defaultValue) getStringPreference(String key, String defaultValue) Call this to cause the current profile to be written to disk.setPreference(String key, Object value) voidupdateUserPrefs(File userPrefs)
-
Constructor Details
-
FirefoxProfile
public FirefoxProfile() -
FirefoxProfile
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
- Throws:
IOException
-
getStringPreference
-
getIntegerPreference
-
getBooleanPreference
-
setPreference
-
getAdditionalPreferences
protected org.openqa.selenium.firefox.Preferences getAdditionalPreferences() -
updateUserPrefs
-
deleteLockFiles
-
deleteExtensionsCacheIfItExists
-
clean
-
cleanTemporaryModel
public void cleanTemporaryModel() -
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
- Throws:
IOException
-