I'm working on a test which, at some point, records some datas displayed in a scrollable table:
<div class='table-body'>
<div class='scroll-wrapper>
<div class='row'>
<button class='button' type='button'></button>
<div class='inner-data></div>
</div>
<div class='row'>
<button class='button' type='button'></button>
<div class='inner-data></div>
</div>
<div class='row'>
<button class='button' type='button'></button>
<div class='inner-data></div>
</div>
</div>
</div>
The total number of line present in the table is displayed on the screen, allowing me to use a while loop in order to be sure to collect all the datas.
However, as you can see on the html code, each row has a button i'm clicking for every row. And here is my issue : at some point, my method find_elements_by_css_selector(div.row)
finds a WebElement which is not visible on the window, and tries to click on its <button>
.
Consequently, i get the following error:
ElementNotInteractableException: Message: Element <button class="btn" type="button"> could not be scrolled into view
I tried using is_displayed()
method and is_enabled()
to check if the element is visible on the screen, unfortunately they are always returning True.
Do you guys have any solutions ?