3

So I have a "load page, do login" test scenario which I need to run with multiple accounts simultaneously. Since I don't want to share cookies between these sessions I creating an incognito browser context for each. But incognito mode preventing cached files from sharing too which leads to loading speed drops. So my question is:

  • How to use the same cache in different incognito browser contexts or
  • How to not share cookies in default cache-shared context`s page.
CyberMage
  • 51
  • 5
  • 1
    The only way I found is to use request interceptor ([puppeteer doc](https://devdocs.io/puppeteer/index#pagesetrequestinterceptionvalue)): 1) Enable it with `page.setRequestInterception(true)`. 2) Save necessary for caching responses somewhere to local db. 3) After that responding to these requests with its cached brother with `request.respond`. But I hope there is exists more native way of solving this. – CyberMage Jul 05 '21 at 12:42

0 Answers0