I've writed a simple E2E test using Selenium WebDriver in Java.
When I run this test using maven test
, intellij idea throw me an error:
Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX
My OS is openSUSE Leap 15.2 and for test I wanted to use installed Mozilla Firefox 78esr:
ac@icarus:~> firefox -v
Mozilla Firefox 78.2.0esr
Firefox is installed from openSUSE repo in a default location.
I have do a research and I've set a property for webdriver.firefox.bin:
System.setProperty("webdriver.firefox.bin", "path_to_firefox_binary");
to point it to installed firefox binary.
When I start this test again i've get a different error:
[ERROR] userShouldOpenLoginPage Time elapsed: 1.096 s <<< ERROR! java.lang.IllegalStateException: Specified firefox binary location does not exist or is not a real file: /usr/bin/firefox
For path I try:
/usr/bin/firefox
, /usr/lib64/firefox/firefox
, /usr/lib64/firefox/firefox-bin
.
To get path for firefox binary I use whereis command:
ac@icarus:~> whereis firefox firefox: /usr/bin/firefox /usr/lib64/firefox /usr/share/man/man1/firefox.1.gz
I try to fix this but nothing works, so I've downloaded firefox from mozilla site and point property to it. Now binary is found, but IJ throw me another error:
XPCOMGlueLoad error for file /home/ac/Pobrane/firefox/libxul.so: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory Couldn't load XPCOM.
When I try running firefox normally everything works great - browser starts.
I've tried checking if I have libdbus-glib-1.so.2:
ac@icarus:~/Pobrane/firefox> ldd libxul.so | grep libdbus-glib-1.so.2
libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 (0x00007fe4dd115000)
ac@icarus:~/Pobrane/firefox> ls -allh /usr/lib64/ | grep libdbus-glib-1.so.2
lrwxrwxrwx 1 root root 23 05-16 18:45 libdbus-glib-1.so.2 -> libdbus-glib-1.so.2.3.3
-rwxr-xr-x 1 root root 162K 05-16 18:45 libdbus-glib-1.so.2.3.3
Lib libdbus-glib-1.so.2 exist (is a symlink) and it point to libdbus-glib-1.so.2.3.3 so why I get error "cannot open shared object file"?
Anyone have an idea how to fix it?