Set firefox profile with protractor
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:
- Disable the cache from the backend-side by modifying the relevant headers -> I can't modify the backend
- Disable the cache from firefox: I just have to set the flag
network.http.use-cacheto false. Manually 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?
Thanks for your help.
I ended up settting up the seleniumArgs like:
seleniumArgs: [
"-Dwebdriver.firefox.profile=selenium"
]
selenium is a profile I created by running /path/to/your/firefox-bin -p
Is there a way to specify where to search the profile? I would like to push it to my repo so I can share it with the team.
You might have to integrate this into your test: https://github.com/saadtazi/firefox-profile-js
This may also be relevant: https://code.google.com/p/selenium/issues/detail?id=7978#c3
It may also be interesting to eventually have something similar to config.capabilities.chromeOptions but also for Firefox, e.g. config.capabilities.firefoxPrefs to set preferences on FF too
Please read the contributing guidelines; these types of questions are ill-suited for GitHub. Thanks!