You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realized it wasn't possible to do a for await (item of await listItemLocator.all()) to click each item in the list, when the purpose is to delete the item.
The reason for this is that Playwright internally uses nth(0), nth(1)... to click elements. And if the button deletes the element at nth(0) then nth(1), if there are two elements, will not be there.
So a recursive function is the solution:
I realized it wasn't possible to do a
for await (item of await listItemLocator.all())
to click each item in the list, when the purpose is to delete the item.The reason for this is that Playwright internally uses nth(0), nth(1)... to click elements. And if the button deletes the element at nth(0) then nth(1), if there are two elements, will not be there.
So a recursive function is the solution:
Originally posted by @jkohlin in #2034 (comment)
The text was updated successfully, but these errors were encountered: