Hi, everyone!
I have test-case of REST web-service where i try to count the number of templates(using WS.verifyElementsCount).
REST reponse is in XML:
<ArrayOfTemplate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<template>
<start_date>2119-01-04T00:00:00
</start_date>
<end_date xsi:nil="true" />
<generate_blank_url>http://0001archtest01:1778/DocFlowApi/Document/GenerateBlank/PaymentContract_Test?templateDate=04.01.2119
</generate_blank_url>
</template>
<template>
<start_date>2018-11-06T00:00:00
</start_date>
<end_date>2119-01-04T00:00:00
</end_date>
<generate_blank_url>http://0001archtest01:1778/DocFlowApi/Document/GenerateBlank/PaymentContract_Test?templateDate=06.11.2018
</generate_blank_url>
</template>
</ArrayOfTemplate>
Code of test-case:
'Отправка валидного запроса'
a = WS.sendRequest(findTestObject('DocFlow_WebServices/GetTemplates', [('Category_Code') : 'PaymentContract_Test', ('boolean') : true]))
'Проверка количества шаблонов(2)'
WS.verifyElementsCount(a, 'template', 2)
Failures text:
Test Cases/Test_WebServices/Test_GetTemplates FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Unable to verify element count (Root cause: Expected elements count 2 is not equal with actual count 1)
What is wrong?