Package org.openqa.selenium.firefox
Class FirefoxDriver
- java.lang.Object
-
- org.openqa.selenium.remote.RemoteWebDriver
-
- org.openqa.selenium.firefox.FirefoxDriver
-
- All Implemented Interfaces:
HasExtensions,org.openqa.selenium.HasCapabilities,org.openqa.selenium.html5.WebStorage,org.openqa.selenium.interactions.HasInputDevices,org.openqa.selenium.interactions.Interactive,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator,org.openqa.selenium.WebDriver
public class FirefoxDriver extends org.openqa.selenium.remote.RemoteWebDriver implements org.openqa.selenium.html5.WebStorage, HasExtensions
An implementation of the {#link WebDriver} interface that drives Firefox.The best way to construct a
FirefoxDriverwith various options is to make use of theFirefoxOptions, like so:FirefoxOptions options = new FirefoxOptions() .addPreference("browser.startup.page", 1) .addPreference("browser.startup.homepage", "https://www.google.co.uk") .setAcceptInsecureCerts(true) .setHeadless(true); WebDriver driver = new FirefoxDriver(options);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFirefoxDriver.Capabilitystatic classFirefoxDriver.SystemProperty-
Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.When
-
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
-
-
Field Summary
Fields Modifier and Type Field Description protected FirefoxBinarybinarystatic java.lang.StringBINARYDeprecated.static java.lang.StringMARIONETTEDeprecated.static java.lang.StringPROFILEDeprecated.
-
Constructor Summary
Constructors Constructor Description FirefoxDriver()FirefoxDriver(org.openqa.selenium.Capabilities desiredCapabilities)Deprecated.FirefoxDriver(FirefoxDriverService service)FirefoxDriver(FirefoxDriverService service, org.openqa.selenium.Capabilities desiredCapabilities)Deprecated.FirefoxDriver(FirefoxDriverService service, FirefoxOptions options)FirefoxDriver(FirefoxOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> XgetFullPageScreenshotAs(org.openqa.selenium.OutputType<X> outputType)Capture the full page screenshot and store it in the specified location.org.openqa.selenium.html5.LocalStoragegetLocalStorage()org.openqa.selenium.html5.SessionStoragegetSessionStorage()java.lang.StringinstallExtension(java.nio.file.Path path)Installs an extension.voidsetFileDetector(org.openqa.selenium.remote.FileDetector detector)voiduninstallExtension(java.lang.String extensionId)Uninstall the extension by the given identifier.-
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, builder, close, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElement, findElements, findElements, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getKeyboard, getMouse, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, quit, removeVirtualAuthenticator, resetInputState, setCommandExecutor, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toString
-
-
-
-
Field Detail
-
BINARY
@Deprecated public static final java.lang.String BINARY
Deprecated.- See Also:
- Constant Field Values
-
PROFILE
@Deprecated public static final java.lang.String PROFILE
Deprecated.- See Also:
- Constant Field Values
-
MARIONETTE
@Deprecated public static final java.lang.String MARIONETTE
Deprecated.- See Also:
- Constant Field Values
-
binary
protected FirefoxBinary binary
-
-
Constructor Detail
-
FirefoxDriver
public FirefoxDriver()
-
FirefoxDriver
@Deprecated public FirefoxDriver(org.openqa.selenium.Capabilities desiredCapabilities)
Deprecated.
-
FirefoxDriver
@Deprecated public FirefoxDriver(FirefoxDriverService service, org.openqa.selenium.Capabilities desiredCapabilities)
Deprecated.
-
FirefoxDriver
public FirefoxDriver(FirefoxOptions options)
-
FirefoxDriver
public FirefoxDriver(FirefoxDriverService service)
-
FirefoxDriver
public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options)
-
-
Method Detail
-
setFileDetector
public void setFileDetector(org.openqa.selenium.remote.FileDetector detector)
- Overrides:
setFileDetectorin classorg.openqa.selenium.remote.RemoteWebDriver
-
getLocalStorage
public org.openqa.selenium.html5.LocalStorage getLocalStorage()
- Specified by:
getLocalStoragein interfaceorg.openqa.selenium.html5.WebStorage
-
getSessionStorage
public org.openqa.selenium.html5.SessionStorage getSessionStorage()
- Specified by:
getSessionStoragein interfaceorg.openqa.selenium.html5.WebStorage
-
installExtension
public java.lang.String installExtension(java.nio.file.Path path)
Description copied from interface:HasExtensionsInstalls an extension.- Specified by:
installExtensionin interfaceHasExtensions- Parameters:
path- absolute path to the extension file that should be installed.- Returns:
- the unique identifier of the installed extension.
-
uninstallExtension
public void uninstallExtension(java.lang.String extensionId)
Description copied from interface:HasExtensionsUninstall the extension by the given identifier.- Specified by:
uninstallExtensionin interfaceHasExtensions- Parameters:
extensionId- The unique extension identifier returned by {HasExtensions.installExtension(Path)}
-
getFullPageScreenshotAs
public <X> X getFullPageScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverExceptionCapture the full page screenshot and store it in the specified location.- Type Parameters:
X- Return type for getFullPageScreenshotAs.- Parameters:
outputType- target type, @see OutputType- Returns:
- Object in which is stored information about the screenshot.
- Throws:
org.openqa.selenium.WebDriverException- on failure.
-
-