debugging - Selector 的调试值
问题描述
也许是一个简单的问题,但我自己完全无法解决。
如何调试/输出选择器的值?
await t
.expect(Selector('.progress-bar.progress-bar-success').getStyleProperty('width')).eql('100%', {timeout: 90000})
我试着用
console.log(Selector('.progress-bar.progress-bar-success').getStyleProperty('width'));
最后还有 .value 。但我没有得到任何信息。有小费吗?
解决方案
选择器返回一个 Promise。您需要等到承诺得到解决。为此,只需await
在 Selector 调用之前添加关键字。
console.log(await Selector('.progress-bar.progress-bar-success').getStyleProperty('width'));
推荐阅读
- angular - 通过 REST API 使用 Angular 7 在 keycloak 上创建用户
- c++ - 如何在 C++17 中创建一个大小在编译时已知的修复类型的元组?
- python - Python在到达结束时停止流
- xml - XPath 基于兄弟值获取值 - 带有命名空间
- r - 按字符分隔字段中的变量
- python - 数据清理(标记)失效传感器
- java - 我们可以在休眠中为多个数据库使用一个实体管理器吗?如果可以,我该如何使用 Spring MVC 来做到这一点
- robotframework - 每次执行循环时如何更改选择器?
- python - 如何让 Python 脚本写入现有工作表
- python - 从 arxiv 号获取 bibtex 条目的 shell 命令