Selenium IDE 复选框选中标识

标签 selenium checkbox ide checked

我正在学习如何使用 Selenium IDE,我认为进展顺利,但现在我似乎找不到如何选中该页面上的复选框。

https://www.otelo.de/warenkorb.html?id=-1

我似乎不知道如何查看该复选框是否被选中

如果我尝试记录它,selenium ide 向我展示的唯一内容是 id=mnp

你能帮帮我,告诉我我做错了什么吗?

非常感谢你!

最佳答案

我用过SelBlocks If-Else 插件您可以使用 storeChecked 来存储复选框的状态

storeChecked(locator, variableName)
Generated from isChecked(locator)
Arguments:

   locator - an element locator pointing to a checkbox or radio button

Returns:

      true if the checkbox is checked, false otherwise

Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.

enter image description here

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <title>IfElse</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">IfElse</td></tr>
</thead><tbody>
<tr>
    <td>open</td>
    <td>https://www.otelo.de/warenkorb.html?id=-1</td>
    <td></td>
</tr>
<tr>
    <td>storeChecked</td>
    <td>id=mnp</td>
    <td>state</td>
</tr>
<tr>
    <td>if</td>
    <td>${state}==false</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>id=mnp</td>
    <td></td>
</tr>
<tr>
    <td>endIf</td>
    <td></td>
    <td></td>
</tr>
</tbody></table>
</body>
</html>

关于Selenium IDE 复选框选中标识,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38219382/

相关文章:

python - python selenium中的鼠标悬停操作

css - 如何编写 XPath 或 CSS 表达式?

javascript - 在 react 中用复选框填充Json表并根据JSON数据检查它们

ide - 允许在调试时进行编辑的 PowerShell IDE

Qt Creator 帮助 : Font size is too small

java - IntelliJ 太多文件打开错误

testing - 如何验证可选字段?

python - 如何使用 python 使用 selenium 从网页中提取项目列表

javascript - 里面有文字的复选框

javascript - 使用 Javascript 交换两个样式表 CSS 文件