With Selenium IDE I used this.browserbot.getUserWindow()
for getting the window
object, but I couldn't find a way doing it with the WebDriverJs
.
Using the WebDriverJs
is there a way to get the window
object?
With Selenium IDE I used this.browserbot.getUserWindow()
for getting the window
object, but I couldn't find a way doing it with the WebDriverJs
.
Using the WebDriverJs
is there a way to get the window
object?
No, not easily.
SeleniumIDE works in the current browser, whereas WebDriver uses the JSON Wire Protocol to communicate with a potentially-remote browser. Your WebDriver code is not running in the target browser, so the window object is simply not there to be accessed. (If your code actually is running in the target browser, you can get the window object from that in the normal manner.)
You could attempt to serialize the window object and transmit it via Wire: there's a hint on how to do this in this answer. The effort is almost certainly not worth it.