Conveying element not optically visible

I am starting to test Java Script and Protractor / Selenium.

This is what I would like to check:

I would like to test the scrolling functionality on a page using Protractor.

I thought about using a - isDisplayed()).toBe(false);

. However, the element I would test would still be on the page, just not optically visible.

Is there a test to see if I click on an element at the top of the page, does the browser actually move to a new position on the page?

I would be interested to either check that the element is not optically present in the browser window, or if the page has moved to a specific location.

Thanks for the help!

+3


source to share


1 answer


isDisplayed()

is a tool for the task. The webdriver implementation is quite complex and returns false

if the element is not "optically" visible.

Quoting from "Displaying Items" webdriver spec:



The visibility of the Document element is focused on what is perceived by the human eye perceptually.

Pay attention to the complex logic involved in checking if an element is visible or not.

+2


source







All Articles