2
我已經創建了Web服務項目。以下是我的測試用例的腳本,用於驗證如圖所示documentation元素文本:Katalon Studio:如何爲啓用了MTOM的SOAP Web服務創建VerifyElementText測試用例?
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
def response = WS.sendRequest(findTestObject('ProductById'))
WS.verifyElementText(response, "Product.Reference", "MyReference")
當我運行這個測試情況下,我得到的錯誤:[FAILED] - Unable to verify element text (Root cause: org.xml.sax.SAXParseException: Content is not allowed in prolog.)
然後我用:com.kms.katalon.core.util.KeywordUtil#logInfo
看response.responseText
,我已收到,這是:
--uuid:4e39ea48-6560-46b7-a30c-201dfaf98f51
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getProductResponse xmlns:ns2="http://mycompany.com/"><Product><Reference>VW3A8306R</Reference></Product></ns2:getProductResponse></soap:Body></soap:Envelope>
--uuid:4e39ea48-6560-46b7-a30c-201dfaf98f51--
Web服務我測試MTOM
啓用。這就是爲什麼響應文本是這種格式。
如何在這種情況下創建測試用例?