虚拟机上的selenium webdriver

虚拟机上的selenium webdriver,selenium,webdriver,selenium-webdriver,virtual-machine,selenium-firefoxdriver,Selenium,Webdriver,Selenium Webdriver,Virtual Machine,Selenium Firefoxdriver,我正在使用SeleniumWebDriver开发一个虚拟机。我试图在我工作的机器上运行测试(同样是虚拟的),在实例化驱动程序的线路上出现NoClassDefFoundError: driver = new FirefoxDriver(ffBinary,ffProfile); 所以,在虚拟机上,我做了一些研究,发现我可以使用RemoteWebDriver。在尝试这个之后,我仍然得到相同的错误。有什么建议吗?我觉得这应该和在物理盒子上运行一样,但事实并非如此。它可以在物理机器上完美地工作 堆栈跟踪

我正在使用SeleniumWebDriver开发一个虚拟机。我试图在我工作的机器上运行测试(同样是虚拟的),在实例化驱动程序的线路上出现NoClassDefFoundError:

driver = new FirefoxDriver(ffBinary,ffProfile);
所以,在虚拟机上,我做了一些研究,发现我可以使用RemoteWebDriver。在尝试这个之后,我仍然得到相同的错误。有什么建议吗?我觉得这应该和在物理盒子上运行一样,但事实并非如此。它可以在物理机器上完美地工作

堆栈跟踪:

java.lang.NoClassDefFoundError: com/google/common/io/Resources at org.openqa.selenium.firefox.FirefoxProfile.onlyOverrideThisIfYouKnowWhatYouAreDo‌​ing(FirefoxProfile.java:123)
at org.openqa.selenium.firefox.FirefoxProfile.<init>(FirefoxProfile.java:86)
at org.openqa.selenium.firefox.FirefoxProfile.<init>(FirefoxProfile.java:79)
at line 63 in my class is where it breaks: File profile = new File(PROFILE); //PROFILE = where FF profile is (63) FirefoxProfile ffProfile = new FirefoxProfile(profile)

java.lang.NoClassDefFoundError:com/google/common/io/Resources,网址:org.openqa.selenium.FirefoxProfile.onlyoverridethisfyouknowwhatyouaredo‌​ing(FirefoxProfile.java:123)
位于org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:86)
位于org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:79)
在我的类的第63行是它中断的地方:File profile=新文件(profile)//配置文件=其中FF配置文件为(63)FirefoxProfile ffProfile=新FirefoxProfile(配置文件)

您需要在远程机器上创建配置文件


完整的错误和堆栈跟踪是什么?
java.lang.NoClassDefFoundError:com/google/common/io/Resources,org.openqa.selenium.FirefoxProfile.FirefoxProfile.onlyOverridethisfyouKnowwhatyouAredo(FirefoxProfile.java:123),org.openqa.selenium.FirefoxProfile.FirefoxProfile.(FirefoxProfile.java:86),org.openqa.selenium.FirefoxProfile.FirefoxProfile。(FirefoxProfile.java:79)
在我的类的第63行是它的断点:
File profile=new File(profile);//profile=其中FF profile是(63)FirefoxProfile ffProfile=new FirefoxProfile(profile)
检查类路径,查看guvava库是否正确定义。在命令行或sysout System.getproperty(“java.classpath”)中打印类路径在代码中。如果您使用的是maven check runtime dependencies.ok-发现缺少我所需的库。但是,现在我遇到另一个错误:
org.openqa.selenium.remote.UnreachableBrowserException:无法启动新的sesion。可能的原因是远程服务器地址无效或浏览器启动失败de>