how to get datasource property value and assign it to a variable from Virt editor
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2015
09:14 AM
07-21-2015
09:14 AM
how to get datasource property value and assign it to a variable from Virt editor
Hi Team,
Currently we have created a datasource property for a Virt (ApplicationId)
We are looking to save the property value in a variable.
But facing issues while accessing the property value using get PropertyValue
context.getMockResponse().getPropertyValue(ApplicationId)
Kindly help
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2016
05:25 PM
12-06-2016
05:25 PM
Hello,
Did you solve your problem? I'm trying to get values from excel datasource but I'm unable to get it using my script dispatcher. I don't know how to get them, it sounds like is similar to your question.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2016
02:42 AM
12-07-2016
02:42 AM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2016
02:50 AM
12-07-2016
02:50 AM
Hi
not sure how you're trying to get the data from the data source but here's how I've done it
// define datasource to use def virtDS = mockRequest.getContext().getMockService().dataSources.getVirtDataSource("DataSourceName") // reset DataSource to top record and get 1st row of data virtDS.prepare(requestContext.getMockRunner(), requestContext) def strmapDS = virtDS.next(requestContext.getMockRunner(), requestContext) // get data - These will reference the column names in your DS def dsHeader = strmapDS.get("Header", "value") def dsValue = strmapDS.get("Value", "value") //................... //get next row values by using strmapDS = virtDS.next(requestContext.getMockRunner(), requestContext)
