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]
&self,
user_data_dir: &'a Path
) -> PersistentContextLauncher<'a, '_, '_, '_, '_, '_, '_, '_, '_, '_, '_>
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]
fn clone(&self) -> BrowserType
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BrowserType
[src]
Auto Trait Implementations
impl RefUnwindSafe for BrowserType
impl Send for BrowserType
impl Sync for BrowserType
impl Unpin for BrowserType
impl UnwindSafe for BrowserType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,