After click on button - page open at new tab - how to close the tab and go back to original tab?

i created one test case to click button - back (if page redirected within same browser) or close tab and go back to original tab (if page is open in bew tab).
how to close the tab and go back to original tab?
could not find it under Manual pull down list which action value should be used.
please advise.

Have you tried

WebUI.closeWindowIndex(1)

WebUI.switchToWindowIndex(0)