Struct playwright::api::browser_type::BrowserType[][src]

pub struct BrowserType { /* fields omitted */ }

Implementations

impl BrowserType[src]

pub fn name(&self) -> Result<String, Error>[src]

Returns browser name. For example: 'chromium', 'webkit' or 'firefox'.

Errors

Returns error only if this function is called after object is disposed.

pub fn executable(&self) -> Result<PathBuf, Error>[src]

A path where Playwright expects to find a bundled browser executable.

Errors

Returns error only if this function is called after object is disposed.

pub fn launcher(&self) -> Launcher<'_, '_, '_>[src]

launch Browser Returns the browser instance.

You can use ignoreDefaultArgs to filter out --mute-audio from default arguments:

const browser = await chromium.launch({  // Or 'firefox' or 'webkit'.
 ignoreDefaultArgs: ['--mute-audio']
});

Chromium-only Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, 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.

Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs for video playback. See this article for other differences between Chromium and Chrome. This article describes some differences for Linux users.

pub fn persistent_context_launcher<'a>(
    &self,
    user_data_dir: &'a Path
) -> PersistentContextLauncher<'a, '_, '_, '_, '_, '_, '_, '_, '_, '_, '_>
[src]

launch_persistent_context BrowserContext 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. user_data_dir: Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for Chromium and Firefox. Note that Chromium’s user data directory is the parent directory of the “Profile Path” seen at chrome://version.

Trait Implementations

impl Clone for BrowserType[src]

impl Debug for BrowserType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.