我有一个验证 100 个员工姓名的场景,QueryString 将以 xml 格式返回它们。我要做的就是验证 Assertion 语句中的所有员工姓名,如下所示。除了在场景大纲示例中添加每个名称之外,是否可以发送一个包含 100 个员工姓名的列表作为输入,以便我可以在 java 中遍历它们并在断言条件下轻松验证。请指教。
Scenario Outline: When the User queries for employee information, the correct records are returned
Given the webservice is running
When the User queries for employee information "<QueryString>"
Then the User receives correct data "<Name>"
Examples:
|QueryString|Name|
|Some localhost url|Peter|
|Some localhost url|Sam|
.
.
@Then("^the User receives correct data\"([^\"]*)\"$")
public void the_user_receives_correct_data(String arg1) throws Throwable {
queryResultPage = selenium.getPageSource();
assertTrue(queryResultPage.contains(arg1));
}