没有使用selenium chromedriver获得window_handles

时间:2016-12-19 23:41:36

标签: selenium selenium-webdriver selenium-chromedriver

最近,在将chrome更新为55+之后,我在尝试通过GET /session/:sessionId/window_handles获取窗口句柄时开始出错:

  

未知错误:DevTools返回未知类型:shared_worker

这是一个原始回应:

{
      "state": "unhandled error",
      "sessionId": "eb9c00d1-69b5-442f-a7ec-22ec3f66ebe8",
      "hCode": 2083613825,
      "value": {
        "additionalInformation": "\nDriver info: org.openqa.selenium.chrome.ChromeDriver\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6), userDataDir=/var/folders/2b/9hrnxzzn01g5h6f63y0xr6x00000gp/T/.org.chromium.Chromium.6K7w6K}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=55.0.2883.95, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]\nSession ID: 059342d1acb4b69e7b7ba68a3b1073ea",
        "localizedMessage": "unknown error: DevTools returned unknown type:shared_worker\n  (Session info: chrome=55.0.2883.95)\n  (Driver info: chromedriver=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6),platform=Mac OS X 10.9.5 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 3 milliseconds\nBuild info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'\nSystem info: host: 'MBP', ip: '10.10.10.01', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.8.0_25'\nDriver info: org.openqa.selenium.chrome.ChromeDriver\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6), userDataDir=/var/folders/2b/9hrnxzzn01g5h6f63y0xr6x00000gp/T/.org.chromium.Chromium.6K7w6K}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=55.0.2883.95, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]\nSession ID: 059342d1acb4b69e7b7ba68a3b1073ea",
...
}

单个和多个标签都失败了。此外,/session/:sessionId/window_handle似乎工作正常。

chromedriver:2.26.436421

硒:2.53.1

chrome:55.0.2883.95

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

这是ChromeDriver中的一个错误,修复于v2.27:

  

---------- ChromeDriver v2.27(2016-12-23)----------

     

支持Chrome v54-56

     

已解决的问题1637:在Chrome 55+ [['OS-All','Pri-1']的共享工作人员面前,获取窗口句柄失败