【问题标题】:How to click on the DIV dropdown values using selenium when there are no <options> kind of tags are coded当没有 <options> 类型的标签被编码时,如何使用 selenium 单击 DIV 下拉值
【发布时间】:2019-08-06 04:39:03
【问题描述】:

我无法从下拉列表中获取正在显示的选项的元素,在 Source 中,我找不到列出的任何选项。

元素如下:

<div id="trigger-picker" class="x-form-trigger x-form-trigger-default x-form-arrow-trigger x-form-arrow-trigger-default "></div>

请帮忙。

【问题讨论】:

标签: java selenium automation webdriver


【解决方案1】:

解决方法如下: 1.点击下拉菜单:driver.findElement(By.cssSelector("div#trigger-picker")).click() 2.点击下拉菜单后,会显示选项,然后选择您想要的选项

【讨论】:

    【解决方案2】:

    可能存在等待问题。您需要等待元素可点击。

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.id("trigger-picker"))).click()
    

    【讨论】:

    • 问题不在于下拉按钮..我可以点击下拉按钮并获取列表..但选项是动态的,无法找到列表的任何元素详细信息..跨度>
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2018-02-04
    • 1970-01-01
    • 1970-01-01
    • 2022-08-13
    • 2019-03-10
    • 1970-01-01
    相关资源
    最近更新 更多