我正在尝试使用QAF 3.0进行Test服务测试,这是我测试的BDD。
Scenario: [WS-2]_[222-xml]_Sample XML Webservices
When I request api "get.mock.xml.menu"
Then I check api response status code is "200"
And I check api response status is "OK"
And I check api response should have xpath '/breakfast_menu'前三行执行时没有任何问题。在内部,我打电话给QAF WsStep。
注意: Json路径验证工作非常完美,没有任何问题。
StepDef:
@QAFTestStep(description = "I check api response should have xpath {xpath}")
public static void iCheckApiResponseShouldHaveXpath(String xpath) {
WsStep.responseShouldHaveXpath(xpath);
}发布于 2021-01-11 22:03:12
在您的示例中,breakfast_menu是根节点,因此它将被视为上下文(根),并且可以作为.访问。您应该能够使用以下xpath:
.
./food
//food
./food/name
./food[name='Belgian Waffles']
//food[name='Belgian Waffles']
//*[name='Belgian Waffles']https://stackoverflow.com/questions/65646567
复制相似问题