Forum Discussion

Lillian's avatar
Lillian
New Contributor
16 years ago

Problems using dataSink

I want to save a respons of one of my testcases so that I can use the respons for another testcase. To do so I have created a dataSink (excel-file) as teststep right after the teststep where the response is given. But I think I haven't got the dataSink right because when I try to run the dataSink the following message is given: "An error occured [Unable to recognize OLE stream], see error log for details"
That do I do wrong? Are there any other way to save resonse from a testCase to use in another?
Can someone give me some exsample?
  • Lillian's avatar
    Lillian
    New Contributor
    Hello.
    I don't find much help in the userGuide about data sink, but I have comed one step further by using txt-file datasink. My only problem now is when I use a datasource to pich ut the property from the datasink in another testcase. The data sink includes the property deliveryAddressId and by running the values is e.g 100. But in my dataSink.txt fil the value is "100", so when I use the dataSource to reveive the value from the dataSink in the other testcase, the "'s comes along, and give me an error because the property has to many characters. So my question is: how can I get rid of the "'s ?

    One more thing; I say I should post this on pro forum. How? I can only find this forum.

    Regards Lillian
  • Hi Lillian,


    I know that we assisted you by email so I'm posting this for other pro user to see.

    If you're using DataSink you must be using soapUI pro. If you have a pro license then you should have an account for accessing pro forums. If you have any problems accessing them, then you should contact support@eviware.com with your account information.

    As for your problem with loading data from a file that was filled with data by DataSink) it happens because your property values are put into an external file by DataSink step as string objects and are formatted with double-quotes. Those values are, some test steps later, loaded (by DataSource) as strings that also contain double-quotes. You can add a Groovy script after your DataSource test step and unpack the double-quoted string value into a property with double-quotes truncated:

    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

    def valueFromFile
    try {
    valueFromFile = groovyUtils.expand('${#myParam}')
    } catch (e) {
    log.error "An error occurred: $e"
    valueFromFile = null
    }
    int intValue
    try {
    def len = valueFromFile.length()
    intValue = new Integer( valueFromFile[1.. len-1] )
    } catch (e) {
    log.error "An error occurred: $e"
    intValue = 0
    }
    log.info "Loaded int value: $intValue"



    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla