خرید بک لینک

Vote count: 0

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 retus 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 retuValues = openModal(lstrPath, intwidth, intheight);
                if (retuValues != undefined)
                {
                document.forms[0].txtFromAccountingID.value = retuValues[0].toString();
                document.forms[0].txtFromDept.value = retuValues[1].toString();
                document.forms[0].txtFromAcct.value = retuValues[2].toString();
                document.forms[0].txtFromCur.value = retuValues[3].toString();
                document.forms[0].txtFromProduct.value = retuValues[4].toString();
                if (isAnObject("txtFromChart1"))
                    {document.forms[0].txtFromChart1.value = retuValues[5].toString();}
                if (isAnObject("txtFromChart2"))
                    {document.forms[0].txtFromChart2.value = retuValues[6].toString();}
                if (isAnObject("txtFromChart3"))
                    {document.forms[0].txtFromChart3.value = retuValues[7].toString();}
                }
                retu false;
        }

NOTE: This is not an alert or dialog window from showModalDialog.

asked 52 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 29 ارديبهشت 1395 ساعت: 13:03

صفحه بندی