If switch to window failed it took too much time to execute next step

I intentionally want to fail switch to window index for my testing purpose. I put optional in switch to window index. But while no window is there it should warning on switch to window and execute next step. It will execute but taking too much time(at least 5mins or taking 2-3 hours). I set up 2 second delay from project setting and default wait for element timeout to 30 seconds. If I execute “Run from here” it doesn’t take much time but while I execute from suite or test case I am facing this issue.

This sounds bad… but to help you should post a bug report in the proper format. Also, try including the relevant lines of code - that would help us a lot.

This is the line of code. If 1st step is failed then switch to window also failed. In report it is failing and marked it as warning but taking minimum 5-6mins to execute this step. I put optional so that it won’t stop and execute next step if switch to window failed.

Delay between action is set up to 2 seconds. Default page load timeout is set up to 30 seconds.
I am using Chrome browser for testing.


swtch to window index delay.PNG