eviltester / blogcomments

1 stars 0 forks source link

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

Open utterances-bot opened 3 years ago

utterances-bot commented 3 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 3 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 3 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();
    }