browserup / browserup-proxy

BrowserUp Proxy is a free utility to watch, test, and manipulate web application network traffic and performance.
https://browserup.com
Apache License 2.0
164 stars 41 forks source link

Wheile trying to integrate with selenium i am getting error as Your connection is not private ...... NET::ERR_CERT_AUTHORITY_INVALID #300

Open Navakanthtunga opened 4 years ago

Navakanthtunga commented 4 years ago

Description While trying to integrate and run with selenium unfortunately I am getting the error as "Your connection is not private Attackers might be trying to steal your information from www.google.com (for example, passwords, messages or credit cards). Learn more NET::ERR_CERT_AUTHORITY_INVALID"

Code used public class CaptureLogs {

public String sFileName = "D://SeleniumEasy.har";

@Test
public void test1() {
    // start the proxy
    BrowserUpProxy proxy = new BrowserUpProxyServer();
    proxy.start();
    Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
    DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);

// capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

    capabilities.acceptInsecureCerts();

    System.setProperty("webdriver.chrome.driver",
            "D:\\old projects\\practice\\src\\main\\resources\\exe files\\chromedriver.exe");
    WebDriver driver = new ChromeDriver(capabilities);
    proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);
    // create a new HAR with the label "yahoo.com"
    proxy.newHar("Google.com");
    driver.get("https://www.google.com/");
    Har har = proxy.getHar();
    File harFile = new File(sFileName);

    try {
        harFile.createNewFile();
        har.writeTo(harFile);
        System.out.println(har.toString());
    } catch (IOException ex) {
        System.out.println(ex.toString());
        System.out.println("Could not find file " + sFileName);
    }
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

}

Expected behavior URL should be launched successfully.

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information:

Proxy Issue

Additional context If I am running without proxy I am able to launch the URL suc

ghalkouski commented 3 years ago

@Navakanthtunga Did you resolve this?