Close all browser with url :

Hi @Elly_Tran,

Yes, do a loop over the list of browsers

Thank u

1 Like


Should you do a loop over the list of browsers and then check if it is or not? If yes, quit() that browser. If you want to close all browsers with no specific url, using closeApplication

The following closes all browser tabs that have “Google” in the URL and might get you started on your code. It basically loops until it tries to move to a window that does not exist which throws an exception. If you can find a statement that counts the number of tabs, then you can improve the routine immensely.

cnt = 0;
try {
    while (true) {
	    String site = WebUI.getUrl()
	    if (site.contains("Google") || site.contains("google")) {
	        "close Google windows"
	    } else {
} catch (Exception) {
1 Like