【发布时间】:2016-11-07 13:46:27
【问题描述】:
您好,我目前正在使用 cucumber 进行测试,但我有点难过,即使在拖网后我仍然找不到正确的解决方案,错误消息对我的帮助也不大。
When company send us these XML messages
|fixtures/entitlements/sport_tennis.xml|
|fixtures/entitlements/sport_golf.xml|
@When("^company send us these XML messages$")
public void company_send_us_these_XML_messages(DataTable messages) throws Throwable {
client.publish(messages);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
我目前在主题标题中收到错误消息。
Error java: incompatible types: cucumber.api.DataTable cannot be converted to java.lang.String
我该如何处理这个数据表。该消息并没有真正帮助我将其转换为字符串,然后它告诉我需要映射它或将其放入数据表中。是否有任何解决方法/解决方案。这个让我难过。
【问题讨论】:
-
尝试使用QMetry automation framework。它支持来自 excel、xml、csv、json 或数据库的数据。请参阅this feature file。第 38 行:示例:{'datafile':'resources/testdata.txt'}