Scrolling until object is visible up/down and left/right


#1

I am workig with Ag-Grid and have gor data drivimg working with the grid

However columns and rows not shown on screen are invisible until the are scrolled to.
Any idea how to do this?
in c# I would use a try catch and scroll on the exception until the value is visible which is a bit crude. This is easy scrolling vertically as I can use the home key to scroll to the top first. But for horizontal scrolling how would i scroll to the far left or right to set the starting point.

obviously if there is a more elegant solution i would prefer that.


#2

Hi @louis.oliver

This probably won’t work, but did u try:


#3

You can try and use javascript to Scroll into view

WebElement element = WebUI.executeJavaScript("return document.getElementById('someId');", null)
element.scrollIntoView(); 
element.scrollIntoView(alignToTop); 
element.scrollIntoView(scrollIntoViewOptions);

Link

but when there not shown you might not have another choice as to scoll and check.