Aneesha
8 years agoNew Contributor
How to assert response in Raw Tab
I have been trying to create an assertion for raw response.I need to check whether "openCashDrawer" is present or not in the below raw response.
Link: <.>;rel=nextAction;action=openCashDrawer;callOrder=1,<http://10.23.210.96:8090/omnistore-services/rest/receipt/v1/transaction>;rel=nextAction;action=printTxnReceipt;callOrder=2
Below is the piece of code which i tried:
def expectedCon = '<.>;rel=nextAction;action=openCashDrawer;callOrder=1,<http://10.23.210.96:8090/omnistore-services/rest/receipt/v1/transaction>;rel=nextAction;action=printTxnReceipt;callOrder=2'
def headers = messageExchange.response.responseHeaders
def actualCon = headers['#Link#']
assert expectedCon.size() == actualCon[0].startsWith(expectedCon),"action=openCashDrawer"