Switching between Tabs in Chrome issue


There is a button on our website that opens a PDF in a new window. In my test case, I have set it up so that the URL for the original window is captured and saved as a variable then the PDF button is clicked/opened. My next step is “Switch to Window URL” with the saved URL variable as the input. However, what actually happens is a rapid switch back and forth between the tab I need to continue the test on and the PDF tab.

The script is below:


‘Click Materials’

WebUI.click(findTestObject(‘Clinian Queue/Materials Button’))

‘Focus on the Materials Modal’

WebUI.focus(findTestObject(‘Clinian Queue/Materials Modal’), FailureHandling.STOP_ON_FAILURE)

‘Click Treatment Plan PDF’

WebUI.click(findTestObject(‘Clinian Queue/Treatment Plan PDF’))

‘Delay for PDF loading’


‘Switch to original tab’


Let me know what should be changed to make this work.

Thank you,


I am having the exact same issue.

Switch the tab using index, which starts from “0”. Use the following line in order to access second tab:


Follow below link for more details.
https://docs.katalon.com/display/KD/[WebUI]+Switch+To+Window+Index `

1 Like

Hi Lauren -

If you are still having this issue, you could try the Switch to Window Index Method

Also, try adding some wait statements.


I have the same exact issue, window just switches back and forth rapidly.
Tried WebUI.switchToWindowIndex(1) and also SwitchToWindowTitle…nothing works.

Anyone resolved this issue?

Try like this:
#Switch to original


#And then switch to the second one.


With this, I can download from google drive where the download file is higher and google drive cannot scan and I was redirected to another page.