我出错了
“ java.lang.AssertionError:失败的功能:feature.demo-01:demo-01.feature:16-javascript评估失败:input('#login_field','dummy'),ReferenceError:在第1行未定义“ input”“
运行以下功能时
功能:浏览器自动化1
Background:
* configure driver = { type: 'chrome', showDriverLog: true }
# * configure driverTarget = { docker: 'justinribeiro/chrome-headless', showDriverLog: true }
# * configure driverTarget = { docker: 'ptrthomas/karate-chrome', showDriverLog: true }
* configure driver = { type: 'chromedriver', showDriverLog: true }
# * configure driver = { type: 'geckodriver', showDriverLog: true }
# * configure driver = { type: 'safaridriver', showDriverLog: true }
# * configure driver = { type: 'iedriver', showDriverLog: true, httpConfig: { readTimeout: 120000 } }
Scenario: try to login to github and then do a google search
Given driver 'https://github.com/login'
And input('#login_field','dummy')
And input('//input[@id='password']', 'world')
您必须使用的是空手道的旧版本。使用0.9.5。
也许首先尝试ZIP版本并熟悉:https://github.com/intuit/karate/wiki/ZIP-Release