Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Playwright: how to automate scrolling thru the table  #598

@InduKrish

Description

@InduKrish

I have a table with several rows (300+) and with the scroll bar can you please clarify how to scroll the page using playwright? the table load the records as user scrolls the page, and when the scrolling is done all the way to bottom of the table, it loads all the rows in the table. Is there a way in playwright testing library to scroll down till the end of the table ?

Before scrolling, the table shows only certain number of rows, and all other records are invisible, so when we search for something from invisible rows from the table, it is not able to find, eg: 1234 is the order no that i want to search , however it is at the bottom of table, so when i run the following code, it says it is unable to find.

Can you please advise whether i should scroll each time and search for the order no if so can you please tell me how i can scroll thru the table using playwright /playwright dom?

and how to make sure that i scroll thru all the very to bottom of the table?

note: it is infinite scroll where we the table loads certain no of rows as user scroll thru the page . and user can not scroll any further after all rows are loaded.

The table screenshot is attached below.

Screen Shot 2023-02-22 at 5 16 33 AM

Screen Shot 2023-02-22 at 5 21 42 AM

        let awardRound1 = await screen.queryByTestId('paged-table-Vacation').within().getByRole('row', {name: RegexParser("1234")}).within().queryByTestId(/td-IFVacationCrewMemberVacationAccruals-awardedRound1/).textContent();
        console.log("awardRound1" + awardRound1)
        let originalAccruedDays = await screen.queryByTestId('paged-table-Vacation').within().getByRole('row', {name: RegexParser("1234")}).within().queryByTestId(/td-IFVacationCrewMemberVacationAccruals-originalAccruedDays/).textContent();
        console.log("originalAccruedDays" + originalAccruedDays)

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions