悠悠小仙仙 发表于 2017-12-6 13:51:53

selenium chrome driver issues: WebDriverException: unknown error?

Code:

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

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

Exception Info:
Starting ChromeDriver (v2.9.248315) on port 36978
十月 26, 2016 9:20:11 上午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
十月 26, 2016 9:20:12 上午 org.openqa.selenium.remote.ProtocolHandshake createSession
信息: Detected dialect: OSS
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":"://"}
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 118 milliseconds
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
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'
Driver info: org.openqa.selenium.chrome.ChromeDriver
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}]
Session ID: 4bfeb224c89336380e968727435630be
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322)
at com.changcai.test.SeleniumChromeDriverTest.main(SeleniumChromeDriverTest.java:15)

草帽路飞UU 发表于 2017-12-6 14:16:47

http://blog.csdn.net/huilan_same/article/details/51896672   去下载你对应的chromedriver版本,就可以了.
页: [1]
查看完整版本: selenium chrome driver issues: WebDriverException: unknown error?