-1
通過sendkeys傳遞文本後,我沒有獲取列表以選擇該項目。在selenium webdriver中使用sendkeys後無法獲取列表
- 請問,請問這是什麼問題。
- 網站www.kuoni.co.uk
WebElement createHolidayText = driver.findElement(By.cssSelector("div[class=\"span12 sections\"] >ul > li > a[data-section-id=\"972cfe76_6ba0_408d_a6df_0ef2d74cf943\"] > span"));
assertThat("Create Holiday Text has changed. Please check!", createHolidayText.getText(), is("Create your holiday"));
WebElement clickCreateYourHoliday = driver.findElement(By.cssSelector("div[class=\"span12 sections\"] >ul > li > a[data-section-id=\"972cfe76_6ba0_408d_a6df_0ef2d74cf943\"] > span"));
clickCreateYourHoliday.click();
WebDriverWait wait = new WebDriverWait(driver, 20);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("iframe[src=\"http://booking.kuoni.co.uk/include/home/include-book-home11.html\"]")));
WebElement searchFrame = driver.findElement(By.cssSelector("iframe[src=\"http://booking.kuoni.co.uk/include/home/include-book-home11.html\"]"));
driver.switchTo().frame(searchFrame);
WebElement destination = driver.findElement(By.cssSelector("input[id=\"destination\"]"));
destination.sendKeys("SSH");