Handling “Selenium (WebDriver) Exception: this.getWindow() is null”

I was trying to create a simple script to do few things :
  • Launch Twitter
  • Click on “Sign in”
  • Log in with username "testmail" and password "password"
Relevant Webdriver script is:
public void launchTwitter() throws Exception {
public void clickOn(String string1) throws Exception {

    public void logInWithUsernameAndPassword(String string1, String string2)
    throws Exception {


While trying to play it back on Firefox 4, script failed on below step
and stack trace looked like:
org.openqa.selenium.WebDriverException: this.getWindow() is null
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24'
Driver info: driver.version: RemoteWebDriver
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
    at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:203)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementsByLinkText(RemoteWebDriver.java:221)
    at org.openqa.selenium.By$ByLinkText.findElements(By.java:218)
    at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:180)
    at Twitter.goBack(Twitter.java:20)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: this.getWindow() is null
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24'
It’s strange! So Google comes to rescue at this point of time. After searching I got that there are lot many others who are facing this issue.
If you don’t want to get re-directed I will post the quick solution, try

As per Simon, this is probably an issue with Firefox and not Selenium. 

Just to note that this works perfectly right with Firefox 3.6.


  1. thanks, you saved my day ;)

  2. Nishant VermaSeptember 19, 2011

    Selenium Webdriver Version 2.6.0 fixes this issue ! Just tested it !

  3. I have selenium 2.6.11 and it still causing this issue
    2.6.13 - have resolved this issue


Post a Comment

Your comments will be reviewed and then published !

Popular posts from this blog

The 3 qualities that will always help you become better at almost anything…

Test Case Paths : Happy, Sad & Bad

How to install Android Emulator on Windows