On Oct 6, 8:36 am, Rick <[email protected]> wrote: > Trying to switch back to the main window from a popup with the > following > > browser.window(:title => 'mytitle').use do > . > . > . > browser.frame(:id => 'bottomFrame').button(:id => > 'btnClose').click > end > > # I need to do something with the main window here > > At this point, i tried several things including > > browser.window(:title => 'mainWindow').use > > But nothing seems to work to get me back to the main window. Getting > these > > Selenium::WebDriver::Error::ObsoleteElementError: Element not found in > the cache > [remote server] > file:///tmp/webdriver-profile20111005-29818-1mc4n0x/extensions/[email protected]/resource/modules/utils.js:8908:in > `WebDriverError' > > Any ideas?
Are you sure you have the title for the main window correct? You might try browser.windows to get a list of the windows at that point No time to test it right now, but maybe you could use this to debug things a little at that point in your script. (or get the browser to the right point and use IRB) browser.windows.each_with_index do |win, i | puts i puts win.title puts win.url end -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
