JMeter: Read CSV file contents into JUnit testcase program using CSV Data Set Config

前端 未结 3 1599
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-26 19:42

I want to use data from CSV file mentioned in CSV Data Set Config of JMeter into my JUnit testcase program and pass that data to test method.

I know how to get data from

3条回答
  •  不知归路
    2021-01-26 20:09

    Finally I found solution using:

    JUnitSampler junitSampler=new JUnitSampler(); String UserId=junitSampler.getThreadContext().getVariables().get("userId");

    Now my JUnit testcase program is accepting UserId from CSV file mentioned in CSV Data Set Config.

    Thanks PMD UBIK-INGENIERIE and Dmitri T for your help.

提交回复
热议问题