Package com.microsoft.playwright.impl
Class PlaywrightImpl
- java.lang.Object
-
- com.microsoft.playwright.impl.LoggingSupport
-
- com.microsoft.playwright.impl.ChannelOwner
-
- com.microsoft.playwright.impl.PlaywrightImpl
-
- All Implemented Interfaces:
Playwright,java.lang.AutoCloseable
public class PlaywrightImpl extends ChannelOwner implements Playwright
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.playwright.Playwright
Playwright.CreateOptions
-
-
Field Summary
Fields Modifier and Type Field Description private APIRequestImplapiRequestprivate BrowserTypeImplchromiumprivate java.lang.ProcessdriverProcessprivate BrowserTypeImplfirefoxprivate SelectorsImplselectorsprivate SharedSelectorssharedSelectorsprivate BrowserTypeImplwebkit-
Fields inherited from class com.microsoft.playwright.impl.ChannelOwner
connection, guid, initializer, type
-
-
Constructor Summary
Constructors Constructor Description PlaywrightImpl(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BrowserTypeImplchromium()This object can be used to launch or connect to Chromium, returning instances ofBrowser.voidclose()Terminates this instance of Playwright, will also close all created browsers if they are still running.static PlaywrightImplcreate(Playwright.CreateOptions options)Launches new Playwright driver process and connects to it.static PlaywrightImplcreateImpl(Playwright.CreateOptions options, boolean forceNewDriverInstanceForTests)BrowserTypeImplfirefox()This object can be used to launch or connect to Firefox, returning instances ofBrowser.(package private) voidinitSharedSelectors(PlaywrightImpl parent)APIRequestrequest()Exposes API that can be used for the Web API testing.Selectorsselectors()Selectors can be used to install custom selector engines.(package private) voidunregisterSelectors()BrowserTypeImplwebkit()This object can be used to launch or connect to WebKit, returning instances ofBrowser.-
Methods inherited from class com.microsoft.playwright.impl.ChannelOwner
adopt, disposeChannelOwner, handleEvent, runUntil, sendMessage, sendMessage, sendMessageAsync, toProtocolRef, withLogging, withWaitLogging
-
Methods inherited from class com.microsoft.playwright.impl.LoggingSupport
logApi, logApiIfEnabled, logWithTimestamp, withLogging
-
-
-
-
Field Detail
-
driverProcess
private java.lang.Process driverProcess
-
chromium
private final BrowserTypeImpl chromium
-
firefox
private final BrowserTypeImpl firefox
-
webkit
private final BrowserTypeImpl webkit
-
selectors
private final SelectorsImpl selectors
-
apiRequest
private final APIRequestImpl apiRequest
-
sharedSelectors
private SharedSelectors sharedSelectors
-
-
Constructor Detail
-
PlaywrightImpl
PlaywrightImpl(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
-
Method Detail
-
create
public static PlaywrightImpl create(Playwright.CreateOptions options)
Description copied from interface:PlaywrightLaunches new Playwright driver process and connects to it.Playwright.close()should be called when the instance is no longer needed.Playwright playwright = Playwright.create(); Browser browser = playwright.webkit().launch(); Page page = browser.newPage(); page.navigate("https://www.w3.org/"); playwright.close();
-
createImpl
public static PlaywrightImpl createImpl(Playwright.CreateOptions options, boolean forceNewDriverInstanceForTests)
-
initSharedSelectors
void initSharedSelectors(PlaywrightImpl parent)
-
unregisterSelectors
void unregisterSelectors()
-
chromium
public BrowserTypeImpl chromium()
Description copied from interface:PlaywrightThis object can be used to launch or connect to Chromium, returning instances ofBrowser.- Specified by:
chromiumin interfacePlaywright
-
firefox
public BrowserTypeImpl firefox()
Description copied from interface:PlaywrightThis object can be used to launch or connect to Firefox, returning instances ofBrowser.- Specified by:
firefoxin interfacePlaywright
-
request
public APIRequest request()
Description copied from interface:PlaywrightExposes API that can be used for the Web API testing.- Specified by:
requestin interfacePlaywright
-
webkit
public BrowserTypeImpl webkit()
Description copied from interface:PlaywrightThis object can be used to launch or connect to WebKit, returning instances ofBrowser.- Specified by:
webkitin interfacePlaywright
-
selectors
public Selectors selectors()
Description copied from interface:PlaywrightSelectors can be used to install custom selector engines. See extensibility for more information.- Specified by:
selectorsin interfacePlaywright
-
close
public void close()
Description copied from interface:PlaywrightTerminates this instance of Playwright, will also close all created browsers if they are still running.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacePlaywright
-
-