lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
505 stars 117 forks source link

Is there a way to clear chrome cache before start of each test run ? #514

Open manishdube opened 3 years ago

manishdube commented 3 years ago

Is your feature request related to a problem? Please describe. Yes. Its really how we have implemented our framework where the chrome browsers loops through 300 similar tests, consequently causing caching issues with the chrome browser.

Describe the solution you'd like Be able to clear browser cache via a function call at the start of each test run

Describe alternatives you've considered Alternatives we considered was to shorten the test iterations but this causes issues of collation of reports and identifying failures across the various reports.

Additional context a clear cache function call would be super.

olivercoad commented 3 years ago

https://github.com/omrilotan/selenium-chrome-clear-cache/blob/482f06b24c661edcbdf7534c7aeabcef935b973d/index.js looks promising. It loads chrome://settings/clearBrowserData, checks the checkboxes and clicks the button. It would probably be pretty easy to implement that using canopy.

lefthandedgoat commented 3 years ago

There is not a built in way to do this. You can try the suggestiosn that Olivercoad said or you can try these via Js https://medium.com/tenets/cookies-n-cache-in-selenium-3de5b7dc0407