如何使用Selenium WebDriver检查元素是否可单击

如何使用Selenium WebDriver检查元素是否可单击

问题描述:

我有一个容器,其中包含许多元素.我正在遍历这些元素. 我的问题是检查元素是否不可点击的语法是什么.

I have a container, which contains number of elements.I am looping thru the elements. My question is what is the syntax for checking if the element is NOT clickable.

以下应使其起作用-

element.is_displayed() and element.is_enabled()

此代码在Python中.您可以将其更改为您选择的语言.

This code is in Python. You can change it to the language of your choice.