Reputation: 31
I'm a Java Script and Protractor/Selenium testing beginner.
This is what I would like to test:
I would like to test an in-page auto scroll functionality with Protractor.
I thought about using a - isDisplayed()).toBe(false);
- However the element that I would be testing against will still be on the page, just not optically visible.
Is there a test to see if when the element on the top of the page is clicked, the browser does in fact move to the new position on the page?
I would be interested in either verifying that the element is not optically present in the browser window OR if the page did move to a certain location.
Thanks for the help!
Upvotes: 3
Views: 103
Reputation: 474221
isDisplayed()
is the tool for the job. It's webdriver implementation is quite complex and it would return false
if the element is not "optically" visible.
Quote from "Element Displayedness" webdriver specification:
The visibility of a Document element is guided by what is perceptually visible to the human eye.
Pay attention to the complicated logic involved in verifying whether an element is visible or not.
Upvotes: 2