I have following simple script.
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()
When I run this script with normal user as python3 test.py
it executes correctly. But when I run this script as root user sudo python3 test.py
, it exits with following error:
selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process
There's a requirement which needs the script to be executed as root user. What should I do to incorporate this?