Access data source table in Groovy script
I am trying to access a table defined as a data source in a Groovy script as part of a web scenario test. This script just needs to get a substring of one of the columns in the table.
The error I am getting says 'com.parasoft.data.DataSourceException: No Data Source column named BookingNbr'. My data source is defined as type Table and has these columns: BookingNbr DefendantName DefendantLastName DefendantFirstName DefendantMiddleName .
The script is very basic and is this:
public String getBookingNbrSubstring(ScriptingContext context)
String bookingNbr = context.getValue("DataHold", "BookingNbr").get(1);
Application.showMessage("BookingNbr: " + bookingNbr);
String partialBookingId = bookingNbr.substring(4)
Application.showMessage("partialBookingId: " + partialBookingId);
Any suggestions as to why I am getting this error? Can the script not find the table data source? This seems like such a basic thing to do.