未知会话ID,无法使用getWindowHandle

时间:2017-05-17 14:06:26

标签: selenium-webdriver cross-browser remotewebdriver

我获取了一个webDriver异常,同时获取windowHandle。

org.openqa.selenium.WebDriverException:未知的sessionId:364337eb-405e-49fa-aa75-d048f10cb52c 命令持续时间或超时:548毫秒 构建信息:版本:' 3.0.1',修订版:' 1969d75',时间:' 2016-10-18 09:49:13 -0700' 系统信息:主持人:' II5MACMINI-04.local',ip:' 169.254.122.119',os.name:' Mac OS X',os.arch :' x86_64',os.version:' 10.12.3',java.version:' 1.8.0_111' 驱动程序信息:org.openqa.selenium.remote.RemoteWebDriver 能力[{applicationCacheEnabled =假,可旋转=假,mobileEmulationEnabled =假,networkConnectionEnabled =假,铬= {chromedriverVersion = 2.29.461591(62ebf098771772160f391d75e589dc567915b233),userDataDir = C:\用户\你\应用程序数据\本地\ TEMP \ scoped_dir612_6018},takesHeapSnapshot = true,pageLoadStrategy = normal,databaseEnabled = false,handlesAlerts = true,hasTouchScreen = false,version = 58.0.3029.81,platform = XP,browserConnectionEnabled = false,nativeEvents = true,acceptSslCerts = true,webdriver.remote.sessionid = 364337eb-405e -49fa-aa75-d048f10cb52c,locationContextEnabled = true,webStorageEnabled = true,browserName = chrome,takesScreenshot = true,javascriptEnabled = true,cssSelectorsEnabled = true,unexpectedAlertBehaviour =}] 会议ID:364337eb-405e-49fa-aa75-d048f10cb52c

我正在crossbrowsertesting.com上执行我的测试用例

以下是我收到错误的代码行。

            String parentHandle = driver.getWindowHandle(); 

1 个答案:

答案 0 :(得分:0)

CBT会在经过一段时间(大约5分钟后)后断开会话。尝试缩短测试时间。