package com.sdetforum.playwright.demos;

import com.microsoft.playwright.Browser;
import com.microsoft.playwright.BrowserType;
import com.microsoft.playwright.BrowserType.LaunchOptions;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;

public class LaunchChrome {

	public static void main(String[] args) throws InterruptedException {
		
		// Launch Browser Instance
		Playwright playwrite = Playwright.create();
		BrowserType chrome = playwrite.chromium();
		// Set headless mode to false for GUI execution
		LaunchOptions options = new LaunchOptions();
		options.setHeadless(false);
		Browser browser = chrome.launch(options);
		// Launch AUT in Chrome Browser
		Page page = browser.newPage();
		page.navigate("https://google.com");
		Thread.sleep(5000);
		// Close the Browser
		browser.close();

	}

}