0

trying to use browsermob proxy server by falling code:

    final int port = 9000;
        server  = new ProxyServer(port);
        server.start();         
        final DesiredCapabilities dc = new DesiredCapabilities();
        dc.setCapability(CapabilityType.PROXY, server.seleniumProxy());         
        setName("test");
        FirefoxBinary binary = new FirefoxBinary(new File("C:\\Program Files (x86)\\ff21\\firefox.exe"));
        File profileDir = new File("C:\\Users\\arno\\Documents\\profiles\\firefox21.default");
        FirefoxProfile profile = new FirefoxProfile(profileDir);
        driver = new FirefoxDriver(binary, profile, dc);//;
        server.newHar("monitis");

but it crashes the website: see the capture .

I'm using the fallowing code to find out what is going on(getting the url and the http status )

Har har = server.getHar();

            for(HarEntry entry : har.getLog().getEntries()){
                System.out.println(entry.getRequest().getUrl() +": " + entry.getResponse().getStatus());
            }

and it gives this result:

mysite/files/js/numeral.min.js: 200
mysite/js/94842541.js: 200
mysite/files/css/page-home.min.css?v=6: -999
mysite/files/css/ui.min.css?v=18: -999
mysite/files/js/ui.min.js?also=jquery.selectric.min.js,jquery.checkradios.min.js,index.min.js&v=53: -999
Arno
  • 549
  • 1
  • 4
  • 22

2 Answers2

0

Try using the non-deprecated BrowserMobProxyServer class instead of the legacy ProxyServer implementation. Make sure you're using the latest version of BMP and the browsermob-core-littleproxy module as well.

Jason Hoetger
  • 7,543
  • 2
  • 16
  • 18
0

it turned out, that in Firefox settings, in network settings tab, I need to set up the option "auto detect proxy server for this network"

Arno
  • 549
  • 1
  • 4
  • 22