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

how to close the existing chrome session?. i mean what activities i can use.

Will you explain more what you wanna achieve and for what objective to understand your objective and problem

Thanks

Hi @vijai1,

Activity :
1.kill Process
2.close application

Regards,
Arivu

@vijai1 some times kill process may damage your chrome extension.
Please make a dry run before considering for Kill process.

hi Akash,

The process would be like.
If the browser is opened. I want to close the browser.
If the browser is not opened. i want to open the browser with the URL i have mentioned

Hi @vijai1,

For this scenario use kill process activity first then open the browser using open browser activity.

Regards,
Arivu

waht if the browser is not opened . will continue and open the process?

Hey @vijai1

checkout this thread:

well IMHO better to check first if there already any chrome instance is running or not in the background. if running the kill them all.
if not running then based on this go with your normal open browser things. :slight_smile: because your objective is to close chrome if open anyhow :slight_smile:
Regards…!!
AKsh

Hi ,

@vijai1 yes, if browser is not opened also it will kill the process alone and continue the process.

Regards,
Arivu

Thanks Arivu

image

In the above image , the process design is kill process and open browser:

In the properties i have mentioned the below line
system.Diagnostics.Process.GetProcessesByName(chrome)

but , i am getting an error:

image

Hi @vijai1,

In kill process you need to mention the process name…

If u r using Chrome browser use “Chrome”
If u r using IE browser use “iexplore”

In open browser activity give in double quotes like “www.amazon.com

Regards,
Arivu

1 Like

Hi, Beware of using Kill Process if you are using a machine that is used by multiple Robots, and in that case you would need to kill it per user… solutions found here: Print all processes - #14 by ClaytonM

Otherwise, the normal Kill Process should work ok as mentioned above.

If you want to soft kill it, which works just as well, let me recommend that you use a Do While with Element Exists, so you pick up each window.
For example see pseudocode:

Do
     Element Exists with selector of window
     If element exists then close window with same selector
While element exists

Regards.

2 Likes

Hi Arivu,

It is not working for me

Hi Clayton,

Let me try and update you. sorry for delay in response for you and arivu.

Hi @vijai1,

please refer below xaml file to kill the process and open new browser.
Main.xaml (7.5 KB)
i was checked its working fine.

Regards,
Arivu

Hi Arivu,

Thanks a lot for helping me out. It is working well. :slight_smile:

Could you please explain what it mean:
Process - A Process type object describing the process to be closed.

image

What can i give in the process field?

Regards,
Vijay M

Hi @vijai1,

refer the xaml file what i have sent.

No need to give Process field…Process name is more enough.

Regards,
Arivu

hi Arivu,
Yeah, it is working fine. Just want to understand what it is ?

Regards,
Vijay M

@vijai1 ok fine.instead of process name we can give the Process object.

Regards,
Arivu