[英]How to pass arguments to karate feature file from selenium java test file
I want to pass an argument to karate graphql test from selenium java test. 我想将参数传递给硒java测试的空手道graphql测试。 I tried to do that this way, but it didn't work.
我尝试过这种方式,但是没有用。
HashMap<String, Object> args = new HashMap<String, Object>();
args.put("argument1", "value1");
Map<String, Object> result = CucumberRunner.runFeature(featureFile,
args, true);
I tried to put that value in karate file in ways like 我试图以类似的方式将该值放入空手道文件中
<argument1>
or 要么
#(argument1)
but literally this text was passed to query in karate test. 但是从字面上看,这段文字是通过空手道测试传递给查询的。 Have someone done that by karate?
有人用空手道做到了吗?
Here you have fragment of my feature file: 这是我功能文件的片段:
Given text query =
"""
{
element(name:"<argument1>") {
name
}
}
"""
And request {query: '#(query)'}
When method post
Then status 200
* print response
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.