Open brownan opened 1 year ago
i had the same problem, i solved it on my linux-ubuntu 20.04 by a symlink firefox.launcher in new directory /snap/firefox/current/ to /usr/bin/firefox. It's not elegant, but it works. sudo mkdir /snap/firefox/current sudo ln -s /usr/bin/firefox /snap/firefox/current/ sudo mv firefox firefox.launcher
Thanks to mathes2. It is the best I could find.
System
In my case, I'm developing a Django project which uses selenium and invokes the geckodriver. When I run from the command line, it works fine. When I run it from PyCharm (installed via snap), the geckodriver returns this error:
I believe this is due to the recent bug https://bugzilla.mozilla.org/show_bug.cgi?id=1769991 and its fix https://hg.mozilla.org/mozilla-central/rev/93e827afaac1
If I'm reading the code right, it checks for the
SNAP_INSTANCE_NAME
environment variable, but doesn't check its contents. When running from Pycharm, the geckodriver process inherits the valueSNAP_INSTANCE_NAME=pycharm-professional
and then tries to find firefox at /snap/firefox/current/firefox.launcher instead of its actual location at /usr/bin/firefoxI can verify this by executing my test suite like this:
whereas without that variable set, the tests run fine.