可能禁用Firefox和铬默认缓存? [英] Possible to disable firefox and chrome default caching?

查看:201
本文介绍了可能禁用Firefox和铬默认缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题与Firefox缓存,当我改变一个网站重定向Firefox的决定,它需要缓存这个。



点是我想要创建一个测试,编辑重定向测试编辑工作,但这种缓存阻止我这样做。

有没有办法禁用Firefox缓存?或更好,但在需要时删除它?



注意:这不是饼干,而是实际的Firefox缓存。使用webdriver C#版本。

解决方案

禁用chrome缓存:

 来自selenium import webdriver 
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(' - disable-application-cache')
driver = webdriver.Chrome(chrome_options = chrome_options)

可以看到的命令行参数列表 here


I'm having a problem with firefox caching, when i change a site redirection firefox decides that it needs to cache this.

The point is I wan't to create a test that tests editing a redirection works, but this caching prevents me from doing this.

Is there a way to disable firefox caching? or better yet delete it when needed?

NOTE: It's not cookies but the actual firefox cache.

I'm using webdriver C# version.

解决方案

To disable chrome caching:

from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--disable-application-cache')
driver = webdriver.Chrome(chrome_options=chrome_options)

List of available command-line arguments you can see here.

这篇关于可能禁用Firefox和铬默认缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆