Answered

switch_window is not working on a new chrome tab.

Hi,

Please refer the following screenshot:

 

Here in step number 9 We are clicking on an element which opens a new browser in a separate chrome tab. So we have 2 tabs available now after this step. Then I am using switch_window with tab index 1 to switch to the new browser. Then I wanted to verify an element in the new browser tab. 

But while running step 10 is getting pass and in a flash the new browser tab is opening but immediately it is coming back to the main browser. And the verification step mentioned in step 12 is failing. 

Could anyone help me in this regard?

Thanks,

Niranjan.

0
3 comments
Avatar
Joseph Hamdan

Hi Niranjan,

Please activate the option "Whole Test Case" in the Switch_Window step. This will make sure you are running additional steps on the new window before it can be closed and return to the main window. If it stays in Default, the test case will think that you would like to execute the remaining steps on the main window instead of the newly opened one.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Niranjan Das

Hi Joseph,

Thank you very much for your explanation. It works now.

One more follow up question here: I want to close the child window that is the new browser tab in my scenario. So Could you tell me how this can be done in Subject7.

Thanks,

Niranjan.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Niranjan,

You are most welcome. To close the window, you can use Close_Popup command, the options of the command can allow you to enter a popup text, i.e a unique text that appears on the window you would like to close, or you can enable "Close all except main" checkbox to close all windows except the main window.

Regards,
Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.