protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Set firefox profile with protractor

Open rgalite opened this issue 12 years ago • 5 comments

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-cache to 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.

rgalite avatar Sep 17 '14 14:09 rgalite

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.

erem-ifg avatar Sep 18 '14 18:09 erem-ifg

You might have to integrate this into your test: https://github.com/saadtazi/firefox-profile-js

hankduan avatar Oct 02 '14 19:10 hankduan

This may also be relevant: https://code.google.com/p/selenium/issues/detail?id=7978#c3

elgalu avatar Oct 02 '14 19:10 elgalu

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

elgalu avatar Oct 02 '14 19:10 elgalu

Please read the contributing guidelines; these types of questions are ill-suited for GitHub. Thanks!

juliemr avatar Oct 03 '14 21:10 juliemr