简体   繁体   中英

How can I run test scenario in chrome using browser cache in karate?

I am testing a scenario in which I have to run chrome with cache so how can I do that as by default it launches browser without any cache.

This is not a normal requirement, but we have an option to set the userDataDir , here below is a screenshot from the documentation :

在此处输入图像描述

So if you know the path of a directory that exists, you can pass that. That said, maybe the correct testing strategy is to make a call 2 times and ensure that the second call is being cached. But some investigation may be required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM