Karate UI: driver.location method induces Error: path: $, actual: null

Deadly 提交于 2020-01-24 15:10:28

问题


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

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

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

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

EROR: path: $, actual: null,

How to deal with this behavior?


回答1:


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

Or use waitForUrl() which is better: https://github.com/intuit/karate/tree/develop/karate-core#waitforurl

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

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



来源:https://stackoverflow.com/questions/59209869/karate-ui-driver-location-method-induces-error-path-actual-null

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!