public class NewProfileExtensionConnection extends java.lang.Object implements ExtensionConnection, org.openqa.selenium.logging.NeedsLocalLogs
Modifier and Type | Field and Description |
---|---|
private long |
connectTimeout |
private org.openqa.selenium.remote.HttpCommandExecutor |
delegate |
private java.lang.String |
host |
private org.openqa.selenium.internal.Lock |
lock |
private org.openqa.selenium.logging.LocalLogs |
logs |
private static org.openqa.selenium.net.NetworkUtils |
networkUtils |
private FirefoxBinary |
process |
private FirefoxProfile |
profile |
private java.io.File |
profileDir |
Constructor and Description |
---|
NewProfileExtensionConnection(org.openqa.selenium.internal.Lock lock,
FirefoxBinary binary,
FirefoxProfile profile,
java.lang.String host) |
Modifier and Type | Method and Description |
---|---|
protected void |
addWebDriverExtensionIfNeeded() |
private static java.net.URL |
buildUrl(java.lang.String host,
int port)
Builds the URL for the Firefox extension running on the given host and port.
|
protected int |
determineNextFreePort(int port) |
org.openqa.selenium.remote.Response |
execute(org.openqa.selenium.remote.Command command) |
java.net.URI |
getAddressOfRemoteServer() |
boolean |
isConnected() |
private static java.util.Optional<Extension> |
loadCustomExtension() |
private static Extension |
loadDefaultExtension() |
void |
quit()
Terminates the connection.
|
void |
setLocalLogs(org.openqa.selenium.logging.LocalLogs logs) |
void |
start()
Establishes a connection to the extension.
|
private static final org.openqa.selenium.net.NetworkUtils networkUtils
private final long connectTimeout
private final FirefoxBinary process
private final FirefoxProfile profile
private final java.lang.String host
private final org.openqa.selenium.internal.Lock lock
private java.io.File profileDir
private org.openqa.selenium.remote.HttpCommandExecutor delegate
private org.openqa.selenium.logging.LocalLogs logs
public NewProfileExtensionConnection(org.openqa.selenium.internal.Lock lock, FirefoxBinary binary, FirefoxProfile profile, java.lang.String host) throws java.lang.Exception
java.lang.Exception
public void start() throws java.io.IOException
ExtensionConnection
start
in interface ExtensionConnection
java.io.IOException
- If an I/O error occurs.protected void addWebDriverExtensionIfNeeded()
private static java.util.Optional<Extension> loadCustomExtension()
private static Extension loadDefaultExtension()
public org.openqa.selenium.remote.Response execute(org.openqa.selenium.remote.Command command) throws java.io.IOException
execute
in interface org.openqa.selenium.remote.CommandExecutor
java.io.IOException
protected int determineNextFreePort(int port)
public void quit()
ExtensionConnection
quit
in interface ExtensionConnection
private static java.net.URL buildUrl(java.lang.String host, int port)
localhost
, an attempt will be made to find the correct loopback address.host
- The hostname the extension is running on.port
- The port the extension is listening on.public boolean isConnected()
isConnected
in interface ExtensionConnection
public void setLocalLogs(org.openqa.selenium.logging.LocalLogs logs)
setLocalLogs
in interface org.openqa.selenium.logging.NeedsLocalLogs
public java.net.URI getAddressOfRemoteServer()
getAddressOfRemoteServer
in interface ExtensionConnection