In an interview, a colleague of mine said that they needed to select an element which had no selectors other than the text inside of a div
which would not work for what they needed.
I am currently preparing for my own interview and am wondering if there is any way to select an element in this way?
This thread is trying to answer question "Is there any way to select an element that does not have any built-in selectors?"
In some cases, if you have similar elements but you need to identify a specific one, you could also add your own classes to the element. I have a case where a form is saved and it shows a toast container telling the user that saving was (un)succesful. If I save many forms in a row quickly enough, Playwright can't tell the toast containers apart, so I resorted to marking seen toast containers with my own class .toast-seen
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].