How to close all chrome browsers before stopping robot

studio

#1

Hi everyone,

I am finding solution to close all chrome browsers before stopping robot.
I found “Kill Process” activity but I don’t like to use it.
I wonder is there other way to achieve that.

Many thanks,
Hoang Anh.


#2

Hi,

Wonder why you don’t like it?:thinking:

Other option would be:

  • shortcut key Alt+F4,Ctrl+w or
  • use attach/browser window variable in Close tab/Close window/Close application activities

#3

I too, never used it :open_mouth:
May be because it sounds like “force close”?
Is it the proper way to close applications (including browsers)?


#4

Hey @anhth15
There is good way only to kill the chrome browser process as you also have mentioned all chrome browser not tabs.
So if you will use hot key approach then their will be things like

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.

the other thing ctrl+W will close only the current tab not a chrome browser having multiple tabs. 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.

so IMHO process kill will work best in this scenario. No selectors and containers dependency will be there.

and 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. :slight_smile:

Process [] chromeInstances = Process.GetProcessesByName("chrome");

foreach(Process p in chromeInstances)
p.Kill(); 

Note - to close all chrome browser instances one hot key solution is to use ctrl+shift+q.

Regards…!!
Aksh


How to close the existing chrome session?. i mean what activities i can use
#5

If we kill chrome process from back end… google chrome may loose their plugins/add-in settings when we re open it.
this will not happen all machines but i found in some machines.


#6

This is really hard to get it. if you will kill a process then plugins will remove. it is the problem of extension coding or manifest.json of that extension at the time of development of that extension. i have developed in my early days.

Regards…!!
Aksh


#7

if we don’t want to loose those plugins can we hardcore extension/plug-in details in Json file.
Could you please share those entries…


#8

From my perspective it is not at all related with manifest json. it something else… you can check manually by killing process.

Just with a simple search found below links, Hope you will get something from these links,let me know as well

https://superuser.com/questions/519300/extensions-disappear-when-i-close-and-open-google-chrome
https://productforums.google.com/forum/#!msg/chrome/BRIjeE9dgRk/rlWWv_LZwRIJ
https://productforums.google.com/forum/#!topic/chrome/7oImEYDuQyE