旧版Firefox在IntelliJ IDEA运行测试时提示libdbus-glib-1.so.2缺失如何解决?
问题:旧版Firefox 41在IntelliJ IDEA中无法运行功能测试
我正在维护一套需依赖旧版Firefox运行功能测试的遗留代码。已下载Firefox 41并解压至/opt目录,通过控制台命令$ /opt/firefox/firefox可成功启动Firefox,但在IntelliJ IDEA 2022.2.3中运行测试时失败。
我已在测试运行配置中添加了以下VM参数:
-Dwebdriver.firefox.bin=/opt/firefox/firefox -Dgeb.driver=firefox
运行测试时抛出如下异常:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: XPCOMGlueLoad error for file /opt/firefox/libxul.so: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory Couldn't load XPCOM. at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:122) at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:276) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:116) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:221)
我已尝试以下操作,但均未解决问题:
sudo apt install --reinstall libdbus-glib-1-2(重新安装依赖库)sudo apt install libdbus-glib-1-2:i386(安装32位版本依赖)sudo /sbin/ldconfig -v(更新共享库缓存)
相同配置在安装Ubuntu 20.04 LTS的设备上可正常运行,请问该如何解决当前问题?
内容的提问来源于stack exchange,提问作者Michal_Szulc
相关产品推荐
相关产品推荐

