How to close Browser tab in Katalon Recorder?

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

(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.

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

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)

1 Like

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. At that point 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.

2 Likes