如何在不使用javascript的情况下使用selenium.waitforvalue命令?

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

我还没有使用javascript,但是我想像在Internet Explorer中一样使用chrome中的waitforvalue命令。

ie.waitforvalue script document.getElementsByClassName("footer").length expectedvalue 1

还有其他格式可以使用selenium.waitforvalue命令而不使用javascript吗?

javascript automation rpa g1ant
1个回答
0
投票

当前,在不使用javascript的情况下,G1ANT无法使用selenium.waitforvalueie.waitforvalue命令。

通过改进代码的方式。我想您只是想等待footer类元素被加载,而不是专门检查元素编号是否为1。

这是检查是否加载footer类的任何元素的方法:

selenium.waitforvalue script ‴return !!document.getElementsByClassName("footer").length > 0‴ expectedvalue true

或者如果您正在使用ie.waitforvalue命令:

ie.waitforvalue script ‴!!document.getElementsByClassName("footer").length > 0‴ expectedvalue true
© www.soinside.com 2019 - 2024. All rights reserved.