mercredi 21 août 2019

Selecting a checkbox with selenium doesn't always register

I am clicking on a checkbox using Selenide and I can see that a check is present following the click, however, sometimes when I move onto the next page with the selected checkboxes, it acts as if they are not in-fact checked.

What I am thinking the problem is that sometimes selenide completes the click operation before the page is fully loaded, and with that it shows the checkmark in the checkbox, but it isn't actually checked.

I have tried putting a sleep before the click to wait for the page to load, WebDriverWait's wait.until(ExpectedConditions.visibilityof(element)), Selenide's element.waitUntil(visible, 5000), while(element.getAttribute("checked) == null).

So I don't know how to deal with it when I am seeing the checkmark, but it doesn't actually select.




Aucun commentaire:

Enregistrer un commentaire