question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Find elements will auto scroll them into my headerbar.

See original GitHub issue

Hi,

Im having a problem with my tests just now and im not sure how to go abotu fixing it. This may be awebdriver problem rather than a protractor one, im no sure.

My site has a fixed nav bar at the top, and on some elements when i use findElement() it will scroll them to the “top” of the page, which is underneath my header bar so when i try to click() them i get the following error

UnknownError: unknown error: Element is not clickable at point (728, 7). Other element would receive the click: <div class="navbar-collapse collapse" collapse="!isCollapsed" style="height: 0px;">…</div>

i was wondering if there is a way to specify the “padding” space my site requires or do i need to manually scroll after every findElement() ??

Any help or pointers to other reading material would be fantastic.

P.S when i finally solve this i intend to raise a PR adding to FAQ’s for the next poor fellow 😃

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
msaficommented, Mar 29, 2015

As a current workaround, I get Protractor to execute this script when it loads the page to unfix the nav bar just for the tests:

browser.executeScript("document.querySelector('.header').style.position = 'absolute'")
0reactions
juliemrcommented, Jul 13, 2016

Closing this - I’m cleaning up old issues, and the external bug here has been closed as working as intended.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scroll Element into View with Selenium - Stack Overflow
This will scroll until the element is in view: WebElement element = driver.findElement(By.id("id_of_element")); ((JavascriptExecutor) ...
Read more >
Scroll an element into the center of the viewport - Hidde's blog
scrollIntoView() , which scrolls an element into view. Element.scrollIntoView() can take two types of elements: a boolean or an object. The object argument ......
Read more >
ListView - .NET MAUI | Microsoft Learn
ListView can present a header and footer that scroll with the items in the list. The header and footer can be strings, views,...
Read more >
overscroll-behavior - CSS: Cascading Style Sheets | MDN
Focus on this container, scroll to the bottom and when you reach the bottom keep scrolling. If you have overscroll-behavior: auto; selected the...
Read more >
How to Use Scroll Panes - Oracle Help Center
You can set the policies when you create the scroll pane or change them dynamically. Of the constructors provided by JScrollPane , these...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found