title: Selenium script does not run in Firefox when run as sudo
body: <p>I have following simple script.</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  # Create a new instance of the Firefox driver
  browser = webdriver.Firefox()
  
  browser.get('https://www.google.com')
  
  browser.quit()
  
  </code></pre>
  <p>When I run this script with normal user as <code>python3 test.py</code> it executes correctly. But when I run this script as root user <code>sudo python3 test.py</code>, it exits with following error:</p>
  <p><code>selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process</code></p>
  <p>There's a requirement which needs the script to be executed as root user. What should I do to incorporate this?</p>