Hi,
I'm using BrowserMob with Selenium2 to perform tests of my web site.
This is a completely automated setup: the site is started with Jetty
on localhost.
I'm trying to use BrowserMob to retrieve HTTP response status code/
response raw body so I set a response interceptor:
proxyServer.addResponseInterceptor(new
HttpResponseInterceptor() {
public void process(HttpResponse response,
HttpContext context) throws HttpException, IOException {
//Extract useful infos from response
}
});
But it doesn't work, the interceptor is never called. After looking at
the code it seems it is because of this part of code in
BrowserMobProxyHandler:
// We don't want localhost or selenium-related showing up
in the detailed transaction logs
if (urlStr.startsWith("
http://localhost") ||
urlStr.contains("/selenium-server/")) {
return super.proxyPlainTextRequest(url, pathInContext,
pathParams, request, response);
}
As a result all my traffic is handled by SeleniumProxyHandler that
does not honor interceptors.
Is there any solution for my problem?
Thanks