title: How to Track a specific request in Selenium using BrowserMob?
body: <p>I have implemented Selenium with <a href="https://github.com/lightbody/browsermob-proxy" rel="nofollow noreferrer">BrowserMob</a> proxy in embedded mode.</p>
  
  <p>I have also added a request and response filter to the proxy which successfully filters all the requests and responses. But how do I track a specific request, like implementing a callback function when that request receives  a response. I also need to modify few objects based on the response which cannot be set as a static variable since there would be multiple tests running simultaneously. Is there any way to achieve this.? Any help or info would be really appreciated.</p>
  
  <p>Current Filter Implementation : 
  (just added the code as in the docs)</p>
  
  <pre><code>proxy.addRequestFilter(new RequestFilter() {
          @Override
          public HttpResponse filterRequest(HttpRequest request, HttpMessageContents contents, HttpMessageInfo messageInfo) {
              if (request.getMethod() == HttpMethod.POST) {
                  /*
                   * Track this request and resume operations
                   * once the response is recieved
                   */
              }
              return null;
          }
      });
  
  proxy.addResponseFilter(new ResponseFilter() {
          @Override
          public void filterResponse(HttpResponse response, HttpMessageContents contents, HttpMessageInfo messageInfo) {
             if (/*required request receives response) {
              /*
               * should be able to pass(somehow need to access)
               * an variable to set the status  
               * 
               */
          }
      });
  </code></pre>