mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs(selectors): clarify selector conversions
This commit is contained in:
parent
c044227e12
commit
13c2f6571b
@ -23,9 +23,9 @@ document
|
|||||||
```
|
```
|
||||||
|
|
||||||
For convenience, selectors in the wrong format are heuristically converted to the right format:
|
For convenience, selectors in the wrong format are heuristically converted to the right format:
|
||||||
- selector starting with `//` is assumed to be `xpath=selector`;
|
- Selector starting with `//` is assumed to be `xpath=selector`. Example: `page.click('//html')` is converted to `page.click('xpath=//html')`.
|
||||||
- selector starting with `"` is assumed to be `text=selector`;
|
- Selector starting with `"` is assumed to be `text=selector`. Example: `page.click('"foo"')` is converted to `page.click('text="foo"')`.
|
||||||
- otherwise selector is assumed to be `css=selector`.
|
- Otherwise, selector is assumed to be `css=selector`. Example: `page.click('div')` is converted to `page.click('css=div')`.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user