[![enter image description here](https://i.stack.imgur.com/H0fKS.png)](https://i.stack.imgur.com/H0fKS.png)I want to switch to jQuery Modal window which is generated when an image is clicked. However Selenium (IE Webdriver) is not able to recognize the modal window generated and unable to switch. No exception/error is displayed!

IE Version - 11
Selenium version - 2.53
IE WebDriver version - 2.53.1

The code I have tried for switching:

```
objMovePage.clickFromAccountPicker(); //Image clicked

Thread.sleep(2000);  //Wait for new window to show up
Set<String> windows = driver.getWindowHandles();

System.out.println(windows.size()); // This returns 1 always.

for(String handle: windows)
{
  driver.switchTo().window(handle);
}
System.out.println(driver.getTitle()); //Prints current window title

```

I have also tried `driver.switchTo().window("<window name>"); // This also doesn't work.`

**HTML Code** for the image being clicked

```
<td style="height: 20px">
<input id="imgPickAcct" align="top" type="image" style="border-width:0px;" onclick="PickAcctClick(711269, 450, 300);" src="images/magnifyglass.gif" tabindex="-1" name="imgPickAcct">
</td>

```

**JS function** code

```
function PickAcctClick(intTransmissionID, intwidth, intheight)
        {
                var lstrPath = 'wfrmGetTransmittedAccounts.aspx?TransmissionID=' + intTransmissionID;
                var returnValues = openModal(lstrPath, intwidth, intheight);
                if (returnValues != undefined)
                {
                document.forms[0].txtFromAccountingID.value = returnValues[0].toString();
                document.forms[0].txtFromDept.value = returnValues[1].toString();
                document.forms[0].txtFromAcct.value = returnValues[2].toString();
                document.forms[0].txtFromCur.value = returnValues[3].toString();
                document.forms[0].txtFromProduct.value = returnValues[4].toString();
                if (isAnObject("txtFromChart1"))
                    {document.forms[0].txtFromChart1.value = returnValues[5].toString();}
                if (isAnObject("txtFromChart2"))
                    {document.forms[0].txtFromChart2.value = returnValues[6].toString();}
                if (isAnObject("txtFromChart3"))
                    {document.forms[0].txtFromChart3.value = returnValues[7].toString();}
                }
                return false;
        }

```

**NOTE:** This is not an alert or dialog window from showModalDialog.
Edit: There is no iFrame.