Given you have your captured in form of JMeter Variables like

somevar_1=t-e-s-t-q-a
somevar_2=t-e-s-t-q-b
somevar_3=t-e-s-t-q-c
somevar_matchNr=3

you can them into a using any of JSR223 Test Elements, the relevant Groovy code would be something like:

def matches = vars.get('somevar_matchNr') as int
def file = new File('test.')
1.upto(matches) { idx ->
    file << vars.get('somevar_' + idx)
    if (idx < matches) {
        file << System.getProperty('line.separator')
    }
}

The above code will create test.csv file in ’s “bin” folder, the file will look like:

t-e-s-t-q-a
t-e-s-t-q-b
t-e-s-t-q-c



Source link https://sqa.stackexchange.com/questions/34446/in-the-below--write-all-the--dynamic-values-into-csv--please

LEAVE A REPLY

Please enter your comment!
Please enter your name here