我正在学习如何使用 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.
<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/