gpt4 book ai didi

selenium - 在 selenium ide 中使用 if/else

转载 作者:行者123 更新时间:2023-12-02 19:05:38 25 4
gpt4 key购买 nike

我尝试在 Selenium IDE 中单击一个复选框 - 但前提是它尚未处于事件状态。

我正在使用 Selenium IDE 来创建我的测试,并使用 htmlsuite 来运行它们 - 有人知道我如何在其中使用“if”吗?

最佳答案

您必须从 official page 下载 Selenium IDE 的 Flow Control 插件(aaa一直向下)。

我发现的最有用的链接是这个,因为它有一个完整的示例:http://selenium.10932.n7.nabble.com/if-else-statement-td4370.html

无论如何,还有一个documentationauthor's blogpost解释更多内容。

<小时/>

我所知道的唯一替代方案是 implementing the whole logic in javascript - 包括测试步骤。这是可能的,要正确执行有点困难,但如果您最终陷入没有插件的 IDE,那么这可能是您唯一的拯救:

var value = this.browserbot.findElement("id=someInput").value;
if (value == "Slanec is the best!") {
this.browserbot.findElement("id=someButton").click();
}

关于selenium - 在 selenium ide 中使用 if/else,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11275354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com