It seems you are well on the way to completing this but missing the final step, which should not be dissimilar to the regular approach to data driven testing. However instead of loading expected values I would load a set a of mappings/bindings. I would define a properties file that maps one set of names to the other, so taking your table, its contents would something like: PrimarySourceName = SecondarySourceName. Then Get the values from each source and use the mapping to get the values for comparison.
Mapping.properties file
Placed in the same directory as your project.
basicObj.personId=basicObject.personIdentification
basicObj.personType=basicObject.AdminPersonType
basicObj.addressObj=basicObject.addressObject
basicObj.addressLine=basicObject.address
basicObj.city==basicObject.cityAddress
basicObj.pinCode==basicObject.pin
Load the Properties
import com.eviware.soapui.support.GroovyUtils
// location of mapping properties is relative to SOAPUI project file.
def groovyUtils = new GroovyUtils( context )
String mappingFile = groovyUtils.projectPath + "/mapping.properties"
// load the properties
Properties properties = new Properties()
File propertiesFile = new File(mappingFile)
propertiesFile.withInputStream {
properties.load(it)
}
Assuming REST requests are made in previous steps, the responses are retrived
def sourceOneResponse = new XmlSlurper().parseText(requestOne.response)
def sourceTwoResponse = new XmlSlurper().parseText(requestTwo.response)
Then loop through the entries and compare values of each
for (property in properties) {
sourceOneName = property.name
sourceOneValue = sourceOneResponse.getNodeValue(sourceOneName)
sourceTwoName = property.value
sourceTwoValue = sourceTwoResponse.getNodeValue(sourceTwoName)
assert sourceOneValue == sourceTwoValue : "${sourceOneName} : ${sourceOneValue} is not equal to ${sourceTwoName} : ${sourceTwoValue}"
}