-
Notifications
You must be signed in to change notification settings - Fork 255
Closed
Labels
Description
System info
- Playwright Version: [1.35.0]
- Operating System: [ macOS Ventura13.4]
- Browser: [Chromium,]
- Other info:
Source code
public static void main(String[] args) {
try (Playwright playwright = Playwright.create()) {
BrowserType chromium = playwright.chromium();
BrowserType.LaunchOptions launchOptions = new BrowserType.LaunchOptions();
launchOptions.setHeadless(false);
Browser browser= chromium.launch(launchOptions);
launchOptions.setArgs(Collections.singletonList("--auth-server-whitelist='_'"));
BrowserContext browserContext=browser.newContext(new Browser.NewContextOptions().setHttpCredentials("username","password"));
Page page = browserContext.newPage();
page.navigate(url);
page.getByText("Sign in").click();
page.pause();
page.locator("locator").click(new Locator.ClickOptions().setDelay(500));
page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("example.png")));
}
}
Exception:
java.lang.NullPointerException
at com.microsoft.playwright.impl.PageImpl.lambda$pause$58(PageImpl.java:946)
at com.microsoft.playwright.impl.LoggingSupport.lambda$withLogging$0(LoggingSupport.java:36)
at com.microsoft.playwright.impl.LoggingSupport.withLogging(LoggingSupport.java:47)
at com.microsoft.playwright.impl.ChannelOwner.withLogging(ChannelOwner.java:87)
at com.microsoft.playwright.impl.LoggingSupport.withLogging(LoggingSupport.java:35)
at com.microsoft.playwright.impl.PageImpl.pause(PageImpl.java:938)