简体   繁体   English

如何使用Selenium IDE识别禁用的单选按钮?

[英]How to identify disabled radio buttons using Selenium IDE?

使用Selenium IDE记录脚本时,我可以记录“启用” /“ FF”单选按钮,但是,当我要检查“禁用”单选按钮时,它并没有显示“启用”或“关闭”按钮的唯一ID。这两个按钮都处于“禁用”状态时只有一个ID。如何在禁用状态下分别获取它们的状态或ID。

You can use Xpath to check if the disabled attribute is set properly. 您可以使用Xpath来检查Disabled属性是否设置正确。 Use this as your target and replace id-Attribute with the name-attribute if needed and the content of the value-attribute. 将其用作目标,并在需要时将id-Attribute替换为name-attribute,并替换value-attribute的内容。 If no disabled-attribute exists, Selenium will display an error. 如果不存在禁用属性,则Selenium将显示错误。

Xpath: Xpath:

//input[@id='a' and @value='2']/@disabled

You should try verifyElementValue command :) or storeElementValue and then match result. 您应该尝试verifyElementValue命令:)或storeElementValue ,然后匹配结果。 you can see more information about this commands in Selenium 您可以在Selenium中查看有关此命令的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM