Click on button opens new window ,how do I select second opened window in sahi?

56 views Asked by At

When I click on button on base window it opens a new window ,I want to perform action on second window .How do I select the second window in sahi? Tried with _selectWindow(1); but doesnt work..

1

There are 1 answers

0
Ajinkya Ghodake On

If you want to move the control to the new window that is opened, then you need to pass the new window's identifier to _selectWindow().

You can also pass url of the page it gets redirected to. Use regex for passing url.

Example: If the new window that gets opened is Google search window then ,

var $WindowIdentifier="/.* google.*/"; _selectWindow($WindowIdentifier);