Javascript 如何在Firefox上使用Selenium IDE测试是否存在滚动条
请,我正在尝试用selenium ide测试一个网站。现在,我需要检查滚动条是否存在,如果不存在,我想停止测试。Javascript 如何在Firefox上使用Selenium IDE测试是否存在滚动条,javascript,selenium-ide,Javascript,Selenium Ide,请,我正在尝试用selenium ide测试一个网站。现在,我需要检查滚动条是否存在,如果不存在,我想停止测试。 使用javascript,我们可以使用:document.getElementById('page').scrollWidth>window.innerWidth您需要Selenium IDE流控制来完成此测试 open | https://en.wikipedia.org/wiki/Special:Random storeEval | window.document.d
使用javascript,我们可以使用:
document.getElementById('page').scrollWidth>window.innerWidth
您需要Selenium IDE流控制来完成此测试
open | https://en.wikipedia.org/wiki/Special:Random
storeEval | window.document.documentElement.scrollHeight>window.innerHeight | ${scroll}
gotoIf | ${scroll} | PASSED
fail_here |
label | PASSED
它正在打开维基百科的一个随机页面,如果没有垂直滚动条,就会失败
更新更简单:
verifyEval | window.document.documentElement.scrollHeight>window.innerHeight | true