how to use browsermob proxy in webdriver?

1,992 views
Skip to first unread message

Madhu

unread,
Apr 20, 2011, 1:57:54 PM4/20/11
to BrowserMob Proxy
Hi Patrick L

Is the current released version of browsermob proxy works with
webdriver? Could you please share an example. I would be interested in
getting hold of http request/response in webdriver 2.0(either in java
or ruby bindings)

Thank you,
Madhu

Patrick Lightbody

unread,
May 31, 2011, 1:07:52 AM5/31/11
to browserm...@googlegroups.com
Madhu,
I just pushed a few changes and added a bunch of documentation that shows some of what you're asking for. Before we release 2.0 final we're going to want to open up the full API via REST, but the README now includes examples on how to do what you're looking for with Java.

Readme here:
https://github.com/lightbody/browsermob-proxy

Download here:
https://browsermob.s3.amazonaws.com/proxy/browsermob-proxy-2.0-SNAPSHOT-bin.zip

Let me know if you have any question!

Patrick

--
Patrick Lightbody
+1 (415) 830-5488

Pooja Shah

unread,
Apr 13, 2016, 6:54:07 AM4/13/16
to BrowserMob Proxy, pat...@lightbody.net
Hi Patrick,

Have just tried using 2.0 with webdriver- 2.53 but there is dependency mismatch & it fails with this follwing while using Har object (har.writeTo(fObject)):

INFO 04/13 10:43:45 o.b.p.j.h.HttpServer - Version Jetty/5.1.x
INFO 04/13 10:43:45 o.b.p.j.u.Container  - Started HttpContext[/,/]
INFO 04/13 10:43:45 o.b.p.j.h.SocketLis~ - Started SocketListener on 0.0.0.0:4441
INFO 04/13 10:43:45 o.b.p.j.u.Container  - Started org.browsermob.proxy.jetty.jetty.Server@7229724f
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/jackson/map/ObjectMapper
    at org.browsermob.core.har.Har.writeTo(Har.java:34)

    at NetworkCapture_broswerMob.main(NetworkCapture_broswerMob.java:46)
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.ObjectMapper
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 2 more

Note: and on specifically adding jar jackson-mapper-asl jar it fails with another dependecy error on
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/jackson/Versioned

Can you please tell what are the right versions of each dependencies I need to use?
Attached the code & jar to try & reproduce error quickly.

Thanks,
Pooja
NetworkCapture_broswerMob.java
browsermob-proxy-2.0-SNAPSHOT.jar
browsermob-proxy-2.0-beta-6.jar

Pooja Shah

unread,
Apr 13, 2016, 7:20:00 AM4/13/16
to BrowserMob Proxy, pat...@lightbody.net
ok, after few trials & tracking the dependencies, figured it out. Needed 1.7.1 of jackson though latest is 1.9.x
jackson-core-asl-1.7.1.jar
jackson-mapper-asl-1.7.1.jar

( we should update the browser-mob's dependencies  to avoid this issue for others, please let me know if I can contribute for the same.)

Cheers!
Pooja

Krishnan mahadevan

unread,
Apr 13, 2016, 7:38:11 AM4/13/16
to browserm...@googlegroups.com
Pooja

I think it would be good if you could please help raise a pull request for this.

-Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else"

From: Pooja Shah
Sent: ‎13-‎04-‎2016 16:50
To: BrowserMob Proxy
Cc: pat...@lightbody.net
Subject: Re: how to use browsermob proxy in webdriver?

--

---
You received this message because you are subscribed to the Google Groups "BrowserMob Proxy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browsermob-pro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages