Задача:
1. Зайти на сайт
2. Кликнуть на ссылке Войдите, чтобы увидеть содержание - откроется новое окно с регистранцией
3. Зарегистрироваться
4. Нажать на кнопку "Войти" - окно регистрации закроется.
5. На сайте проверить наличие картинки с вашим фото.
Код
package com.example.tests;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.SeleneseTestCase;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;
public class FB_04 extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
WebDriver driver = new FirefoxDriver();
String baseUrl = "http://hotels24.stage/";
selenium = new WebDriverBackedSelenium(driver, baseUrl);
}
@Test
public void testVK_01() throws Exception {
selenium.open("/?target=search&event=hotel®ion_id=1222&city=%D0%9A%D0%B8%D0%B5%D0%B2&unknown_dates=on&max_persons=2");
selenium.selectFrame("");
selenium.click("id=login");
selenium.waitForPageToLoad("30000");a
selenium.selectWindow("name=_e_1htB");
selenium.type("id=email", "alena.bartosh@gmail.com");
selenium.type("id=pass", "A5698569");
selenium.click("id=ud0djk_2");
selenium.waitForPageToLoad("30000");
selenium.selectWindow("null");
verifyTrue(selenium.isElementPresent("css=img.profileimage.img"));
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
Застряла на стоке перехода в другое окно selenium.selectWindow("name=_e_1htB");
Программа просто завершает работу с ошибкой Unable to select window with title: _e_1htB
Подскажите, пожалуйста, как это можно исправить.