Skip to Content

Welcome to the 

Sahi Pro Customer Portal

Access your tickets, forums, courses and more, all in one single place

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
48 Views

Hi all,

In my application, some links/buttons open new pages in a new browser tab after clicking them.

However, Sahi Pro continues to focus on the original tab and is unable to identify or interact with elements in the newly opened tab.

How can I make Sahi Pro switch to the newly opened tab and continue searching/interacting with web elements on that tab?

Any guidance would be appreciated.

Thanks!

Avatar
Discard
Hi Grace,

Please make use of the _selectWindow($prefix) in order to target the new window. When you use the controller on the new window, it will show a prefix. Use the prefix in the _selectWindow($prefix) to perform the step on the new window.

If you want to switch back to the base window, use _selectWindow() without any argument.

Please refer to the link below for more information on handling multiple windows.
https://resources.sahipro.com/docs/sahi-apis/popup-windows.html

Here is a video tutorial for the same.
https://www.youtube.com/watch?v=0dF4c8ZYzUE

Regards,
Sairam
Avatar
Discard