@ParametersAreNonnullByDefault
public class SelenideProxyServer
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
|
SelenideProxyServer(Config config,
org.openqa.selenium.Proxy outsideProxy)
Create server
Note that server is not started nor activated yet.
|
protected |
SelenideProxyServer(Config config,
org.openqa.selenium.Proxy outsideProxy,
InetAddressResolver inetAddressResolver,
com.browserup.bup.BrowserUpProxy proxy) |
Modifier and Type | Method and Description |
---|---|
void |
addRequestFilter(java.lang.String name,
com.browserup.bup.filters.RequestFilter requestFilter)
Add a custom request filter which allows to track/modify all requests from browser to server
|
void |
addResponseFilter(java.lang.String name,
com.browserup.bup.filters.ResponseFilter responseFilter)
Add a custom response filter which allows to track/modify all server responses to browser
|
org.openqa.selenium.Proxy |
createSeleniumProxy()
Converts this proxy to a "selenium" proxy that can be used by webdriver
|
com.browserup.bup.BrowserUpProxy |
getProxy()
Method return current instance of browser up proxy
|
boolean |
isStarted() |
<T extends com.browserup.bup.filters.RequestFilter> |
requestFilter(java.lang.String name)
Get request filter by name
|
<T extends com.browserup.bup.filters.ResponseFilter> |
responseFilter(java.lang.String name)
Get response filter by name
By default, the only one filter "download" is available.
|
void |
shutdown()
Stop the server
|
void |
start()
Start the server
It automatically adds one response filter "download" that can intercept downloaded files.
|
java.lang.String |
toString() |
public SelenideProxyServer(Config config, @Nullable org.openqa.selenium.Proxy outsideProxy)
outsideProxy
- another proxy server used by test author for his own need (can be null)protected SelenideProxyServer(Config config, @Nullable org.openqa.selenium.Proxy outsideProxy, InetAddressResolver inetAddressResolver, com.browserup.bup.BrowserUpProxy proxy)
public void start()
@CheckReturnValue public boolean isStarted()
public void addRequestFilter(java.lang.String name, com.browserup.bup.filters.RequestFilter requestFilter)
name
- unique name of filterrequestFilter
- the filterpublic void addResponseFilter(java.lang.String name, com.browserup.bup.filters.ResponseFilter responseFilter)
name
- unique name of filterresponseFilter
- the filter@CheckReturnValue @Nonnull public org.openqa.selenium.Proxy createSeleniumProxy()
public void shutdown()
@CheckReturnValue @Nonnull public com.browserup.bup.BrowserUpProxy getProxy()
@CheckReturnValue @Nonnull public java.lang.String toString()
toString
in class java.lang.Object
@CheckReturnValue @Nullable public <T extends com.browserup.bup.filters.RequestFilter> T requestFilter(java.lang.String name)
@CheckReturnValue @Nullable public <T extends com.browserup.bup.filters.ResponseFilter> T responseFilter(java.lang.String name)