Unable to switchToWindowIndex on Apple devices from Browserstack

Hi,

I have a problem with switching tabs on iPhone devices from browserstack tool. I have to complete a form and then to press a button that must redirect to another page. I have tried with following piece of code to get on that page, but currently on iPhone devices is not working.

int windowIndex = WebUI.getWindowIndex()

WebUI.switchToWindowIndex(windowIndex + 1)
The test will fail with following error message:
Cannot find window with index: ‘1’
Unable to switch to window with index: ‘1’.

For Android and Desktop browsers is working.

Has anyone had this problem and found a solution?

Thanks in advance.