Forum Discussion

_ivanovich_'s avatar
_ivanovich_
Frequent Contributor
6 years ago
Solved

In JDBC Step Assertion script throws error encoding UTF-8

Hi,
i have a jdbc step where i get some date frm a table.
i use the Add assertion with script functionnality to compare variables.
So this is code generated:

import com.eviware.soapui.support.XmlHolder
def holder = new XmlHolder( messageExchange.responseContentAsXml )
def addressId = holder.getDomNode( "//Results[1]/ResultSet[1]/Row[1]/v.addressId[1]" )
def project = messageExchange.modelItem.project;
def addressIdFromResponse = project.getPropertyValue("addressId")
assert addressIdFromResponse == addressId

The content xml is like:
Results
ResultSet
@fetchSize
Row
@rowNumber
v.adressId PARIS-CORP

When i run the assertion code it throws:

assert addressIdFromResponse == addressId
| | |
| | PARIS-CORP
| false
<?xml version="1.0" encoding="UTF-8"?>
<v.adressId>PARIS-CORP</v.adressId>



If i log.info addressId

it gives a code like:

  • Fri Mar 01 10:50:40 EST 2020: INFO: org.apache.xmlbeans.impl.store.Xobj$ElementXobj@34b9e639
  • instead of PARIS-CORP