public class FirefoxBinary
extends java.lang.Object
Type | Property and Description |
---|---|
private static Executable |
locateFirefoxBinaryFromSystem
Locates the firefox binary from a system property.
|
Modifier and Type | Class and Description |
---|---|
static class |
FirefoxBinary.Channel
Enumerates Firefox channels, according to https://wiki.mozilla.org/RapidRelease
|
Modifier and Type | Field and Description |
---|---|
private Executable |
executable |
private java.util.Map<java.lang.String,java.lang.String> |
extraEnv |
private java.util.List<java.lang.String> |
extraOptions |
private static java.lang.String |
NO_FOCUS_LIBRARY_NAME |
private static java.lang.String |
PATH_PREFIX |
private org.openqa.selenium.os.CommandLine |
process |
private java.io.OutputStream |
stream |
private long |
timeout |
Constructor and Description |
---|
FirefoxBinary() |
FirefoxBinary(java.io.File pathToFirefoxBinary) |
FirefoxBinary(FirefoxBinary.Channel channel) |
FirefoxBinary(java.lang.String version)
Deprecated.
Perform the version check by taking a look at the version that comes back from the
remote end in the returned
Capabilities . |
Modifier and Type | Method and Description |
---|---|
void |
addCommandLineOptions(java.lang.String... options) |
protected java.lang.String |
extractAndCheck(java.io.File profileDir,
java.lang.String noFocusSoName,
java.lang.String jarPath32Bit,
java.lang.String jarPath64Bit) |
java.lang.String |
getConsoleOutput()
Gets all console output of the binary.
|
private java.io.OutputStream |
getDefaultOutputStream() |
java.util.Map<java.lang.String,java.lang.String> |
getExtraEnv() |
protected java.io.File |
getFile() |
protected java.lang.String |
getPath() |
long |
getTimeout() |
protected boolean |
isOnLinux() |
private static java.util.stream.Stream<Executable> |
locateFirefoxBinariesFromPlatform()
Locates the firefox binary by platform.
|
private static Executable |
locateFirefoxBinaryFromSystemProperty()
Locates the firefox binary from a system property.
|
protected void |
modifyLinkLibraryPath(java.io.File profileDir) |
void |
quit() |
void |
setEnvironmentProperty(java.lang.String propertyName,
java.lang.String value) |
void |
setOutputWatcher(java.io.OutputStream stream) |
void |
setTimeout(long timeout) |
protected void |
startFirefoxProcess(org.openqa.selenium.os.CommandLine command) |
void |
startProfile(FirefoxProfile profile,
java.io.File profileDir,
java.lang.String... commandLineFlags) |
java.lang.String |
toString() |
void |
waitFor()
Waits for the process to execute, returning the command output taken from the profile's
execution.
|
void |
waitFor(long timeout)
Waits for the process to execute, returning the command output taken from the profile's
execution.
|
private static Executable locateFirefoxBinaryFromSystemProperty
private static final java.lang.String NO_FOCUS_LIBRARY_NAME
private static final java.lang.String PATH_PREFIX
private final java.util.Map<java.lang.String,java.lang.String> extraEnv
private final java.util.List<java.lang.String> extraOptions
private final Executable executable
private org.openqa.selenium.os.CommandLine process
private java.io.OutputStream stream
private long timeout
public FirefoxBinary()
public FirefoxBinary(FirefoxBinary.Channel channel)
@Deprecated public FirefoxBinary(java.lang.String version)
Capabilities
.public FirefoxBinary(java.io.File pathToFirefoxBinary)
public void setEnvironmentProperty(java.lang.String propertyName, java.lang.String value)
public void addCommandLineOptions(java.lang.String... options)
protected boolean isOnLinux()
public void startProfile(FirefoxProfile profile, java.io.File profileDir, java.lang.String... commandLineFlags) throws java.io.IOException
java.io.IOException
protected void startFirefoxProcess(org.openqa.selenium.os.CommandLine command) throws java.io.IOException
java.io.IOException
protected java.io.File getFile()
protected java.lang.String getPath()
public java.util.Map<java.lang.String,java.lang.String> getExtraEnv()
protected void modifyLinkLibraryPath(java.io.File profileDir)
protected java.lang.String extractAndCheck(java.io.File profileDir, java.lang.String noFocusSoName, java.lang.String jarPath32Bit, java.lang.String jarPath64Bit)
public void waitFor() throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
- if we are interrupted while waiting for the process to launchjava.io.IOException
- if there is a problem with reading the input stream of the launching
processpublic void waitFor(long timeout) throws java.lang.InterruptedException, java.io.IOException
timeout
- the maximum time to wait in millisecondsjava.lang.InterruptedException
- if we are interrupted while waiting for the process to launchjava.io.IOException
- if there is a problem with reading the input stream of the launching
processpublic java.lang.String getConsoleOutput() throws java.io.IOException
java.io.IOException
- IO exception reading from the output stream of the firefox processpublic long getTimeout()
public void setTimeout(long timeout)
public java.lang.String toString()
toString
in class java.lang.Object
public void setOutputWatcher(java.io.OutputStream stream)
public void quit()
private java.io.OutputStream getDefaultOutputStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
private static Executable locateFirefoxBinaryFromSystemProperty()
private static java.util.stream.Stream<Executable> locateFirefoxBinariesFromPlatform()