0

I am trying to run selenium python script using aws lambda. It runs locally. However on the cloud, it fails with the following error:

selenium.common.exceptions.TimeoutException: Message: Failed to read marionette port

Here is a code snippet

    options.set_preference('profile', profile_path)
options.set_preference("browser.cache.disk.enable", False)

options.set_preference("browser.cache.disk.smart_size.enabled", False)
options.set_preference("browser.cache.disk.capacity", 0)

options.set_preference("browser.cache.memory.enable", False)
options.set_preference("browser.cache.offline.enable", False)

options.set_preference("network.http.use-cache", False)
options.set_preference('browser.cache.disk.parent_directory',
                       <a path to /tmp>)
options.binary_location = binary_location
service = Service(executable_path, log_path='/tmp/geckodriver.log')
firefox_driver = webdriver.Firefox(service=service, options=options)

Any suggestion would be appreciated.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Oleg
  • 31
  • 1
  • 8
  • Does this answer your question? ["Failed to read marionette port" when Running Selenium + geckodriver + firefox as a non-root user in a Docker container](https://stackoverflow.com/questions/72374955/failed-to-read-marionette-port-when-running-selenium-geckodriver-firefox-a) – Kulasangar Jun 14 '23 at 12:16
  • No, I've added .cache and still it happens – Oleg Jun 14 '23 at 12:36

0 Answers0