Selenium WebDriver を使用してテストを実行しています
入力テキストフィールド("Select Source: By Name:")に問題があります。テキストフィールドに「ABC Premium News (Australia)」という文字列を入力すると、オプションが表示されます。次に、それをクリック (または選択) する必要があります。fireEvent を使用してすべてのメソッドを試しました...使用できません。
ソースコードは次のとおりです。
driver.get("http://www...");
driver.switchTo().frame("mainFrame");
WebElement sourceTitle = driver.findElement(By.name("sourceTitle"));
sourceTitle.sendKeys("ABC Premium News (Australia)");
//Now a "combobox-like" option "ABC Premium News (Australia)" shows up...how do I click it?
// I tried fireEvent...it did not help. The following is one of my trials that does not work:
DefaultSelenium sel = new WebDriverBackedSelenium(driver,"http://www....");
sel.type("//input[@id='destination']", "ABC Premium News (Australia)");
sel.fireEvent("//input[@id='destination']", "keydown");
// In addition to keydown, I tried: onclick, onfocus, onblur...