Is there a webdriver equivalent to window.find in watir? I'm trying to
assert that a window has been closed. So for my test, it passes if it can't
find the window.
In watir i used the following code:
browser = Watir::Browser.attach(:url, /Account.aspx/)
browser.image(:id, /tabAccounts/).click
help = Watir::IE.find(:title, /User Guide/)
help.should == nil
My best guess for webdriver is:
browser.window(:url, /Account.aspx/).use
browser.image(:id, /tabAccounts/).click
begin
browser.window(:title, /User Guide/).use
rescue Watir::Exception::NoMatchingWindowFoundException
puts "window not found"
end
I'm using taza, so i'm not really sure that this code will produce a
failure if the window is still active.
--
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]