如何使用 Selenium IDE 验证 HTML 元素不存在

问题描述 投票:0回答:2

我在 FF 上使用 Selenium IDE 来验证某些 HTML 源代码不应出现在页面中。

enter image description here

我使用的语法是:

Command: verifyNotHtmlSource

Target: css=iframe#MainFrame

Value: Cl<sup>-</sup>

我执行了这个命令,我预计它会失败(因为 HTML 源代码中有“

Cl<sup>-<sup>
”)。 但还是过去了!!! enter image description here

我们能找出原因吗?如何验证“

Cl<sup>-</sup>
”不在 HTML 源代码中?

html selenium-ide
2个回答
0
投票

assertElementNotPresent | //sup |
还是
verifyElementNotPresent | //sup |
怎么样?


0
投票

您可以考虑使用assertNotVisible 和元素的简单CSS 选择器;如果不存在,结果将为 true。

例如:

assertNotVisible
css=h2 sup
© www.soinside.com 2019 - 2024. All rights reserved.