Добрый день!
При нажатии на кнопку сайта, всплавет попап, в который необходимо ввести текст. Вот его код
<div id="zoom" style="z-index: 666; position: absolute; top: 939px; left: 500px; width: 680px; height: 370px;">
<table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;">
<tbody>
<tr>
<td class="tl" style="background:url(http://ua.20.img/images/tl.png) 0 0 no-repeat; width:20px; height:20px; overflow:hidden;"></td>
<td class="tm" style="background:url(http://ua.20.img/images/tm.png) 0 0 repeat-x; height:20px; overflow:hidden;"></td>
<td class="tr" style="background:url(http://ua.20.img/images/tr.png) 100% 0 no-repeat; width:20px; height:20px; overflow:hidden;"></td>
</tr>
<tr>
<td class="ml" style="background:url(http://ua.20.img/images/ml.png) 0 0 repeat-y; width:20px; overflow:hidden;"></td>
<td class="mm" style="background:#fff; vertical-align:top; padding:10px;">
<div id="zoom_content" style="width: 100%; height: 100%; overflow: hidden;">
<div class="contactWithAuthorAdBlockInsWait waitBlock"></div>
<div class="infoPOP02 contactWithAuthorAdBlockIns">
<div class="topLine48">
<div class="inPoEv">
<form onsubmit="showBlurWait('#zoom .contactWithAuthorAdBlockIns', '#zoom .contactWithAuthorAdBlockInsWait'); jQuery.ajax({data:jQuery.param(jQuery(this).serializeArray()) + '&authenticity_token=' + encodeURIComponent('a13216acbb002b9dd022ebd54f8211b89c47f551dbf9e8aa6b88ce54b5d9f091'), dataType:'script', error:function(request){closeFeedback();}, success:function(request){if (validateFeedbackResponseJson(request, 'cwa', '#zoom .contactWithAuthorAdBlockInsWait', 'cwa_simple_captcha_wrapper', 'cwa_captcha')){closeFeedback();showSuccessFeedbackJson(request);}}, type:'post', url:'http://real-estate.20.local/ru/ajax/contact_with_author'}); return false;" method="post" action="http://real-estate.20.local/ru/ajax/contact_with_author">
<div style="margin:0;padding:0;display:inline">
<input id="contact_with_author_obj_id" type="hidden" value="9309320" name="contact_with_author[obj_id]">
<input id="contact_with_author_obj_type" type="hidden" value="advertisement" name="contact_with_author[obj_type]">
<div class="inPoEvMarg2">
<div class="inPoEvMarg3">
<div class="greyB03">
<table class="formTablePOP02" width="577" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<tr>
<td colspan="2">
<div class="onLineHint">
<textarea class="cont_with_auth_body popfi05" maxlength="5000" name="contact_with_author[body]" cols="3" rows="3"></textarea>
<div class="fbAlertMess hidenBlock cwaBodyErMess" style="display: none;">Введите сообщение</div>
</td>
</tr>
<tr>
<tr>
</tbody>
</table>
</div>
</div>
</form>
</div>
<div class="topLine48a">
</div>
</div>
</td>
<td class="mr" style="background:url(http://ua.20.img/images/mr.png) 100% 0 repeat-y; width:20px; overflow:hidden;"></td>
</tr>
<tr>
</tbody>
</table>
<a id="zoom_close" style="position: absolute; top: 0px; left: 0px; display: block;" title="Close" href="#" curtop="1168" curleft="478" scaleimg="false">
</div>
Попытки определить название данного окна не увенчались успехом. Я пробывал:
// get all the window handles before the popup window appears
Set<String> beforePopup = driver.getWindowHandles();
// click the link which creates the popup window
driver.findElement(By.className("contact_with_author")).click();
Thread.sleep(5000);
// get all the window handles after the popup window appears
Set<String> afterPopup = driver.getWindowHandles();
// remove all the handles from before the popup window appears
afterPopup.removeAll(beforePopup);
System.out.println(afterPopup);
// there should be only one window handle left
if(afterPopup.size() == 1) {
System.out.println(afterPopup);
} else {System.out.println("Не судьба");
Т.к. в данном случае afterPopup = null
Ну и собственно вопрос, как мне туда попасть?
P.S. Немного пишу на Java, selenium 39, FF 26.0