detro/ghostdriver — pull request #71 by jimevans (2012-09-28 11:14:08+00:00)
Title: Fixing switchTo().window()

This pull request implements two fixes for switching windows. First, it changes session._getWindow() to use .windowName instead of .name when searching for windows by name. Second, it implements a check for the validity of the currently focused window for every command.

The validity check is perhaps not as elegant as I'd like it to be. Feel free to refactor as you see fit.