Суть проблемы:
При выполнении
selenium.click("link=Delete");появляется пустое окно.
Сама ссылка -
<a href="java script:Delete('&Address_AddressID=141')">Delete</a>Функция Delete -
function Delete(KeyValue) { var Key2 = ''; if (document.inputForm.SortColumn && document.inputForm.SortDirection) { Key2 = '&SortColumn=' + document.inputForm.SortColumn.value; Key2 += '&SortDirection=' + document.inputForm.SortDirection.value; } document.inputForm.action = "адрес страницы" + KeyValue + Key2; document.inputForm.target = "_self"; var sWidth = 300; var sHeight = 125; var left = (screen.width - sWidth) / 2; var top = (screen.height - sHeight) / 2; sAttr = "width=" + sWidth + ",height=" + sHeight + ",top=" + top + ",left=" + left + ",resizable=no,titlebar=no"; var popupWindow = window.open ( "" , "" , sAttr); popupWindow.document.open(); popupWindow.document.write('<html><head><title>Close</title><style type="text/css">BODY{FONT-SIZE: 8pt}FONT.Message{FONT-SIZE: 8pt; COLOR: #000000; TEXT-DECORATION: none}.Window{BACKGROUND-COLOR: #CCCCCC}</style><meta http-equiv="Content-Type" content=text/html; charset="UTF-8"></head><body class="Window" onblur="window.focus()" onload="window.focus()"><p><font class="Message" face="Verdana, Arial, Helvetica, sans-serif">Are you sure you want to delete this item?</font></p><form method="post" target="_self"><p><center><br><input type=button value=" OK "onclick="window.opener.document.forms[0].submit();window.close();"> <input type=button value=" Cancel " onclick="window.close();"></center><p></form></body></html>'); popupWindow.document.write(" "); popupWindow.document.close(); }При нажатии selenium на ссылку появляется пустой PopUp.
В Selenium Log Console
# info(1234363091232): Executing: |click | link=Delete | | # warn(1234363091271): Opening window '_blank', which is not a real window name. Randomizing target to be: selenium_blank85764
На Фаерфоксе стоит Фаербаг. У него в консоли появляютсядве такие ошибки.
Permission denied to get property Window.document [Break on this error] popupWindow.document.open();
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: :: line 644" data: no] [Break on this error] null
При выполнении этого же теста в IE6 всё выполняется номально.
После выполнения этого же действия после обновления страницы вручную всё открывается корректно.
Selenium IDE также не вызывает проблем.
P. S. Не знаю, относится ли к делу, ссылка является частью одного из нескольких фреймов на странице.