Some body know how to intercept/get request url (XHR) and response in Selenium WebDriver? Is it possible?
Its not directly supported by webdriver, but you can capture all traffic by redirecting it through a proxy. In java..
Proxy proxy = new Proxy();
// This should be the address of proxy.
proxy.setHttpProxy("localhost:8080");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new FirefoxDriver(capabilities);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With