Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: strictSelectors does not affect Locators (#19414)

Yury Semikhatsky0cb1e97528cc
diff --git a/docs/src/api/params.md b/docs/src/api/params.md
index 50d38efa12..3e0c71cd89 100644
--- a/docs/src/api/params.md
+++ b/docs/src/api/params.md
@@ -677,8 +677,9 @@ contexts override the proxy, global proxy will be never used and can be any stri
## context-option-strict
- `strictSelectors` <[boolean]>
-If specified, enables strict selectors mode for this context. In the strict selectors mode all operations
+If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations
on selectors that imply single target DOM element will throw when more than one element matches the selector.
+This option does not affect any Locator APIs (Locators are always strict).
See [Locator] to learn more about the strict mode.
## context-option-service-worker-policy
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 053181936d..a88b5152d4 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -11830,9 +11830,10 @@ export interface BrowserType<Unused = {}> {
slowMo?: number;
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
- * selectors that imply single target DOM element will throw when more than one element matches the selector. See
- * [Locator] to learn more about the strict mode.
+ * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. This
+ * option does not affect any Locator APIs (Locators are always strict). See [Locator] to learn more about the strict
+ * mode.
*/
strictSelectors?: boolean;
@@ -13202,9 +13203,10 @@ export interface AndroidDevice {
serviceWorkers?: "allow"|"block";
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
- * selectors that imply single target DOM element will throw when more than one element matches the selector. See
- * [Locator] to learn more about the strict mode.
+ * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. This
+ * option does not affect any Locator APIs (Locators are always strict). See [Locator] to learn more about the strict
+ * mode.
*/
strictSelectors?: boolean;
@@ -15103,9 +15105,10 @@ export interface Browser extends EventEmitter {
};
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
- * selectors that imply single target DOM element will throw when more than one element matches the selector. See
- * [Locator] to learn more about the strict mode.
+ * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. This
+ * option does not affect any Locator APIs (Locators are always strict). See [Locator] to learn more about the strict
+ * mode.
*/
strictSelectors?: boolean;
@@ -18063,9 +18066,10 @@ export interface BrowserContextOptions {
};
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
- * selectors that imply single target DOM element will throw when more than one element matches the selector. See
- * [Locator] to learn more about the strict mode.
+ * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. This
+ * option does not affect any Locator APIs (Locators are always strict). See [Locator] to learn more about the strict
+ * mode.
*/
strictSelectors?: boolean;