Close Google Chrome tab "without" using Open Browser Activity

Requirement - Close Google Chrome tab “without” using Open Browser Activity !!
Activity Preferred/Used - Close Tab
Alternatives - Send Hotkey, Closing via command command and using Click activity to close browser. Send Hotkey not working and avoiding others because of run time challenges
Any suggestions welcomed !!
Thanks in advance !!

Hi @prerna.gupta ,

As you have mentioned, you’re using the Close Tab Activity, Is It giving out an Error?

Or Does it not work ?

Hi!

can we use close application or close window activity to achieve your requirement!

close application: https://docs.uipath.com/activities/docs/close-application

close window: https://docs.uipath.com/activities/docs/close-window

Regards,
NaNi

I want to use Close Tab activity without using Open Browser.
Close Tab activity takes input as browser variable which is not working (without using Open Browser)

Close Application cannot be used because this is child of parent application and i only want to close tab of “Child”
Close Window again expects a variable of window type which is a problem

HI!

Could you please show us the error?

Regards,
NaNi

@prerna.gupta You can also use an Attach Browser Activity, and Indicate on the Tab, that needs to be Closed. Inside the Attach Browser, you can use the Close Tab Activity.

Let us know if this also is not according to your expected solution.

Attach browser again expects a browser which is changing.
Consider - There is a Parent application, (after performing some steps in parent application) , i am logging in many child applications.
In exception scenario i only need to close child application

Business Application cannot show error.
You can consider that i need to close a chrome tab .
How can close any chrome tab

Hi! I am not sure to close the tab. But can you please try manually (ctrl+Shift+F4). I think this will close the tab. Before using it in studio. Just try it manually. I’m not using system now.
If it is works fine manually.
Then try like this…

Take 3 send hotkey activites don’t indicate the elements just pass the cntl,shift and F4.

This will works for you…

Regards,
NaNi

This is not working (neither manually nor via UiPath)

Though (Ctrl+w) works manually but when i pass that through Send hotkey its not working

1 Like

Hey!

Can we try like this!

In Open browser activity we have an option called UiBrowser(In Properties)->Create one variable which is the type of browser.

For your reference:

In Close tab activity we have an option called browser (in Properties)->Call that same variable here

For your reference:

Regards,
NaNi

Tried this is not working.

So i created a variable of browser type and passed the same variable in Close tab but its not working.

Also as mentioned above Parent Browser and child browser are different.
So cannot pass parent browser element in child browser

can we try with CTRL+F4 By using send hotkey?

This will works for me. can try as well?

Regards,
NaNi

Ctrl+F4 closes all tabs in Chrome due to which i cannot use,
As my requirement is to close a single(child) tab in Chrome

Hi!

ALT+F4 will close the entire application. but when it comes to CTRL+F4 will close the particular tab.

Regards,
NaNi

Manually it works but not working when i use Send hotkey (alt+f4).
Its same as (Ctrl+w)

That should work. but i don’t know why it is not working in your case!

could you please attach a screenshot while run the process in debug mode!

Regards,
NaNi

Due to business limitations i cannot attach screen shots of actual scenarios

Send Hotkey/Keyboard Shortcuts → CTRL+W (chrome keyboard shortcut for close tab) → Use title of page as part of selector to identify correct tab

1 Like