Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to automate some testing of calls we make to an external service. I've gotten Browsermob-proxy and selenium to play together nicely. I'd now like to monitor the requests as they occur, however I am receiving a ConcurrentModificationException in line 5 of the below loop:

while (!found) {
    har = server.getHar();
    HarLog harLog = har.getLog();
    List<HarEntry> entries = harLog.getEntries();
    for (HarEntry entry : entries) { //Exception occurs on this line
        for (HarNameValuePair queryData : entry.getRequest().getQueryString()) {
            found = (queryData.getName().compareToIgnoreCase("events") == 0)
                 && (queryData.getValue().contains("event5"));
            if (found) {
               //Do some processing & break out

Is this something I should be doing with a HttpRequestInterceptor instead?

A slight modification to the example will allow this code to work:

List<HarEntry> entries = new CopyOnWriteArrayList<HarEntry>(harLog.getEntries());
share|improve this question
up vote 3 down vote accepted

I created Issue 39, due to the request made at browsermob-proxy google group.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.