我正在使用selenium webdriver用于CUCM Automation,我的父网页弹出一个然后当我们点击一个链接弹出它弹出另一个窗口我能够移动到这一点但是在第二次弹出后执行某些操作当它按下确定按钮后自动关闭然后我无法切换回第一个弹出窗口,而是我正在为它提供正确的目标。
testSection selectELINInfoForDefaultWindow {gcb selectWindow -target $ConventionalERL::WindowID::ShowNewWindow1}
像这样,我们转向第一个窗口,做了一些操作,然后新的弹出窗口就像是: -
testSection selectALIInfoForDefaultWindow {gcb selectWindow -target $ERLInfoForDefault::WindowID::ShowNewWindow2}
经过一些操作后我们执行并关闭然后再次尝试第一次出现如下: -
testSection selectELINInfoForDefaultWindow {gcb selectWindow -target $ConventionalERL::WindowID::ShowNewWindow1}
抛出错误:
Caught Tcl Error: org.openqa.selenium.NoSuchWindowException: Window not found. The browser window may have been closed. 81: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58' 82: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: System info: host: 'ahazra-ws', ip: '10.77.24.165', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_91' 83: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Driver info: driver.version: unknown 84: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Command duration or timeout: 462 milliseconds 85: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Build info: version: '2.37.0', revision: 'a7c61cb', time: '2013-10-18 17:14:00' 86: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: System info: host: 'bgl-vtg-lnx110', ip: '64.103.217.57', os.name: 'Linux', os.arch: 'i386', os.version: '2.6.18-404.el5', java.version: '1.6.0_07' 87: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Session ID: 0967d3e1-6431-4591-b094-fed99a206360 88: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Driver info: org.openqa.selenium.remote.RemoteWebDriver 89: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Capabilities [{platform=WINDOWS, javascriptEnabled=true, acceptSslCerts=true, browserName=firefox, rotatable=false, locationContextEnabled=true, webdriver.remote.sessionid=0967d3e1-6431-4591-b094-fed99a206360, version=46.0.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}] 90: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: while executing 91: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: "$_webdriverObj waitForNewWindow $target" 92: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: (object "::gcb" method "::GuiControl::Browser::waitForNewWindow" body line 16) 93: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: invoked from within 94: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: "waitForNewWindow -target $target" 95: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: (object "::gcb" method "::GuiControl::Browser::selectWindow" body line 26) 96: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: invoked from within 97: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: "gcb selectWindow -target $ConventionalERL::WindowID::ShowNewWindow1" 98: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: ("uplevel" body line 1) 99: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: invoked from within 100: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: "uplevel #0 $cmd " 101: : 2016-08-10T19:11:31: %autoeasy-5-NOTICE: Aug 10 07:11:31 PM 2016: ERROR: Failed command: gcb selectWindow -target $ConventionalERL::WindowID::ShowNewWindow1, Got result = 5
请帮助解决此问题