I want to run tests with Firefox/protractor with the cache feature disabled. (Actually, I'm trying to prevent 304 HTTP responses).
There are multiple ways to do this:
network.http.use-cache
to falseManually it works. I receive only 200 responses and it's great. I want to be able to set this flag through protractor configuration. After some search I found out that I had to create a custom profile and set it in protractor this way (https://code.google.com/p/selenium/wiki/DesiredCapabilities):
capabilities: {
browserName: 'firefox',
firefox_profile: 'support/firefox_profile'
}
The problem is that the firefox profile is not considered. Is it the right option? Do you have a better idea?
Thanks for your help.
EDIT: As someone (suggested
capabilities: {
prefs: {
'config.http.use-cache': false
}
}
It did not work - I checked in about:config, the flag was still enabled. How do you know what options you can pass in the capabilities?
Here's an example of how to integrate firefox-profile with protractor: https://github.com/juliemr/protractor-demo/tree/master/howtos/setFirefoxProfile
EDIT: For those upgrading to protractor >=1.6, the old way of doing this was broken because 'browser' can no longer return a promise. The demo has been updated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With