Reputation: 61
Please, I am trying to test a website with selenium ide. Now, i need to check if the scroll bar exists or no, if it doesn't exist i want to stop the test.
Using javascript can we make this test with : document.getElementById('page').scrollWidth > window.innerWidth
Upvotes: 1
Views: 171
Reputation: 669
You need Selenium IDE flow control to do that
open | https://en.wikipedia.org/wiki/Special:Random
storeEval | window.document.documentElement.scrollHeight>window.innerHeight | ${scroll}
gotoIf | ${scroll} | PASSED
fail_here |
label | PASSED
It is opening a random page of Wikipedia and fails if there is no vertical scrollbar
UPDATE Even more simple:
verifyEval | window.document.documentElement.scrollHeight>window.innerHeight | true
Upvotes: 1