I am getting below exception when I am trying to do
driver.findElements(By.xpath("//button/span[text()='Cancel']/../following-sibling::button/span[text()='Ok']")).size()!=0
.
Though I am using driver.findElements
at other places also, but its failing here.
Chrome: 58x version
ChromeDriver: 2.29 version
Selenium: 2.52 version
Error trace-back:
org.openqa.selenium.WebDriverException: unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot find context with specified id"} (Session info: chrome=58.0.3029.110) (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 5.44 seconds Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16' System info: host: 'Iaglab2', ip: '', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_75' *** Element info: {Using=xpath, value=//button/span[text()='Cancel']/../following-sibling::button/span[text()='Ok']} Session ID: 44c20fabdca96942ee2f9de6fc7d3c23 Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{platform=WIN8_1, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\hravi\AppData\Local\Temp\scoped_dir9172_8986, chromedriverVersion=2.29.461591 (62ebf098771772160f391d75e589dc567915b233)}, networkConnectionEnabled=false, unexpectedAlertBehaviour=, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=58.0.3029.110, pageLoadStrategy=normal, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]