Код: Выделить всё
public static void SetSelect2Option(this IWebDriver driver, By locator, string subContainerClass, string searchTerm, TimeSpan? ajaxWaitTimeSpan = null)
{
var select2Product = driver.FindElement(locator);
select2Product.Click();
var searchBox = driver.FindElement(By.CssSelector(subContainerClass + " .select2-input"));
searchBox.SendKeys(searchTerm);
if (ajaxWaitTimeSpan != null)
{
driver.Manage().Timeouts().ImplicitlyWait(ajaxWaitTimeSpan.Value);
}
var selectedItem = driver.FindElements(By.CssSelector(subContainerClass + " .select2-results li")).First();
selectedItem.Click();
selectedItem.SendKeys(Keys.Enter);
}
Я также устал использовать API http://code.google.com/p/selenium/wiki/ ... teractions с аналогичными результатами.
Кто-нибудь раньше сталкивался с подобной проблемой?
Подробнее здесь: https://stackoverflow.com/questions/177 ... -webdriver
Мобильная версия