'Java Selenium - how to test browser network -> payload?

Java Selenium - how to test browser network -> payload ?

I have following code that works:

WebDriver             driver;
BrowserMobProxyServer proxy;
Proxy                 seleniumProxy;
        
        
    
proxy = new BrowserMobProxyServer();
proxy.start(8080);
seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
String hostIp = Inet4Address.getLocalHost().getHostAddress();
seleniumProxy.setHttpProxy(hostIp + ":" + proxy.getPort());
seleniumProxy.setSslProxy(hostIp + ":" + proxy.getPort());
proxy.setHarCaptureTypes(CaptureType.RESPONSE_CONTENT, CaptureType.REQUEST_CONTENT,
        CaptureType.RESPONSE_HEADERS, CaptureType.REQUEST_HEADERS
        );

How to test network -> payload in chrome browser ? I have to test several fields in payload (key, value pairs). Payload resembles json file.

Lets say I have to verify the value of tmax equals 3000. How to do this ?enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source