Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elements obscured behind fixed navbar not being found #490

Open
Pwntheon opened this issue Nov 25, 2019 · 1 comment
Open

Elements obscured behind fixed navbar not being found #490

Pwntheon opened this issue Nov 25, 2019 · 1 comment

Comments

@Pwntheon
Copy link

We do a run of our test suite on small resolution, and in some cases we get the following issue:

We check an element which causes the screen to scroll. It scrolls just enough for another element to still be inside the viewport, but behind the fixed top navbar. When we then try to click this second element, canopy won't scroll up to reveal it, it just fails with "Timed out!" after a bit.

We have started scrolling to the top of the page in a few of our tests, but as this has been happening quite a few times on different device sizes for different tests, it's starting to feel like we are polluting our code a bit.

Is there an elegant way to solve this? Or maybe make a change in canopy where if an item is inside the viewport but behind another element, try to scroll it to the middle of the viewport before interacting with it?

@lefthandedgoat
Copy link
Owner

It says 'Timed out!' because selenium is trying to click it but it can't because its obstructed by your floating header.

There are several ways to solve it, you can read what others do here: https://stackoverflow.com/questions/34532306/selenium-element-is-hidden-behind-floating-header

Personally I write a little js function to remove the header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants