You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3724,56 +3722,12 @@ const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.
3724
3722
3725
3723
This methods attaches Playwright to an existing browser instance.
3726
3724
3727
-
#### browserType.devices
3728
-
- returns: <[Object]>
3729
-
3730
-
Returns a list of devices to be used with [`browser.newContext([options])`](#browsernewcontextoptions) and [`browser.newPage([options])`](#browsernewpageoptions). Actual list of devices can be found in [src/deviceDescriptors.ts](https://github.com/Microsoft/playwright/blob/master/src/deviceDescriptors.ts).
-`progress` <[function]> If download is initiated, this function is called with two parameters: `downloadedBytes` and `totalBytes`.
3751
3727
- returns: <[Promise]> promise that resolves when browser is successfully downloaded.
3752
3728
3753
3729
Download browser binary if it is missing.
3754
3730
3755
-
#### browserType.errors
3756
-
- returns: <[Object]>
3757
-
-`TimeoutError` <[function]> A class of [TimeoutError].
3758
-
3759
-
Playwright methods might throw errors if they are unable to fulfill a request. For example, [page.waitForSelector(selector[, options])](#pagewaitforelementselector-options)
3760
-
might fail if the selector doesn't match any nodes during the given timeframe.
3761
-
3762
-
For certain types of errors Playwright uses specific error classes.
3763
-
These classes are available via [`browserType.errors`](#browsertypeerrors) or [`playwright.errors`](#playwrighterrors).
3764
-
3765
-
An example of handling a timeout error:
3766
-
```js
3767
-
const { webkit } =require('playwright'); // Or 'chromium' or 'firefox'.
3768
-
try {
3769
-
awaitpage.waitForSelector('.foo');
3770
-
} catch (e) {
3771
-
if (e instanceofwebkit.errors.TimeoutError) {
3772
-
// Do something if this is a timeout.
3773
-
}
3774
-
}
3775
-
```
3776
-
3777
3731
#### browserType.executablePath()
3778
3732
- returns: <[string]> A path where Playwright expects to find a bundled browser.
0 commit comments