module Playwright::BrowserType
Overview
BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a typical example of using Playwright to drive automation:
Defined in:
playwright/browsertype.crInstance Method Summary
-
#executable_path : String
A path where Playwright expects to find a bundled browser executable.
-
#launch(options : LaunchOptions | Nil) : Browser
Returns the browser instance.
- #launch : Browser
-
#launch_persistent_context(user_data_dir : Path, options : LaunchPersistentContextOptions | Nil) : BrowserContext
Returns the persistent browser context instance.
- #launch_persistent_context(user_data_dir : Path) : BrowserContext
-
#name : String
Returns browser name.
Instance Method Detail
A path where Playwright expects to find a bundled browser executable.
Returns the browser instance.
You can use ignoreDefaultArgs
to filter out --mute-audio
from default arguments:
Chromium-only Playwright can also be used to control the Chrome browser, but it works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use executablePath
option with extreme caution.
If Google Chrome (rather than Chromium) is preferred, a Chrome Canary or Dev Channel build is suggested.
In browserType.launch([options])
above, any mention of Chromium also applies to Chrome.
See this article
for a description of the differences between Chromium and Chrome. This article
describes some differences for Linux users.
Returns the persistent browser context instance.
Launches browser that uses persistent storage located at userDataDir
and returns the only context. Closing this context will automatically close the browser.