Не могу HtmlUnitDriver'ом протестировать bootstrap-combobox. http://dl.dropbox.com/u/21368/bootstrap-combobox/index.html. Не сохраняются там выбранные данные. Может кто тестировал эту штуку. Подскажите.
Не могу HtmlUnitDriver'ом протестировать bootstrap-combobox. http://dl.dropbox.com/u/21368/bootstrap-combobox/index.html. Не сохраняются там выбранные данные. Может кто тестировал эту штуку. Подскажите.
Следующий тест проходит успешно:
import org.junit.*;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.support.ui.Select;
import static org.junit.Assert.assertEquals;
public class ComboboxTest {
private static Select theSelect;
@BeforeClass
public static void setUp() {
WebDriver driver = new HtmlUnitDriver();
driver.get("http://dl.dropbox.com/u/21368/bootstrap-combobox/index.html");
theSelect = new Select(driver.findElement(By.cssSelector("select")));
}
@Test
public void testSelection(){
//when
theSelect.selectByVisibleText("Maryland");
//then
assertEquals("Maryland", theSelect.getFirstSelectedOption().getText());
}
}