ui-automation - 空手道 UI 自动化 - 断言失败,消息“实际值不像 JSON”,用于 driver.title 比较
问题描述
我正在尝试将空手道用于 UI 自动化,但我遇到了一个基本场景,我试图验证页面标题
以下是我的场景步骤:
Scenario: Validate page title
Given driver 'https://google.com'
And driver.maximize()
Then match driver.title == 'Google'
当我运行它时,我收到以下错误:
assertion failed: path: $.title, actual: 'Google', expected: ''Google'', reason: actual value is not JSON-like abc.feature:16 - path: $.title, actual: 'Google', expected: ''Google'', reason: actual value is not JSON-like
如果我使用:
Then match driver.title == Google
我得到以下错误:
javascript evaluation failed: driver.title, null
额外细节:
karate-junit4 = 9.4.0
* configure driver = { type: 'chrome', showDriverLog: false }
正如评论中所建议的,也使用了 0.9.5.RC3。收到此错误:
assertion failed: path: $, actual: '', expected: 'Google', reason: not equal
谁能指出我在这里遗漏了什么?
解决方案
最后更新:这个问题是 0.9.4 的一个错误。请从以下链接查看详细说明:问题链接:https ://github.com/intuit/karate/issues/913
推荐阅读
- jenkins - 即使通过 pip install mkdocs 安装后,mkdocs 也无法在 Jenkins 中工作
- sql-server - Sql server 查找字符串的出现次数
- node.js - DiscordJS 嵌入未正确添加字段
- python - 正则表达式忽略字符串中的数字(python)
- rebol - 如何通过红色/rebol中的“foreach”修改块的每个元素
- mongodb - 使用 mongosqld 时索引 Mongo 数据库
- c - 学习 C - 如何使用 gmtime_s
- javascript - 如何重置 jQuery 排序?
- java - 如何加载应用程序上下文以使用 JUnit 4 测试 Spring 应用程序?
- sql - 如何在 Pyspark 中以编程方式使用“计数”?