While working on UI automation, I came across an interesting behavior. Typically, I use JS function or actions.moveToElement(WebElement) to scroll to a particular element. This method works well for checkboxes, textboxes, and buttons types of elements. However, when I need to move to a table cell in a table with multiple columns, I notice that the table shifts to the left almost every time. For example, if I have a 5x5 table and I only loop over the 5th column, using scroll2element with either function causes the entire table layout to become messed up - all previous columns disappear and the 5th column shifts to the left.
To work around this issue, I have found that scrolling to the button located above the table instead of the specific table cell resolves the problem. I'm curious if anyone else has encountered this issue and how they have addressed it. Thank you!