【问题标题】:ElementNotInteractableException: Message: element not interactable: Element is not currently visible and may not be manipulated using robot frameworkElementNotInteractableException:消息:元素不可交互:元素当前不可见,可能无法使用机器人框架进行操作
【发布时间】:2020-07-27 05:16:43
【问题描述】:

我遇到的问题是下拉菜单。

当我执行脚本时,我收到以下错误:ElementNotInteractableException:消息:元素不可交互:元素当前不可见,可能无法操作

当我查看 html 时,我看到下拉菜单“IsActive”有一个可用的 ID,但是当我检查元素时,另一个 ID 存在“IsActive_Chosen”

我该如何克服这个问题?

提前致谢。

【问题讨论】:

    标签: python html selenium robotframework


    【解决方案1】:

    尝试ActionChains 解决您的问题:

    wait = WebDriverWait(driver, 10)
    selectElement=wait.until(EC.presence_of_element_located((By.CLASS_NAME, "form-control chosen-select")))
    ActionChains(drivers).move_to_element(selectElement).click().perform()
    

    注意:请在您的解决方案中添加以下导入

    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.action_chains import ActionChains
    

    【讨论】:

      猜你喜欢
      • 2020-12-08
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 2018-09-17
      • 1970-01-01
      • 2018-06-30
      • 1970-01-01
      • 2019-04-05
      相关资源
      最近更新 更多