I have a text file contains 45 lines. I need to read the text file line by line based on the counter increment function.
Example: If we read the first line of a line then it prints count value is 1 and so on...
please provide me some good examples.
I have a text file contains 45 lines. I need to read the text file line by line based on the counter increment function.
Example: If we read the first line of a line then it prints count value is 1 and so on...
please provide me some good examples.
On
new File('/path/to/your/file').readLines().get(0) - returns the first line of the filenew File('/path/to/your/file').readLines().get(1) - returns the second line of the fileIf you need to access the JMeter variable defined by the Counter configuration element - use vars shorthand for JMeterVariables class instance like:
new File('/path/to/your/file').readLines().get(vars.get('your_counter_variable') as int))
More information:
Try this: