How can I store a variable in a data source using groovy

RaxyokRaxyok Posts: 1

I'm trying to store a Header in a Data Sorce using groovy but I'm not able to do it.
I'm using:

import parasoft.com.*;

String grabHeaderValue (input, context)
{
String headers = input.toString();
int dateIndex = headers.indexOf("Date:");
int endIndex = headers.indexOf('\n', dateIndex);
String desiredHeader = headers.substring(dateIndex, endIndex);
context.setValue("Date",desiredHeader);
return desiredHeader;

}

Tagged:

Answers

Sign In or Register to comment.