Random selection from CSV file in Jmeter

前端 未结 6 1759
借酒劲吻你
借酒劲吻你 2021-02-07 06:38

I have a very large CSV file (8000+ items) of URLs that I\'m reading with a CSV Data Set Config element. It is populating the path of an HTTP Request sampler and iterating throu

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 07:02

    As other answers have stated, the reason you're not able to select a line at random is because you would have to read the whole file into memory which is inefficient.

    Rather than trying to get JMeter to handle this on the fly, why not just randomise the file order itself before you start the test?

    A scripting language such as perl makes short work of this:

     cat unrandom.csv | perl -MList::Util=shuffle -e 'print shuffle' > random.csv
    

提交回复
热议问题