# How to close Browser tab in Katalon Recorder?

**URL:** <https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265>\
**Category:** Web Testing\
**Tags:** katalon-recorder\
**Created:** [May 31, 2018, 1:01am UTC](https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265 "2018-05-31T01:01:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.katalon.com/u/Andrew)\
**Post date:** [May 31, 2018, 1:01am UTC](https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265/1 "2018-05-31T01:01:26Z")

</div>

Hi

How to close Browser tab in Katalon Recorder?

Somehow i got stuck with this simple task.

Well - maybe not that simple. Say i have 2 tabs open and i need to close one of them - is there a way to do so correctly in Katalon Recorder?

Thank you  
Andrew

---

<div class="post-metadata">

**Author:** ![andrew1](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@andrew1](https://forum.katalon.com/u/andrew1)\
**Post date:** [May 31, 2018, 1:27pm UTC](https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265/2 "2018-05-31T13:27:12Z")

</div>

(I am new and I am probably wrong)

I think that you might be able to Use a keyboard command to get rid of a tab, like ctrl+w.

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.katalon.com/u/Andrew)\
**Post date:** [May 31, 2018, 2:06pm UTC](https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265/3 "2018-05-31T14:06:05Z")

</div>

> [andrew](https://forum.katalon.com/profile/6189/andrew) said:
> 
> (I am new and I am probably wrong)
> 
> I think that you might be able to Use a keyboard command to get rid of a tab, like ctrl+w.

Hey Andrew

Can you provide a sample or screen shot?

Thanks  
Andrew

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.katalon.com/u/Andrew)\
**Post date:** [June 22, 2018, 2:17am UTC](https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265/4 "2018-06-22T02:17:17Z")

</div>

I have switched to Katalon Studio and never found the way to achieve this in Katalon Recorder, however - this is how it can be done in Katalon Studio:

WebUI.closeWindowIndex(1)

WebUI.delay(1)

WebUI.switchToWindowIndex(0)

WebUI.delay(1)

---

<div class="post-metadata">

**Author:** ![Baran\_Hajiesmailoo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/baran_hajiesmailoo/32/5084_2.png) [@Baran\_Hajiesmailoo](https://forum.katalon.com/u/Baran_Hajiesmailoo)\
**Post date:** [December 13, 2018, 4:23pm UTC](https://forum.katalon.com/t/how-to-close-browser-tab-in-katalon-recorder/11265/5 "2018-12-13T16:23:12Z")

</div>

The active tab which the script runs in will be defined as win\_ser\_local.  
And anything else after that will be increased by 1. For example, go to [cnn.com](http://cnn.com). At that point [cnn.com](http://cnn.com) = win\_ser\_local  
When you click on a link and opens in new tab, that tab becomes win\_ser\_1  
This is what I found out thru fail and error.  
So command to close the tab should be

Command\_\_\_\_\_\_\_\_\_Target\_\_\_\_\_\_\_\_\_Value  
close\_\_\_\_\_\_\_\_\_\_\_\_\_win\_ser\_1  
selectsWindow\_\_\_\_\_win\_ser\_local

After closing the tab, you have to select the main window again, otherwise tool gets lost and wont know what to do, and fail the test.
