How to close a popup window in sahi?

128 views Asked by At

' How to close a popup window in sahi ?

 if(_windowExists("Technischer Fehler"))
 {
 _click(_link("SCHLIESSEN"));
 }
else

{

} I get the error WindowExists is not defined whereas I have already defined it at the start of the program as var windowExists = "Technischer Fehler";

Can anyone please guide'

1

There are 1 answers

0
globalworming On

have a look at https://sahipro.com/docs/sahi-apis/popup-windows.html#_windowExists

var $exists = _windowExists("/demo/");

haven't used Sahi in a while, but if i remember correctly, you can't just use the Sahi API in if statements. Yeah https://sahipro.com/docs/sahi-apis/fetch-apis.html#Generic%20attribute%20fetching%20mechanism you have to use _condition.

if (_condition(_windowExists("Technischer Fehler"))) { ...