Note - to close all chrome browser instances one hot key solution is to use ctrl+shift+q. Process chromeInstances = Process.GetProcessesByName('chrome') This will restore your tabs from the last browsing session. The next time you open Chrome, press the following sequence on your keyboard: Ctrl + Shift + T.
No selectors and containers dependency will be there.Īnd if you are using process kill approach then there you have to terminate it forcefully by passing /F arguement if you will not pass then it will kill only one chrome process so in one shot if you want to kill all chrome browser instances you have to kill the chrome process forcefully. It is very easy to close the Chrome browser accidentally with one wrong mouse click or with the Ctrl + Q keyboard shortcut. So IMHO process kill will work best in this scenario. Although if their will be only one tab then it will close that tab and browser as well but again the same problem to deal with two with selectors and containers. The other thing ctrl+W will close only the current tab not a chrome browser having multiple tabs. Suppose if you are dealing with 2 chrome browser then you have to send hotkey alt+f4 to both windows then selectors and attache browsers you have to deal with carefully. So if you will use hot key approach then their will be things like Hey is good way only to kill the chrome browser process as you also have mentioned all chrome browser not tabs. I found “Kill Process” activity but I don’t like to use it. I am finding solution to close all chrome browsers before stopping robot.