尝试使用 Selenium 运行脚本时出现 java.io.FileNotFoundException

标签 java selenium-webdriver

当我尝试使用 selenium 运行脚本时,出现以下错误

Exception in thread "main" org.openqa.selenium.WebDriverException: java.io.FileNotFoundException: D:\Shantu!!!!!!! (The system cannot find the file specified) Build info: version: '2.49.1', revision: '7203e46', time: '2016-01-21 17:35:35' System info: host: 'ghijkl-ab562296', ip: '192.168.43.128', os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.8.0_40' Driver info: driver.version: FirefoxDriver at org.openqa.selenium.firefox.FirefoxProfile.onlyOverrideThisIfYouKnowWhatYouAreDoing(FirefoxProfile.java:132) at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:85) at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:78) at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:67) at org.openqa.selenium.firefox.FirefoxDriver.getProfile(FirefoxDriver.java:288) at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:264) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:119) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:218) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:211) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:207) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:120) at practicePackage.New.main(New.java:11) Caused by: java.io.FileNotFoundException: D:\Shantu!!!!!!! (The system cannot find the file specified) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) at java.util.jar.JarFile.(Unknown Source) at java.util.jar.JarFile.(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source) at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.getInputStream(Unknown Source) at java.net.URL.openStream(Unknown Source) at org.openqa.selenium.firefox.FirefoxProfile.onlyOverrideThisIfYouKnowWhatYouAreDoing(FirefoxProfile.java:130) ... 11 more

最佳答案

当您尝试使用您创建的特定 Firefox 配置文件测试应用程序时,似乎会引发异常。

关于尝试使用 Selenium 运行脚本时出现 java.io.FileNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34998798/

相关文章:

java - 避免java中的特定异常

java - MapReduce不产生输出

node.js - selenium webdriver 使用 Promise.then 卡在非常简单的 JavaScript 代码中

javascript - 网站加载 javascript 后如何解析网站?

python - 如何验证按钮是否在 Webdriver Python 中启用和禁用?

python - 无法从输出中删除大量空白行

java - 配置 Spring Data Repository 类以针对读取/选择方法命中 read_replica_db 并针对写入/插入方法命中 main_db ?

java - 存储数据库密码的最佳实践

java - 更改具有相同标签/ID 的多个 TextView 中的文本

jenkins - Selenium 网格VS Jenkins