如何使用Selenium WebDriver检查元素是否可单击 [英] How to check if an element is clickable or not using Selenium WebDriver

查看:314
本文介绍了如何使用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.

这篇关于如何使用Selenium WebDriver检查元素是否可单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆