Key.ENTER 一个输入没有提交
Key.ENTER on an input does not submit
我正在尝试空手道并有一个用例,我需要在搜索框中触发搜索,但没有触发搜索的按钮,因此需要通过回车键触发。
我尝试了多种不同的方式来尝试向输入提供 Key.ENTER
以使其正常工作,但其中 none 会触发它。
我正在使用带有非常基本功能文件的 latest 二进制文件(更改为使用 google 而不是内部应用程序 URL):
Feature: Trigger search with enter
Background:
* configure driver = { type: 'chrome'}
Scenario: Trigger Google search with enter
Given driver 'https://google.com'
# 1: Attempting to search with enter as an array argument
When input('input[name=q]', ['karate dsl', Key.ENTER])
# 2: Attempting to search with enter as a second command
#When input('input[name=q]', 'karate dsl')
#When input('input[name=q]', Key.ENTER)
# 3: Attempting to search using similar approach to 1 but with a submit
#When submit().input('input[name=q]', ['karate dsl', Key.ENTER])
Then waitFor('{h3}intuit/karate: Test Automation Made Simple - GitHub')
使用这些方法中的任何一种(通过 运行 ./karate <PATH_TO_ABOVE_FEATURE_FILE>
)时,搜索结果页面永远不会加载,因此永远找不到结果(h3
)...这是什么我做错了吗?
这是类型 chrome
的错误。它实际上适用于 chromedriver
.
类型
打开了一个问题:https://github.com/intuit/karate/issues/1192
现在请通过单击适当的按钮/控件等来解决
我正在尝试空手道并有一个用例,我需要在搜索框中触发搜索,但没有触发搜索的按钮,因此需要通过回车键触发。
我尝试了多种不同的方式来尝试向输入提供 Key.ENTER
以使其正常工作,但其中 none 会触发它。
我正在使用带有非常基本功能文件的 latest 二进制文件(更改为使用 google 而不是内部应用程序 URL):
Feature: Trigger search with enter
Background:
* configure driver = { type: 'chrome'}
Scenario: Trigger Google search with enter
Given driver 'https://google.com'
# 1: Attempting to search with enter as an array argument
When input('input[name=q]', ['karate dsl', Key.ENTER])
# 2: Attempting to search with enter as a second command
#When input('input[name=q]', 'karate dsl')
#When input('input[name=q]', Key.ENTER)
# 3: Attempting to search using similar approach to 1 but with a submit
#When submit().input('input[name=q]', ['karate dsl', Key.ENTER])
Then waitFor('{h3}intuit/karate: Test Automation Made Simple - GitHub')
使用这些方法中的任何一种(通过 运行 ./karate <PATH_TO_ABOVE_FEATURE_FILE>
)时,搜索结果页面永远不会加载,因此永远找不到结果(h3
)...这是什么我做错了吗?
这是类型 chrome
的错误。它实际上适用于 chromedriver
.
打开了一个问题:https://github.com/intuit/karate/issues/1192
现在请通过单击适当的按钮/控件等来解决