3

I would like to open up multiple instances of Firefox using Selenium in Python and run them in parallel. After updating to Firefox 47.0, it seems that we now have to use the Marionette WebDriver for Firefox+Selenium. Before using Marionette, I could easily create new Firefox instances from within Python/Selenium simply by calling webdriver.Firefox() multiple times. After switching to Marionette though, only the first instance works. If a second instance is opened, I receive the following error:

WebDriverException: Message: Failed to decode response from marionette

After issuing the error, that instance dies, while the most recently-called instance lives on. Looking around, it appears that the problem lies in the ports that Marionette uses, where new instances keep trying to hit the same port that the original one was using. I saw that there's a way to alter the ports being used by going through prefs.js and creating separate profiles. However, I was wondering whether there was a way to do it from completely within Python (analogous to this Java example).

Any help would be appreciated!

1 Answers1

0

Similar issue reported here: https://github.com/mozilla/geckodriver/issues/1453

Basically you need to run with a debug firefox build + trace marionette logging to get more details. Or maybe you're hitting the same.

akostadinov
  • 17,364
  • 6
  • 77
  • 85