Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.
How can I store a variable in a data source using groovy
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:
0