I need to complete a POC where the PWA version of my web app(browser) can be launched with selenium webdriver as we are migrating from Browser bases UI automation to PWA base UI automation and don't want to start anything from scratch.
When I goto properties of my web app desktop shortcut after installation, it gives following details- "C:\Program Files\Google\Chrome\Application\chrome_proxy.exe" --profile-directory="Profile 1" --app-id=ecgplgabkmfgkfapibnjcpfll
Which suggests me to use ChromeOptions to help selenium to launch the chrome app(pwa)
Here is what I have tried so far- but this simply launches the chrome not my pwa web app-
code ChromeOptions opt = new ChromeOptions();
//opt.addArguments("\"C:\\Program Files\\Google\\Chrome\\Application\\chrome_proxy.exe\" --profile-directory=\"Profile 1\" --app-id=ecgplgabkmfgkfapibnjcpfll");
opt.addArguments("\"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" profile-directory=\"Profile 1\"");
opt.addArguments("app-id=ecgplgabkmfgkfapibnjcpfll");
//opt.addArguments("C:\\Users\\Global\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1\\Web Applications\\_crx_ecgplgabkmfgkfapibnjcpfll");
System.setProperty("webdriver.chrome.driver","C:\\Users\\Global\\Downloads\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver(opt);
//Runtime.getRuntime().exec("\"C:\\Program Files\\Google\\Chrome\\Application\\chrome_proxy.exe\" --profile-directory=\"Profile 1\" --app-id=ecgplgabkmfgkfapibnjcpfll");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.id("username")).sendKeys("indraku");
