I want to use Chrome's cache to get status code 304.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

I want to use Chrome's cache to get status code 304.

sherlock
Hello.

First of all, I don't English very well. Please understand.

I used chrome with selenium. but, if refresh the page, the status code will be 200.

1. How do I get the 304 code?

2. Is there an identifier that can be verified as cached in a Har file?

I wait for your response

Thank you.

BrowserMobProxyServer server = new BrowserMobProxyServer();
server.setUseEcc(true);
server.setTrustAllServers(true);
    server.start();
    
    int port = server.getPort();
    
    HashSet<CaptureType> enable = new HashSet<CaptureType>();
        enable.add(CaptureType.REQUEST_HEADERS);
        enable.add(CaptureType.REQUEST_CONTENT);
        enable.add(CaptureType.RESPONSE_HEADERS);
        enable.add(CaptureType.RESPONSE_CONTENT);
        server.enableHarCaptureTypes(enable);
        
        Proxy proxy = ClientUtil.createSeleniumProxy(server);

        proxy.setProxyType(ProxyType.MANUAL);
        proxy.setNoProxy("");
                
        
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        ChromeOptions options = new ChromeOptions();      
        
        options.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
        options.setCapability(CapabilityType.PROXY, proxy);
        // options.setCapability("applicationCacheEnabled", "true"); 
        // options.setCapability("enableElementCacheCleanup", "false"); 
        options.addArguments("time-zone");
        
        capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);
        capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));
        
        capabilities.setCapability(ChromeOptions.CAPABILITY, options);

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/48ae08bf-1d41-4780-8298-b2eda6eedad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.