Forum Discussion
SiKing
12 years agoCommunity Hero
OK, we are now sliding towards theory ...
1. To check for only presence of the element, you can use the following XPath assertion
Or you could check that it contains something
and your expected result should be simply
2. Next is your question regarding
I am assuming your service is a SOAP service, and further there is a WSDL. The service (not the business logic of your app) was probably generated by some 3rd party framework. Further, the WSDL hopefully defines this field as DateTime. You can check this right in the WSDL from SoapUI. If that is the case, then it is up to the framework, and not your application, to ensure that the result is correctly formatted. In other words, testing the formatting of this field should be out of scope for your test effort, because this is generated by 3rd party software. You can check with your developer(s) to confirm all of this.
On the other hand, it is entirely possible that the WSDL defines this field as a string, in which case you need to have a chat with your developer(s), or possibly your development lead, and they need to explain to you why it is not a DateTime field.
HTH, good luck.
1. To check for only presence of the element, you can use the following XPath assertion
exists(//*:KuendigungsDatum)
Or you could check that it contains something
not(empty(//*:KuendigungsDatum/text()))
and your expected result should be simply
true
2. Next is your question regarding
stenofski wrote: I want to know that the tag and some specific formatted timestamp is present and I don’t care about the values of the timestemp.
I am assuming your service is a SOAP service, and further there is a WSDL. The service (not the business logic of your app) was probably generated by some 3rd party framework. Further, the WSDL hopefully defines this field as DateTime. You can check this right in the WSDL from SoapUI. If that is the case, then it is up to the framework, and not your application, to ensure that the result is correctly formatted. In other words, testing the formatting of this field should be out of scope for your test effort, because this is generated by 3rd party software. You can check with your developer(s) to confirm all of this.
On the other hand, it is entirely possible that the WSDL defines this field as a string, in which case you need to have a chat with your developer(s), or possibly your development lead, and they need to explain to you why it is not a DateTime field.
HTH, good luck.