& quot; HasInputDevices& quot;位于& quot;/org/openqa/selenium/interactions& quot;但它仍在查看& quot;/org/openqa/selenium/& quot; [英] "HasInputDevices" is located at "/org/openqa/selenium/interactions" but it is still looking at "/org/openqa/selenium/"

查看:59
本文介绍了& quot; HasInputDevices& quot;位于& quot;/org/openqa/selenium/interactions& quot;但它仍在查看& quot;/org/openqa/selenium/& quot;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在远程 Ubuntu 服务器上的 Chrome 上运行 WebDriver 测试用例.我已在该服务器上安装了最新的 Chrome ,但在使用此方法时却遇到了以下错误:

I want to run my WebDriver test cases on Chrome on remote Ubuntu server. I have installed latest Chrome on that server but I've been getting these errors,when I used this:

System.setProperty("webdriver.chrome.driver","/usr/bin/chromedriver");
driver = new ChromeDriver();

错误1:
该驱动程序不是可执行文件:/usr/bin/chromedriver 纠正我使用 sudo 777 chromedriver 将其设置为可执行文件,然后得到了
错误2:

Error1:
The driver is not executable: /usr/bin/chromedriver to correct I made it executable using sudo 777 chromedriver then I got
Error2:

org.openqa.selenium.WebDriverException:未知错误:Chrome无法启动:异常退出修复了此问题,我已将 Selenium jar依赖项更新为 2.40.0,从那时起,我一直在
错误3:
java.lang.NoClassDefFoundError:org/openqa/selenium/HasInputDevices
查询:现在,我知道 HasInputDevices 已移至 org/openqa/selenium/Interactions/,然后为何仍在旧目录路径中查找 org/openqa/selenium/HasInputDevices .如何让它在其实际目录中找到.
1.我已经更新了依赖项.
2.我尝试使用 mvn install ,以便它下载在 pom.xml
中编写的内容,但是它在旧目录中查找.
如何解决此错误,我不想降级硒API,因为那样一来Chrome就会意外退出.

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally to fix this I updated selenium jar dependencies to 2.40.0 and since then, I've been getting
Error3:
java.lang.NoClassDefFoundError: org/openqa/selenium/HasInputDevices
Query: Now I know that HasInputDevices has been moved to org/openqa/selenium/Interactions/ then why it is still looking in old directory path org/openqa/selenium/HasInputDevices. How to let it find at its actual directory.
1. I have updated dependencies.
2. I have tried to use mvn install so that it download what is written in pom.xml
but it's looking in old directory.
How to resolve this error, I don't want to downgrade selenium APIs, because then Chrome exits unexpectedly.

推荐答案

下一个我有相同的问题和解决方法:从POM.xml删除所有未使用的依赖项例如,如果您仅使用FirefoxDriver,而在POM.xml中,则有另一个(Chrome,Common,remote)将其删除

I had same problem and way to resolve was next: remove all unused dependencies from POM.xml for example if u use only FirefoxDriver and in POM.xml there are anothers one (Chrome, Common, remote) delete them

这篇关于& quot; HasInputDevices& quot;位于& quot;/org/openqa/selenium/interactions& quot;但它仍在查看& quot;/org/openqa/selenium/& quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆