Ask a Question

[Registred] Can't run DataSink via Groovy Script

Cizo89
Frequent Contributor

[Registred] Can't run DataSink via Groovy Script

Hi,

it looks like there is a problem with the DataSink TestStep - it's impossible to run via Groovy script.
I've tried 2 different methods, but the result was still the same.

testRunner.runTestStepByName("DataSink")


def dataSink = testRunner.testCase.testSteps["DataSink"]
dataSink.run(testRunner, context)


It's also strange that if I close and open SoapUI (or Project) and run those methods (or just one of them), the DataSink step will go red, but it won't do anything.
The DataSink step is working correctly only if I run it manually.

Could you, please, have a look at this?

Thanks in advance

Regards,
Marek
5 REPLIES 5
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi,

I've tried with Groovy script using both code snippets you posted and I'm not encountering any problems. The datasink is running as expected. What kind of DataSink configuration are you using? File, Excel, etc.?



Regards,
Marcus
SmartBear Support

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Cizo89
Frequent Contributor

Hi Marcus,

I'm using Excel DataSink, with specified "File", "Out file" and "Worksheet" fields and a Property Expansion in the Start at Cell field.
I attached a project with this Excel file and steps as a zip file.

While I was preparing this sample for you, I've noticed that DataSink in this sample is working = I was able to run it via Groovy, but the original DataSink in my tests still can't be called (in this DataSink I can't see any data in the DataLog)...I'm not sure what's going on, because I just cloned that to a new project.

Also, new values are stored to the Excel file only if I run the DataSink manually, but if I run it via Groovy I can see some data in the Data Log, but the actual data weren't written to the Excel file.

Regards,
Marek
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi,

I am able to reproduce the issue, and have opened defect SOAP-1061.

Sorry for any inconvenience this may have caused.



Regards,
Marcus
SmartBear Support

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Cizo89
Frequent Contributor

No problem at all...thanks for reporting that, Marcus.

Regards,
Marek

Hi,

 

Is this issue got fixed? I am still facing this problem. I tried both ways but no luck.. Could you pls help me.

 

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def testCase = context.testCase;
def testStep = testCase.getTestStepByName("Values")
testRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testCase, null);
testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep);
testStep.run(testRunner, testStepContext)

 

 

testRunner.runTestStepByName("Values");

cancel
Showing results for 
Search instead for 
Did you mean: