首页 > 解决方案 > 如何在 sahi 中关闭弹出窗口?

问题描述

' 如何在 sahi 中关闭弹出窗口?

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

{

我得到错误 WindowExists is not defined 而我已经在程序开始时将它定义为 var windowExists = "Technischer Fehler";

任何人都可以请指导'

标签: sahi

解决方案


看看https://sahipro.com/docs/sahi-apis/popup-windows.html#_windowExists

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

有一段时间没有使用 Sahi,但如果我没记错的话,你不能只在 if 语句中使用 Sahi API。是的https://sahipro.com/docs/sahi-apis/fetch-apis.html#Generic%20attribute%20fetching%20mechanism你必须使用_condition

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

推荐阅读