51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 616|回复: 1
打印 上一主题 下一主题

selenium chrome driver issues: WebDriverException: unknown error?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2017-12-6 13:51:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. Code:

  2. import org.openqa.selenium.By;
  3. import org.openqa.selenium.WebDriver;
  4. import org.openqa.selenium.chrome.ChromeDriver;

  5. public class SeleniumChromeDriverTest {
  6. public static void main(String[] args) {
  7. // TODO Auto-generated method stub       
  8. System.setProperty("webdriver.chrome.driver","E:\\webdrivers\\chromedriver_x64.exe");       
  9. WebDriver driver = new ChromeDriver();
  10. driver.get("http://www.baidu.com/");
  11. driver.findElement(By.id("kw")).sendKeys("selenium java");
  12. driver.findElement(By.id("su")).click();       
  13. driver.close();
  14. }
  15. }

  16. Exception Info:
  17. Starting ChromeDriver (v2.9.248315) on port 36978
  18. 十月 26, 2016 9:20:11 上午 org.openqa.selenium.remote.ProtocolHandshake createSession
  19. 信息: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
  20. 十月 26, 2016 9:20:12 上午 org.openqa.selenium.remote.ProtocolHandshake createSession
  21. 信息: Detected dialect: OSS
  22. Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"1816.1","isDefault":true},"id":1,"name":"","origin":"://"}
  23.   (Session info: chrome=54.0.2840.71)
  24.   (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
  25. Command duration or timeout: 118 milliseconds
  26. Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
  27. System info: host: 'DESKTOP-IU99086', ip: '192.168.2.59', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_102'
  28. Driver info: org.openqa.selenium.chrome.ChromeDriver
  29. Capabilities [{applicationCacheEnabled=false, rotatable=false, chrome={userDataDir=C:\Users\hasee\AppData\Local\Temp\scoped_dir7316_19770}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=54.0.2840.71, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
  30. Session ID: 4bfeb224c89336380e968727435630be
  31. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  32. at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  33. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  34. at java.lang.reflect.Constructor.newInstance(Unknown Source)
  35. at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
  36. at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
  37. at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
  38. at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322)
  39. at com.changcai.test.SeleniumChromeDriverTest.main(SeleniumChromeDriverTest.java:15)
复制代码


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2017-12-6 14:16:47 | 只看该作者
http://blog.csdn.net/huilan_same/article/details/51896672   去下载你对应的chromedriver版本,就可以了.
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-23 04:02 , Processed in 0.063561 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表