Scroll to bottom of table

1 Answer 21 Views
Elements
Stanley
Top achievements
Rank 1
Stanley asked on 11 Apr 2025, 10:46 PM

I am testing a .net web app with a data grid. It puts the new record inputs in the last row of the rendered table.

The table is wrapped within a DIV, when the content overflows, a vertical scrollbar is used to navigate the table.

How do I scroll to the last row? The scroll action is not recordable and the available scroll actions only scroll relative to the page top/bottom/middle.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Elena
Telerik team
answered on 15 Apr 2025, 08:55 AM

Hello Stanley,

From what I understand you work on a table control nested into a div. The used component is the standard html table control - <table></table>, styled in a way to automatically add a scroller if the display cannot show the complete table. 

Having this in mind I assume that the scroller, which is visible on the page, is not an actual element within the DOM tree of the page and thus Test Studio cannot directly interact with it. So, this means you can't highlight the scroller and add a step to move it somehow. 

However, I believe you also don't need to. When it comes to tables which represent dynamic data we strongly recommend to automate these in code as this is the most convenient approach. Please, find a few samples in this kb article which can help you in building the coded steps to handle the dynamic html tables. Also, that way scrolling will not be needed at all. 

And if the scenario requires scrolling to a specific row of the table you can use the row element <tr>, or even any of its nested elements to scroll to. That way the built-in scroll actions will be useful for you as you can choose to scroll the row to the center of the page, for example. The scroll actions can be also implemented in the coded step. It will be something like this: 

row.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementCenterAtWindowCenter);

I hope this information is helpful for you. Though I remain available for any additional questions you may have on the topic.

Thank you for your cooperation in advance. 

Regards,
Elena
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
Elements
Asked by
Stanley
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or