我还没有使用javascript,但是我想像在Internet Explorer中一样使用chrome中的waitforvalue命令。
ie.waitforvalue script document.getElementsByClassName("footer").length expectedvalue 1
还有其他格式可以使用selenium.waitforvalue命令而不使用javascript吗?
当前,在不使用javascript的情况下,G1ANT无法使用selenium.waitforvalue
或ie.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