python - 无效元素状态异常 : Message: invalid element state: Element is not currently interactable and may not be manipulated

标签 python selenium selenium-webdriver selenium-chromedriver robotframework

我正在将 SeleniumLibrary 用于 Robot Framework,但我确实遇到了有关输入文本功能的问题:

HTML:

<div class="form-group">
<label class="col-sm-6 control-label" for="gngFeeValue" >What is the expected Fee Value?</label>
    <div class="col-sm-4">
            <input id="gngFeeValue" data-role="numerictextbox"
                                        data-format="###,###,###,###,###,##0"
                                        data-decimals="0"
                                        data-spinners="false"
                                        data-bind="value: gng.feeValue, disabled: isInputDisabled" placeholder="Enter fee value" />
        </div>
</div>

TEST.机器人:
Expected Fee Value - Value

[Arguments]    ${expectedFeeValue}
Input Text   //*[@id="gngFeeValue"]    ${expectedFeeValue}

我确实收到一个错误:
InvalidElementStateException: Message: invalid element state: Element is not currently interactable and may not be manipulated

任何人都可以帮助我解决这个问题?谢谢!

最佳答案

我有同样的问题。我在特定表单上找不到任何元素。
我意识到我可以正常使用表单之外的元素。于是我开始研究html,发现它在一个里面。 iframe .
为了解决这个问题,我只需要 SeleniumLibrary Select Frame :

Select Frame                        xpath=//*[@id="iframe"]

关于python - 无效元素状态异常 : Message: invalid element state: Element is not currently interactable and may not be manipulated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48373198/

相关文章:

python - 如何在pandas中只返回一个group by?

java - 如何减少要隐藏的元素列表中的重复代码 (Java/webDriver)

angular - 元素状态无效 : Element must be user-editable in order to clear it error trying to click and insert a date on a dropdown-toggle using Selenium

python - 如何使用 Python 截取整个滚动元素的屏幕截图

python - 从python中的其他文件导入函数

python - __instancecheck__ - 覆盖显示无效 - 我做错了什么?

python 子进程换行符被转义

python - Selenium RC : how to capture/handle error?

java - Selenium Java : How to get current ChromeDriver instance's user directory and version using ChromeCapabilities

python - 使用 Selenium/Python/Nose 时浏览器实例化两次