sahi - 如何在 sahi 中关闭弹出窗口?
问题描述
' 如何在 sahi 中关闭弹出窗口?
if(_windowExists("Technischer Fehler"))
{
_click(_link("SCHLIESSEN"));
}
else
{
我得到错误 WindowExists is not defined 而我已经在程序开始时将它定义为 var windowExists = "Technischer Fehler";
任何人都可以请指导'
解决方案
看看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"))) { ...
推荐阅读
- android - 在特定时间运行方法而不重复
- c++ - 开发 toLower/toUppercase 函数
- node.js - PostgreSQL,如果行不存在,则 Sequelize 返回 null
- javascript - 在 electron.js 或 node.js 应用程序中捕获 c++ 本机插件 cout/console 消息
- c# - IEnumerable、lambda协方差和扩展方法
- python - LSTM hidden_state PyTorch 几乎相同,导致负 KLDivLoss
- vue.js - 如何在 v-slide-item 中单击时添加自定义功能?
- python - 将列表作为列添加到数据框
- oracle - SQL*PLUS - 假脱机时创建一个新文件夹
- ios - 自定义 UITableViewCell 类不起作用(Swift)