Search code examples
pythonseleniumubuntuautomationstartup

How to run Python GUIS at startup (Ubuntu)


I am currently developping a selenium project and want it to always start the selenium Browser after Login, but by trying to put the script into /etc/profile it just gave me an error on startup:

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally

Is there any way to automatically run a python script at startup which can display things on the screen? If yes how is this achievable


Solution

  • I found just found it out on myself! The solution was to load the User interface before running any scripts. loading the interface is done by putting su -l pi -c startx at the verry beginning of the first sh script.put the whole command into /home/username/.profile