eviltester / blogcomments

1 stars 0 forks source link

webdriver/faqs/how-to-capture-http-messages/ #39

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

How to Capture HTTP Messages with WebDriver - EvilTester.com

How to capture HTTP Messages and network traffic with Selenium WebDriver and an HTTP proxy, and configure the browser to direct all traffic through the proxy.

https://www.eviltester.com/webdriver/faqs/how-to-capture-http-messages/

vhooz commented 4 years ago

this is not working. I tried your repo and when it opens chrome it shows the following message: No internetThere is something wrong with the proxy server, or the address is incorrect.

vhooz commented 4 years ago

fix it by adding the following:

    Proxy proxyConfig = ClientUtil.createSeleniumProxy(proxyServer);
    try {
        String hostIp = Inet4Address.getLocalHost().getHostAddress();
        proxyConfig.setHttpProxy(hostIp + ":" + proxyServer.getPort());
        proxyConfig.setSslProxy(hostIp + ":" + proxyServer.getPort());
    } catch (Throwable e) {
        e.printStackTrace();
    }