0

My application has several popup windows opening from javascript validations. Sahi is not recognizing those. If I manually add it like

_popup("windowTitle"),

It says no such window found. The windows are not javascript popups but normal html pages opening as popups.

the exact error message is:

_popup("Error Window")._click(_button("CERRAR")); Window/Domain not found: popupNameFromStep=Error Window; derivedName=; windowName=; windowTitle=Happy Time; wasOpened=0

Here the title it is recognizing is actually the parent window title.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
Tanna
  • 35
  • 1
  • 1
  • 11

2 Answers2

0

What does the controller records it as? If it is a popup or a different window, the controller will record it correctly.

Vivek V Dwivedi
  • 2,510
  • 2
  • 28
  • 39
  • 1
    this is a comment, not an answer – DanielX2010 Aug 24 '13 at 19:21
  • 1
    Do you find a question in above post? Don't go in implementation details, I am not paid each time I post an answer and not comment. If he/she can provide what I asked for, I have a solution. And as I typed this, I saw what you meant :D ..will keep in mind :) – Vivek V Dwivedi Aug 25 '13 at 04:27
  • @Vivek:Thats the problem. The controller doesnot even recognize it. It is a new window only.. I mean control and hower doesnt work for that window – Tanna Aug 27 '13 at 04:38
  • Ok. Two different things can be tried depending on what version you are on. If using Sahi pro, you should get the identifier as the implementation of controller is changed a lot. If on open source ('which I assume you are on'), try opening a new controller on the window that comes up by pressing ALT and double clicking. This window will show you the proper accessor. In case you cant get it then also, point me to some example that is live and I can test, so that I can give you some code to work with. – Vivek V Dwivedi Aug 27 '13 at 05:12
  • Hi, I am using open source. Alt+double click on child window doesnot open a new controller window. Dont know why but it only seems to open in the parent window... And this is companys internal site.. So you wont be able to access it. – Tanna Sep 02 '13 at 05:07
0

You can use the API _selectWindow which will use to select popup.

// switch to popWin popup window
_selectWindow("popWin");
// perform actions on popWin
_assertEqual("Link Test", _getText(_link(0))); // no mention of popWin needed
var $href;
_set($href, _link(0).href); // no mention of popWin needed
...
// switch back to base window
_selectWindow();
// perform actions on base window

For more details you can visit this link: https://sahipro.com/docs/sahi-apis/popup-windows.html#_selectWindow

Jay Khatri
  • 19
  • 5
  • 1
    Welcome to SO :) While this link may answer the question, it is better to include the essential parts of the answer here and only provide the link as a reference. Indeed link-only answers could become invalid if the linked page is changed or deleted. – Ivan Gabriele Jul 10 '16 at 06:55