Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
2 years ago

closing chrome using sys.waitbrowser, close and/or terminate

Is there something wrong with the following code? if (Sys.WaitBrowser("chrome").Exists) { Log.Message("chrome"); do { Log.Message("inside loop"); objBrowser = Sys.Browser("chrome"); objBrows...
  • rraghvani's avatar
    2 years ago

    Here's a simple version, where browser is either "chrome" or "edge"

    // Close browser
    while (Sys.WaitBrowser(browser).Exists) {
       Sys.WaitBrowser(browser).Close();
    }