Page or BrowserContext across concurrent threads.
Each parallel thread must have its own BrowserContext and Page.public class ThreadLocalDriver {
private static ThreadLocal<Page> pageThread = new ThreadLocal<>();public static Page getPage() {
return pageThread.get();
}
public static void setPage(Page page) {
pageThread.set(page);
}
public static void removePage() {
pageThread.remove();
}
}