空手道 UI:driver.location 方法引发错误:路径:$,实际:null

2024-01-09

我正在尝试使用方法 driver.location,但结果出现错误:路径:$,实际:null

我的代码: 功能:浏览器自动化 背景: * 配置驱动程序 = { type: 'chromedriver', showDriverLog: true }

场景:尝试登录github 然后进行谷歌搜索

给定司机'https://github.com/login https://github.com/login' 然后匹配 driver.location == 'https://github.com/login https://github.com/login'

错误:路径:$,实际:null,

如何处理这种行为?


首先确保您使用的是最新的 RC 版本 0.9.5.RC4,我们确实重命名了location to url: https://github.com/intuit/karate/tree/develop/karate-core#driverurl https://github.com/intuit/karate/tree/develop/karate-core#driverurl

Or use waitForUrl()哪个更好:https://github.com/intuit/karate/tree/develop/karate-core#waitforurl https://github.com/intuit/karate/tree/develop/karate-core#waitforurl

Given driver 'https://github.com/login'
Then waitForUrl('https://github.com/login')

请注意,这里有一个 ZIP 版本(包括演示 Web 浏览器测试),使用起来更简单:https://github.com/intuit/karate/wiki/ZIP-Release https://github.com/intuit/karate/wiki/ZIP-Release

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

空手道 UI:driver.location 方法引发错误:路径:$,实际:null 的相关文章

随机推荐