pub fn get_driver_executable() -> Result<(PathBuf, PathBuf)>Expand description
Get the path to the Playwright driver executable
This function attempts to locate the Playwright driver in the following order:
- Bundled driver downloaded by build.rs (PRIMARY - matches official bindings)
- PLAYWRIGHT_DRIVER_PATH environment variable (user override)
- PLAYWRIGHT_NODE_EXE and PLAYWRIGHT_CLI_JS environment variables (user override)
- Global npm installation (
npm root -g) (development fallback) - Local npm installation (
npm root) (development fallback)
Returns a tuple of (node_executable_path, cli_js_path).
§Errors
Returns Error::ServerNotFound if the driver cannot be located in any of the search paths.
§Example
ⓘ
use playwright_core::driver::get_driver_executable;
let (node_exe, cli_js) = get_driver_executable()?;
println!("Node: {}", node_exe.display());
println!("CLI: {}", cli_js.display());