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,
net.lightbody.bmp.BrowserMobProxy proxy) |
| 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
|
net.lightbody.bmp.BrowserMobProxy |
getProxy()
Method return current instance of browser mob proxy
|
boolean |
isStarted() |
<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() |
public SelenideProxyServer(Config config, org.openqa.selenium.Proxy outsideProxy)
outsideProxy - another proxy server used by test author for his own need (can be null)protected SelenideProxyServer(Config config, org.openqa.selenium.Proxy outsideProxy, InetAddressResolver inetAddressResolver, net.lightbody.bmp.BrowserMobProxy proxy)
public void start()
public boolean isStarted()
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 net.lightbody.bmp.BrowserMobProxy getProxy()
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)