空手道用户界面:driver.location方法引起错误:路径:$,实际:null [英] Karate UI: driver.location method induces Error: path: $, actual: null

查看:86
本文介绍了空手道用户界面:driver.location方法引起错误:路径:$,实际:null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用driver.location方法,但结果出现错误:path:$,actual:null

I am trying to use method driver.location, but as a result I got the error : path: $, actual: null

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

My code: Feature: browser automation Background: * configure driver = { type: 'chromedriver', showDriverLog: true }

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

Scenario: try to login to github and then do a google search

给出驱动程序' https://github.com/login ' 然后匹配driver.location ==' https://github.com/login '

Given driver 'https://github.com/login' Then match driver.location == 'https://github.com/login'

EROR:路径:$,实际:null,

EROR: path: $, actual: null,

如何处理这种行为?

推荐答案

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

First make sure you are on the latest RC version 0.9.5.RC4, and we did rename location to url: https://github.com/intuit/karate/tree/develop/karate-core#driverurl

或使用更好的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浏览器测试),可以在此处更轻松地使用:

Note that there is a ZIP release (including a demo web-browser-test) which can be simpler to use here: https://github.com/intuit/karate/wiki/ZIP-Release

这篇关于空手道用户界面:driver.location方法引起错误:路径:$,实际:null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆