public class SelenideProxyServer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected org.openqa.selenium.Proxy |
outsideProxy |
protected int |
port |
protected net.lightbody.bmp.BrowserMobProxy |
proxy |
protected java.util.Map<java.lang.String,net.lightbody.bmp.filters.RequestFilter> |
requestFilters |
protected java.util.Map<java.lang.String,net.lightbody.bmp.filters.ResponseFilter> |
responseFilters |
| Constructor and Description |
|---|
SelenideProxyServer(org.openqa.selenium.Proxy outsideProxy)
Create server
Note that server is not started nor activated yet.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRequestFilter(java.lang.String name,
net.lightbody.bmp.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,
net.lightbody.bmp.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
|
<T extends net.lightbody.bmp.filters.RequestFilter> |
requestFilter(java.lang.String name)
Get request filter by name
|
<T extends net.lightbody.bmp.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() |
protected final org.openqa.selenium.Proxy outsideProxy
protected net.lightbody.bmp.BrowserMobProxy proxy
protected int port
protected java.util.Map<java.lang.String,net.lightbody.bmp.filters.RequestFilter> requestFilters
protected java.util.Map<java.lang.String,net.lightbody.bmp.filters.ResponseFilter> responseFilters
public SelenideProxyServer(org.openqa.selenium.Proxy outsideProxy)
outsideProxy - another proxy server used by test author for his own need (can be null)public void start()
public void addRequestFilter(java.lang.String name,
net.lightbody.bmp.filters.RequestFilter requestFilter)
name - unique name of filterrequestFilter - the filterpublic void addResponseFilter(java.lang.String name,
net.lightbody.bmp.filters.ResponseFilter responseFilter)
name - unique name of filterresponseFilter - the filterpublic org.openqa.selenium.Proxy createSeleniumProxy()
public void shutdown()
public java.lang.String toString()
toString in class java.lang.Objectpublic <T extends net.lightbody.bmp.filters.RequestFilter> T requestFilter(java.lang.String name)
public <T extends net.lightbody.bmp.filters.ResponseFilter> T responseFilter(java.lang.String name)