如果我能得到以下问题的解决方案,那将非常有帮助。
我无法从隐藏的Radcombobox
中选择某个项目。下面的代码只启用了字段,我可以看到组合框在几分之一秒内下降,但未指定项目指定。请帮我纠正我的代码。
HTML脚本
<a id="cmb_40_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a>
Java代码
((JavascriptExecutor)driver).executeScript("arguments[0].click();", getElement("InterPoint")); //This is the combobox field
new FluentWait<WebDriver>(driver)
.withTimeout(1000, TimeUnit.SECONDS).pollingEvery(1, TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class)
.ignoring(StaleElementReferenceException.class)
.until(new Function<WebDriver, Boolean>() {
@NotNull
@Override
public Boolean apply(WebDriver webDriver) {
WebElement element = getElement("CustomerPole"); /*This is the item from the field "Interpoint"*/
return element != null && element.isDisplayed();
}
});
尝试了下面的代码,它不起作用
//waitpgm.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(" //*[@id='pnlHeaderInterconnectionPointInformation']"))).click();
//waitpgm.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='cmb_40_DropDown']/div/ul/li[2]"))).click();
//waitpgm.until(ExpectedConditions.elementToBeClickable(getElement("CustomerPole"))).click();