Ruby 使用prerender资源提示导航后,如何将Selenium重新连接到IE11?

Ruby 使用prerender资源提示导航后,如何将Selenium重新连接到IE11?,ruby,selenium,internet-explorer-11,saucelabs,Ruby,Selenium,Internet Explorer 11,Saucelabs,我正在做一个Selenium(RubyAPI)测试,它可以从一个页面导航到另一个页面。最近,当我在第一页添加指向第二页的资源提示以加快导航速度时,它在IE11/Win10(通过SauceLabs)上开始失败。失败是this(),并且在导航发生后的第一个Selenium命令上始终发生 Unable to find element on closed window (WARNING: The server did not provide any stacktrace information) Com

我正在做一个Selenium(RubyAPI)测试,它可以从一个页面导航到另一个页面。最近,当我在第一页添加指向第二页的资源提示以加快导航速度时,它在IE11/Win10(通过SauceLabs)上开始失败。失败是this(),并且在导航发生后的第一个Selenium命令上始终发生

Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'WIN-SB3ER6JQ6ME', ip: '172.20.114.237', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=false, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=false, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXX79d496ee
*** Element info: {Using=class name, value=dialog-title} (org.openqa.selenium.NoSuchWindowException) (Selenium::WebDriver::Error::NoSuchWindowError)
值得一提的是,当手动测试IE11时,预渲染工作正常,Selenium+Chrome(也遵守预渲染指令)对此没有问题

我怀疑IE通过在隐藏窗口/上下文中加载页面来实现预呈现,然后破坏当前窗口并在导航时交换新窗口,从而导致Selenium在窗口上的句柄无效。我已经尝试通过强制Selenium重新连接到窗口来解决此问题:

# Wait a few seconds, then
@driver.switch_to.window(@driver.window_handles.last)
但我发现导航后,
@driver.window\u句柄
是空的,即使SauceLabs屏幕显示导航正常工作

在使用prerender资源提示导航后,是否有任何方法将Selenium重新连接到IE11?

交叉发布到。以下是(现在已批准,因此我可以链接到它)。不过,那里还没有人帮忙。