Class Driver
- java.lang.Object
-
- com.microsoft.playwright.impl.driver.Driver
-
- Direct Known Subclasses:
Driver.PreinstalledDriver,DriverJar
public abstract class Driver extends java.lang.ObjectThis class provides access to playwright-cli. It can be either preinstalled in the host system and its path is passed as a system property or it can be loaded from the driver-bundle module if that module is in the classpath.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDriver.PreinstalledDriver
-
Constructor Summary
Constructors Constructor Description Driver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DrivercreateAndInstall(java.util.Map<java.lang.String,java.lang.String> env, java.lang.Boolean installBrowsers)java.lang.ProcessBuildercreateProcessBuilder()protected abstract java.nio.file.PathdriverDir()java.nio.file.PathdriverPath()static DriverensureDriverInstalled(java.util.Map<java.lang.String,java.lang.String> env, java.lang.Boolean installBrowsers)private static java.lang.StringgetMajorJavaVersion()protected abstract voidinitialize(java.lang.Boolean installBrowsers)private voidinitialize(java.util.Map<java.lang.String,java.lang.String> env, java.lang.Boolean installBrowsers)protected static voidlogMessage(java.lang.String message)private static DrivernewInstance()
-
-
-
Field Detail
-
env
protected final java.util.Map<java.lang.String,java.lang.String> env
-
instance
private static Driver instance
-
-
Method Detail
-
ensureDriverInstalled
public static Driver ensureDriverInstalled(java.util.Map<java.lang.String,java.lang.String> env, java.lang.Boolean installBrowsers)
-
initialize
private void initialize(java.util.Map<java.lang.String,java.lang.String> env, java.lang.Boolean installBrowsers) throws java.lang.Exception- Throws:
java.lang.Exception
-
initialize
protected abstract void initialize(java.lang.Boolean installBrowsers) throws java.lang.Exception- Throws:
java.lang.Exception
-
driverPath
public java.nio.file.Path driverPath()
-
createProcessBuilder
public java.lang.ProcessBuilder createProcessBuilder()
-
getMajorJavaVersion
private static java.lang.String getMajorJavaVersion()
-
createAndInstall
public static Driver createAndInstall(java.util.Map<java.lang.String,java.lang.String> env, java.lang.Boolean installBrowsers)
-
newInstance
private static Driver newInstance() throws java.lang.Exception
- Throws:
java.lang.Exception
-
driverDir
protected abstract java.nio.file.Path driverDir()
-
logMessage
protected static void logMessage(java.lang.String message)
-
-