Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Selenium 4.5.0 | NotImplementedError when attempting actions on disabled elements

未关闭
#1,790 4 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
testing-qa

调研方向

首先,使用 Selenium 4.4.3 和 4.5.0 运行提供的 Robot Framework 复现,然后查看链接的、关于禁用元素行为的 Selenium issue 和 commit。跟踪 Get Selected List Label 使用的 SeleniumLibrary keyword,并验证可以从禁用列表中读取已选选项,同时不会破坏其他操作。

由索引模型根据 Issue 内容生成。

描述

For issues

Steps to reproduce the issue

Using selenium 4.5.0+

*** Settings ***
Library   SeleniumLibrary

*** Test Cases ***
Test Disabled Elements
    Open Browser   https://demos.jquerymobile.com/1.4.5/forms-disabled    browser=chrome
    Maximize Browser Window
    ${list_selection}=        Get Selected List Label   //select[@id='select-native-5']
    List Selection Should Be  //select[@id='select-native-5']      ${list_selection}

Error messages and additional information

NotImplementedError: Select element is disabled and may not be used.

This seems to be caused by a change in https://github.com/SeleniumHQ/selenium/issues/10812 (specifically https://github.com/SeleniumHQ/selenium/commit/e2bbb54153370ee56b43e7260aef5923ec826be4#diff-48418bfd0178cef4e4f71bf60506204d33e152281f0bb5a670b9295689b6e01e) and from the looks of the discussion it may not be changed unless there is good cause so I wanted to bring it up here in case there were opinions on the matter. This more than likely extends to quite a few keywords and I am not quite sure what the solution would be on the SeleniumLibrary side.

Expected behavior and actual behavior

We should be able to get the selected option regardless of whether the list is disabled or not. Using the previous selenium release (4.4.3) works just fine.

Environment

Browser: Chrome latest
Browser driver: chrome latest
Operating System: Windows 10
Libraries

  • Robot Framework: 5.0.1
  • Selenium: 4.5.0
  • SeleniumLibrary: 6.0.0
  • Interpreter: Python 3.9
主要语言
Python
星标
1.5k
派生
787
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

robotframework/SeleniumLibrary 的其他 Issue

查看 robotframework/SeleniumLibrary 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。