1
votes

I'm using angular in my frontend, in some part of my page I included virtual scrolling:

https://material.angular.io/cdk/scrolling/overview

For those who don't know, it's used to avoid render all the data at once in huge lists, what it does is it include in the frontend only those items that are shown depending on scroll bar.

Now I want to check that all the items are in this virtual table, so, what i need is scroll down until the item locator apears.

I was thinking in something like scroll down about 50 px and check if item is there, if it is, then stop, else continue scrolling.

The problem is I can't find how to scroll using robot framework, I only see:

Scroll Element Into View    ${locator}

But it's not useful for me because my item is not "hidden" it doesnt exist.

is it a way to do something like:

Scroll down my item 50px     ${locator}

And

Scroll my item to top   ${locator}
1

1 Answers

0
votes

And what about if element does not have an id? I made this kEYWORD but is a little intrusive with DOM

Scroll to xpath
[Arguments]         ${xpath}
    ${tmp}=     SeleniumLibrary.get element attribute   ${xpath}    id
    assign id to element    ${xpath}     scrollID
    execute javascript      document.getElementById('scrollID').scrollIntoView();
    run keyword if  '${tmp}' != '${EMPTY}'    assign id to element    ${xpath}     ${tmp}

Any suggestions will be appreciated