Relative Content

Tag Archive for javascriptplaywright

Check if element contains any text [duplicate]

This question already has answers here: In playwright asserting for the existence of a text in a element (2 answers) Closed yesterday. In my test case there is an element that should be checked if it contains any text and it’s not empty, and if it’s empty fail the test. I’ve tried to use toHaveText […]

Locate web element by data-testid

I’m using Playwright JavaScript to automate tests. This is the first time I’m going to try calling an element by data-testid instead of id or XPath. If I call an element by XPath like this, for example: