How should i close an opened browser window using java code. I have found a way to first find the process then end that process. Is there any better way? I have opened the browser initially using the below code. I am working in CentOS.
String url = "http://192.168.40.174/test15.html";
Runtime runtime = Runtime.getRuntime();
runtime.exec("/usr/bin/firefox -new-window " + url);