Contributions
Re: iterate datasource, multiple rows single request
And i thought it was going so well... So far i have the form being sent twice in one test request, and i can see the data in the "Raw" fine. But I seem to be having two issues. It does not seem to like it if i set rowsToRead = 2. But goes through fine if it is set to 1. If i have something like this, with the row set to 1: <people> ${Groovy Script#result} ${Groovy Script#result} </people> It fills out the data exactly the same in both forms, and goes through fine. If i try it again and set rows to 2, to use two rows of data (one for each) i enter a world of errors. Have i missed something here?8.2KViews0likes0CommentsRe: iterate datasource, multiple rows single request
Hi M, Thanks for the input and explanations, i have certainly learnt a lot going through this challenge. Think the groovy script method will be the way to go, so will start playing with things that way - i see a steep learning curve ahead. Thanks again for all your help. Hopefully i can help some others around the forum as well.8.2KViews0likes0CommentsRe: iterate datasource, multiple rows single request
Thanks for the test script. Yours seems to work in the same way that mine does. There is however one, certainly important difference. In your raw request you I can see you are referencing the two seperate persons (1 & 2) directly. This is not what i am doing, which makes me think that i have explained my issue poorly. I will try another way, just to see if we are talking about the same thing. Below is a straight forward form, this i can parameterise with my datasource and iterate through it. <person> <name> <firstname>John</firstname> <lastname>Doe</lastname> </name> <level> <class>1 A</class> </level> </person> <person> <name> <firstname>${DataSource#firstname}</firstname> <lastname>${DataSource#lastname}</lastname> </name> <level> <class>${DataSource#class}</class> </level> </person> However, what i am thinking is that i have a form that looks like this: <person> <name> <firstname>${DataSource#firstname}</firstname> <lastname>${DataSource#lastname}</lastname> </name> <name> <firstname>${DataSource#firstname}</firstname> <lastname>${DataSource#lastname}</lastname> </name> <level> <class>${DataSource#class}</class> </level> </person> Now if i use the datasource it will pick the same name for the firstname in section 1 and 2. I am trying it to iterate the datasource, so if i wanted to i could just add 10 name sections to the XML and it would use the first 10 rows of the datasource. Instead of filling out each form with the data from the same row. From what i can see using the Template, Script, Template method i would have to reference each of the individual templates for each item. it would look like this: <person> <name> <firstname>${DataGen#name1}</firstname> <lastname>${DataGen#name1}</lastname> </name> <name> <firstname>${DataGen#name2}</firstname> <lastname>${DataGen#name2}</lastname> </name> <level> <class>${DataSource#class}</class> </level> </person> Is that correct? So if i built a form with 100 name sections, i would have to create 100 datagen references to match? Is there any easier way to do this, to get the datasource to add row 1 into the first set, row 2 into the second set etc. So i can just copy paste as many XML sections i like and the code will do the rest? Does that make any sense at all. Am i correct in my conclusion of how the DataGen (template, script, template) is working?8.2KViews0likes0CommentsRe: iterate datasource, multiple rows single request
Hi M, Thanks for the response, i have been playing with what you said for quite a while. I seem to be having a challenge or two with it, I have been testing by having two expansions in the test request. I can see that when i execute the DataGen on its own, that the output in the column "last" shows the values to be taken correctly. Unfortunately the response does not contain the values just sent, so i am using a datasink on the request to output what i am sending in the e.g. the first name. The DataSink output shows that i am sending the same value in both of the first names. I have set the property transfer to take the two different first names from their respective sections. It just doesnt seem to want to play nice with me. Another interesting developement is that it is not starting at column A2 as specified in the datasource but A3. The output in the datasink also shows that it is skipping two rows, so it would appear it is taking every third row of data. very puzzling. In my datasink i am also outputting the row the data was taken from, and it states 3 6 9 12 15 I would have thought it would state 2,4,6,8 etc. (I am only using the 1 thread at this point) Anything that i have missed here? DataGen is after the Datasource and before the Test Request. (Datasource, DataGen, Test Request, Property Transfer, DataSink, DataLoop)8.2KViews0likes0Commentsiterate datasource, multiple rows single request
I searched and searched the board but cannot seem to come to a solution to my issue. Groovy is something i am not yet familiar with but expect i will need in the future. The challenge i have: I have multiple instances of the same form in the request, but need each instance of the form to use a different row. For example I have first name: last name: Class: first name: last name: Class: in the same request. If i use the datasource and point to the corresponding data i.e. ${DataSource#firstname}, {DataSource#lastname}, {DataSource#class}, then when i send the request it will use the same first name on each of the values and only iterate it when the request is sent on the second loop. What i would like, is to use row 1 for the first form and row 2 for the second, then on the loop use row 3 and 4. There will be up to 100 of these in a single request, so creating seperate datasources does not make sense. So the first iteration sends the 1st 100 rows and the second then starts on row 101 and sends the next set etc. Hopefully that makes sense, as i am at my whits end trying to get this to work and ran out of avenues to persue. Expat.12KViews0likes13Comments