Forum Discussion

Aplis's avatar
New Contributor
6 years ago

Modifying JDBC response to compare with JSON input



I have a JDBC step, where it returns empty tags if no data is present on the table. Then am comparing this repsosne to excel (datasource) using assertions where my REST input value is NULL.


How do i compare an empty tag to a  NULL input ? Also the fields are dynamic where they may have data or jus returns empty tags.


Can anyone help me with this.?Thanks in advance for your time.. 


 Grrovy that i came up with . Not sure if am on right path or not .. 


def ActualSourceCode = context.expand( '${CTL_RAD#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SOURCE_CODE[1]}' ) "JDBCSourceCode= $ActualSourceCode"

def ExpectedSourceCode = context.expand( '${DataSource#SourceCode1}' ) "EXCELSourceCode= $ExpectedSourceCode"

if(ActualSourceCode == 'NOVALUE')

ExpectedSourceCode = 'NOVALUE'
assert ExpectedSourceCode == ActualSourceCode "SourceCodeNotEntered = $ActualSourceCode"
assert ExpectedSourceCode == ActualSourceCode "SourceCodeEntered = $ActualSourceCode"

3 Replies