5

I didn't make any changes to my python selenium program and it worked fine 3 days ago. Now when i try to use it i get:

Browsing context has been discarded Failed to decode response from marionette

Any idea what could have caused this outside the code? (since no changes were made)

I'm using firefox and geckodriver. After i got these errors i updated firefox, geckodriver, and selenium, but it didn't help.

undetected Selenium
  • 151,581
  • 34
  • 225
  • 281
Tintinabulator Zea
  • 2,387
  • 5
  • 16
  • 28

2 Answers2

3

This error message...

Browsing context has been discarded
.
Failed to decode response from marionette

...implies that the communication between GeckoDriver and Marionette was broken.

Some more information regarding the binary version interms of:

  • Selenium Server/Client
  • GeckoDriver
  • Firefox

Additionally, your code block and the error stack trace would have given us some clues about whats wrong happening. However this issue can happen due to multiple factors as follows:

GeckoDriver, Selenium and Firefox Browser compatibility chart

GeckoDriverVersions


Reference

You can find a relevant detailed discussion in:

undetected Selenium
  • 151,581
  • 34
  • 225
  • 281
0

I experienced the same error on a particular site, after performing a successful login and when I was redirected to the next page.

While Inspecting The Source of the new page code in my Firefox browser, I I noticed some bad format/HTML quality details that went away after a manual refresh. (I suspect related to lack of quality of that site in particular).

What I did in order to remediate this was to start every next step on a new page with a refresh on my drive:

def my_next_step(driver):
    driver.refresh()
    time.sleep(10)
    element=driver.switch_to_frame('iframe')
    .......

This helped me overcome the site quality issues.