-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
Area: browserThe browser moduleThe browser module
Description
What
Confusion about when locator
s are evaluated vs created. For example:
const l = page.locator('#some-id');
is a synchronous API that hasn't interacted with the page yet. It doesn't return an error or do any form of validation at this stage, so if the selector is incorrect you will only find out later when you use a locator method like:
await l.click();
does it actually use the selector #some-id
in the locator against the website under test.
Solution
Some details already exist: https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/.
Also take a look at the Playwright docs to get a better understanding of what they do and why they're useful.
Metadata
Metadata
Assignees
Labels
Area: browserThe browser moduleThe browser module