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

activities

#1

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


#2

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

Thanks


#3

Hi @vijai1,

Activity :
1.kill Process
2.close application

Regards,
Arivu


#4

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


#5

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


#6

Hi @vijai1,

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

Regards,
Arivu


#7

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


#8

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


#9

Hi ,

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

Regards,
Arivu


#10

Thanks Arivu


#11

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


#12

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


#13

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

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.


#14

Hi Arivu,

It is not working for me


#15

Hi Clayton,

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


#16

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


#17

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


#18

Hi @vijai1,

refer the xaml file what i have sent.

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

Regards,
Arivu


#19

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

Regards,
Vijay M


#20

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

Regards,
Arivu