Get the actual focused element with BrowserLibrary

Every time that I press arrowDown, the focus switches to the element below the before one, so I wanna do a loop like this:
For ${counter} IN RANGE 0 999
${element}= Get Actual Focused Element
${element_text}= Get Text ${element}
Exit For Loop If ${element_text} == Desired Text
Keyboard Key arrowDown ${element}

There’s any way to do that using the browserlibrary? I think that’s already possible in SeleniumLibrary

Currently this is not possible out of the box, but should be relative easy to implement [Feature] hasFocus method on element · Issue #2159 · microsoft/playwright · GitHub

Can you raise an issue so that it gets implemented

1 Like