Hi,
While working with test fragments, i came across one situation where I'm stuck. Please help me out with the below problem. Problem statement : How to refer same test fragment under a thread group multiple times with different test data. Scenario: Login to Amazon and place order for two different items and logout. 3 Test fragments created: 1. Login to Amazon 2. Place order 3. Logout I'm using csv file to pass data for all test fragments. Now, created a thread group, using include controller i have referred the test fragments in the below order : 1. login, 2. place order, 3. place oder (referred twice for 2nd item order) 4. Logout Here I'm not able to perform second item order as the logic in 'place order' is reading first item order only. How i can pass different data to place when it is called second time in same thread group? Please advise me on this. Thanks and Regards Gangadhara K |
Hi,
Not sure if I understand whole scenario but I usually use Module Controller to include test fragment and JSR223 Sampler before each Module Controller to prepare data for that Test Fragment. Regards, Mariusz On Tue, 4 Aug 2020 at 22:00, gangadhara kopparapu <[hidden email]> wrote: > Hi, > > While working with test fragments, i came across one situation where I'm > stuck. Please help me out with the below problem. > > Problem statement : > How to refer same test fragment under a thread group multiple times with > different test data. > > Scenario: Login to Amazon and place order for two different items and > logout. > > 3 Test fragments created: > 1. Login to Amazon > 2. Place order > 3. Logout > > I'm using csv file to pass data for all test fragments. > > Now, created a thread group, using include controller i have referred the > test fragments in the below order : > > 1. login, > 2. place order, > 3. place oder (referred twice for 2nd item order) > 4. Logout > > Here I'm not able to perform second item order as the logic in 'place > order' is reading first item order only. > > How i can pass different data to place when it is called second time in > same thread group? > > Please advise me on this. > > Thanks and Regards > Gangadhara K > |
In reply to this post by gangadhara kopparapu
Hi.
You are probably stumbling over the fact, that the csv reader (like many other elements) are listening for iteration events, that trigger some action. In the case of the csv reader, such an event will trigger reading the next line of a csv file. The elements that trigger those events are generally (in the tree) above those elements that listen for them. In your case, the csv reader will be triggered by an iteration of the thread group, only. If you want to do the place order twice, place the element inside a loop. Regards Felix Am 04.08.20 um 21:59 schrieb gangadhara kopparapu: > Hi, > > While working with test fragments, i came across one situation where I'm > stuck. Please help me out with the below problem. > > Problem statement : > How to refer same test fragment under a thread group multiple times with > different test data. > > Scenario: Login to Amazon and place order for two different items and > logout. > > 3 Test fragments created: > 1. Login to Amazon > 2. Place order > 3. Logout > > I'm using csv file to pass data for all test fragments. > > Now, created a thread group, using include controller i have referred the > test fragments in the below order : > > 1. login, > 2. place order, > 3. place oder (referred twice for 2nd item order) > 4. Logout > > Here I'm not able to perform second item order as the logic in 'place > order' is reading first item order only. > > How i can pass different data to place when it is called second time in > same thread group? > > Please advise me on this. > > Thanks and Regards > Gangadhara K > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
Free forum by Nabble | Edit this page |