Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying window state on closed window does not trigger a NoSuchWindow error #2100

Closed
beluha opened this issue May 13, 2016 · 0 comments
Closed

Comments

@beluha
Copy link

beluha commented May 13, 2016

Meta -

OS: Windows 7 Professional

Selenium Version: 2.52.0

Browser: Firefox

Browser Version: 45.0.2

Expected Behavior -

Methods related to closed browser window return null

Actual Behavior -

There are several methods related to browser window:

  • getCurrentUrl
  • getPageSource
  • getTitle
  • getWindowHandle
  • getWindowHandles

When we call them after calling of "close()" method, they return the same value as before calling of "close()".

Steps to reproduce -

  1. Start FireFox - driver = new FirefoxDriver(Binary, profile);
  2. Call one of the following methods:
  3. getCurrentUrl
  4. getPageSource
  5. getTitle
  6. getWindowHandle
  7. getWindowHandles
  8. Return value of these methods is not null. For example value of "getCurrentUrl()" is "about:blank".
  9. Call "close()" method to close current opened window of browser.
  10. Window is closed.
  11. Call one of the following methods:
  12. getCurrentUrl
  13. getPageSource
  14. getTitle
  15. getWindowHandle
  16. getWindowHandles
  17. Return value of these methods is not null. For example value of "getCurrentUrl()" is still "about:blank".

Returning of null would allow to verify whether browser window is closed.

@jleyba jleyba changed the title Return value of methods called at the closed browser window is not null Querying window state on closed window does not trigger a NoSuchWindow error May 15, 2016
@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants