【发布时间】:2019-03-29 13:02:23
【问题描述】:
We'd like to launch the Firefox browser with profile initialization . but it is not opening and failing with below error message.
“java.lang.NoClassDefFoundError:org/openqa/selenium/remote/JsonToBeanConverter”在 org.openqa.selenium.firefox.Preferences.readDefaultPreferences(Preferences.java:95)
**My current software version details**
Selenium 3.14
Firefox browser 66
Gecko driver version V 0.24
System.setProperty("webdriver.gecko.driver", "C:\\geckodriver.exe");
ProfilesIni prof = new ProfilesIni();
FirefoxProfile profile = prof.getProfile("Auto");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
return new FirefoxDriver(capabilities);
I tried to launch the Firefox browser with above configuration
As per the above code we have created a profile manually and trying to launch the browser with created profile . We have added add block plus plugin in the profile. because Random popup is appearing in our application . so we want to block it by adding the random popup filename is the add block plus filter.
**Actual Result :**Browser is not launching
**Expected Result :**Browser should launch
【问题讨论】:
-
如果您的依赖项缺少某些内容,则往往会出现这种类型的警告。你用什么来构建项目? maven,请您添加您的 Pom.xml 文件;如果 Gradle 那么请添加您的 Gradle.build 文件等...
-
嗨 Peck ,它正在成功启动,并带有以下 stmt 。例如,如果我想在没有配置文件的情况下启动。 System.setProperty("webdriver.gecko.driver", "C:\\geckodriver.exe");new FirefoxDriver();
-
是的,但是错误表明它不能上帝找不到“.org/openqa/selenium/**remote**/JSONToBeanConverter.java”。您的构建文件中是否指定了 selenium 远程版本?
-
您是指 Selenium 独立服务器吗?如果是,我没有提到它
-
不,我是说硒 remote。这必须在您的依赖项中并导入。
标签: selenium firefox add profile