【发布时间】:2016-01-25 17:40:59
【问题描述】:
当我尝试使用 selenium 运行脚本时,出现以下错误
线程“主”org.openqa.selenium.WebDriverException 中的异常: java.io.FileNotFoundException: D:\Shantu!!!!!!! (系统不能 找到指定的文件)构建信息:版本:'2.49.1',修订: '7203e46',时间:'2016-01-21 17:35:35' 系统信息:主机: '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.version:FirefoxDriver 在 org.openqa.selenium.firefox.FirefoxProfile.onlyOverrideThisIfYouKnowWhatYouAreDoing(FirefoxProfile.java:132) 在 org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:85) 在 org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:78) 在 org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:67) 在 org.openqa.selenium.firefox.FirefoxDriver.getProfile(FirefoxDriver.java:288) 在 org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:264) 在 org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:119) 在 org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:218) 在 org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:211) 在 org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:207) 在 org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:120) 在 practicePackage.New.main(New.java:11) 引起: java.io.FileNotFoundException: D:\Shantu!!!!!!! (系统不能 在 java.util.zip.ZipFile.open(Native Method) 处找到指定的文件 在 java.util.zip.ZipFile.(Unknown Source) 在 java.util.zip.ZipFile.(未知来源)在 java.util.jar.JarFile.(未知来源)在 java.util.jar.JarFile.(未知来源)在 sun.net.www.protocol.jar.URLJarFile.(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.getJarFile(未知来源)在 sun.net.www.protocol.jar.JarFileFactory.get(未知来源)在 sun.net.www.protocol.jar.JarURLConnection.connect(未知来源)在 sun.net.www.protocol.jar.JarURLConnection.getInputStream(未知 源)在 java.net.URL.openStream(未知源)在 org.openqa.selenium.firefox.FirefoxProfile.onlyOverrideThisIfYouKnowWhatYouAreDoing(FirefoxProfile.java:130) ... 11 更多
【问题讨论】:
-
请提供代码..
-
请在package practicePackage下面找到代码;导入 org.openqa.selenium.WebDriver;导入 org.openqa.selenium.firefox.FirefoxDriver; public class New { public static void main(String[] args) { // TODO 自动生成的方法存根 WebDriver driver = new FirefoxDriver(); driver.get("google.co.in/…); } }
-
请检查答案..谢谢