C# Класс OpenQA.Selenium.Firefox.FirefoxProfile

Provides the ability to edit the preferences associated with a Firefox profile.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddExtension ( string extensionToInstall ) : void

Adds a Firefox Extension to this profile

Clean ( ) : void

Cleans this Firefox profile.

If this profile is a named profile that existed prior to launching Firefox, the Clean method removes the WebDriver Firefox extension. If the profile is an anonymous profile, the profile is deleted.

FirefoxProfile ( ) : System

Initializes a new instance of the FirefoxProfile class.

FirefoxProfile ( string profileDirectory ) : System

Initializes a new instance of the FirefoxProfile class using a specific profile directory.

FirefoxProfile ( string profileDirectory, bool deleteSourceOnClean ) : System

Initializes a new instance of the FirefoxProfile class using a specific profile directory.

FromBase64String ( string base64 ) : FirefoxProfile

Converts a base64-encoded string into a FirefoxProfile.

SetPreference ( string name, bool value ) : void

Sets a preference in the profile.

SetPreference ( string name, int value ) : void

Sets a preference in the profile.

SetPreference ( string name, string value ) : void

Sets a preference in the profile.

ToBase64String ( ) : string

Converts the profile into a base64-encoded string.

WriteToDisk ( ) : void

Writes this in-memory representation of a profile to disk.

Приватные методы

Метод Описание
AddDefaultPreference ( string>.Dictionary preferences, string name, string value ) : void

Adds a preference to the profile.

AddWebDriverExtension ( ) : void

Adds the WebDriver extension for Firefox to the profile.

DeleteExtensionsCache ( ) : void

Deletes the cache of extensions for this profile, if the cache exists.

If the extensions cache does not exist for this profile, the DeleteExtensionsCache method performs no operations, but succeeds.

DeleteLockFiles ( ) : void

Deletes the lock files for a profile.

GenerateProfileDirectoryName ( ) : string

Generates a random directory name for the profile.

InstallExtensions ( ) : void

Installs all extensions in the profile in the directory on disk.

ReadExistingPreferences ( ) : string>.Dictionary

Reads the existing preferences from the profile.

Assumes that we only really care about the preferences, not the comments

UpdateUserPreferences ( ) : void

Writes the user preferences to the profile.

WriteNewPreferences ( string>.Dictionary preferences ) : void

Writes the specified preferences to the user preferences file.

Описание методов

AddExtension() публичный Метод

Adds a Firefox Extension to this profile
public AddExtension ( string extensionToInstall ) : void
extensionToInstall string The path to the new extension
Результат void

Clean() публичный Метод

Cleans this Firefox profile.
If this profile is a named profile that existed prior to launching Firefox, the Clean method removes the WebDriver Firefox extension. If the profile is an anonymous profile, the profile is deleted.
public Clean ( ) : void
Результат void

FirefoxProfile() публичный Метод

Initializes a new instance of the FirefoxProfile class.
public FirefoxProfile ( ) : System
Результат System

FirefoxProfile() публичный Метод

Initializes a new instance of the FirefoxProfile class using a specific profile directory.
public FirefoxProfile ( string profileDirectory ) : System
profileDirectory string The directory containing the profile.
Результат System

FirefoxProfile() публичный Метод

Initializes a new instance of the FirefoxProfile class using a specific profile directory.
public FirefoxProfile ( string profileDirectory, bool deleteSourceOnClean ) : System
profileDirectory string The directory containing the profile.
deleteSourceOnClean bool Delete the source directory of the profile upon cleaning.
Результат System

FromBase64String() публичный статический Метод

Converts a base64-encoded string into a FirefoxProfile.
public static FromBase64String ( string base64 ) : FirefoxProfile
base64 string The base64-encoded string containing the profile contents.
Результат FirefoxProfile

SetPreference() публичный Метод

Sets a preference in the profile.
public SetPreference ( string name, bool value ) : void
name string The name of the preference to add.
value bool A value to add to the profile.
Результат void

SetPreference() публичный Метод

Sets a preference in the profile.
public SetPreference ( string name, int value ) : void
name string The name of the preference to add.
value int A value to add to the profile.
Результат void

SetPreference() публичный Метод

Sets a preference in the profile.
public SetPreference ( string name, string value ) : void
name string The name of the preference to add.
value string A value to add to the profile.
Результат void

ToBase64String() публичный Метод

Converts the profile into a base64-encoded string.
public ToBase64String ( ) : string
Результат string

WriteToDisk() публичный Метод

Writes this in-memory representation of a profile to disk.
public WriteToDisk ( ) : void
Результат void