【问题标题】:Unable to read csv file from the build folder , that get created while I run my post requests无法从构建文件夹中读取 csv 文件,该文件是在我运行发布请求时创建的
【发布时间】:2021-01-07 06:16:26
【问题描述】:

我正在尝试从 csv 文件中读取数据以获取补丁和删除请求。我不是自己添加 csv 文件,它是在构建文件夹中完成我的发布请求后生成的,路径为 resources/test/data/"****".csv 。 早些时候,当我按如下方式使用依赖项时,它工作正常:-

testCompile group: 'io.gatling.highcharts', name: 'gatling-charts-highcharts', version: '2.2.5'
testCompile 'org.scala-lang:scala-library:2.11.12'
compile "org.scalaj:scalaj-http_2.11:2.3.0"
compile group: 'com.github.tototoshi', name: 'scala-csv_2.11', version: '1.2.2'

但是现在当我如下更新我的应用程序时:-

testCompile group: 'io.gatling.highcharts', name: 'gatling-charts-highcharts', version: '3.3.1'
testCompile 'org.scala-lang:scala-library:2.12.10'
compile "org.scalaj:scalaj-http_2.11:2.4.2"
compile group: 'com.github.tototoshi', name: 'scala-csv_2.12', version: '1.3.6'

它给了我错误

Caused by: java.lang.IllegalArgumentException: Could not locate feeder file: Resource ******.csv not found
at io.gatling.core.feeder.FeederSupport.separatedValues(FeederSupport.scala:45)
at io.gatling.core.feeder.FeederSupport.separatedValues$(FeederSupport.scala:40)
at io.gatling.core.Predef$.separatedValues(Predef.scala:24)
at io.gatling.core.feeder.FeederSupport.csv(FeederSupport.scala:34)
at io.gatling.core.feeder.FeederSupport.csv$(FeederSupport.scala:33)
at io.gatling.core.Predef$.csv(Predef.scala:24)

【问题讨论】:

    标签: scala-gatling


    【解决方案1】:

    您的类路径一团糟,因为您有针对 Scala 2.11 (scalaj-http_2.11) 和 Scala 2.12 (scala-library:2.12.10, gatling-charts-highcharts:3.3.1) 编译的库。

    你需要到处都有 Scala 2.12。

    那么,您的文件就找不到了。它应该在src/test/resources。你把它放在哪里了?你检查过可能的错别字吗?

    【讨论】:

    • 我尝试使用 testCompile 组:'io.gatling.highcharts',名称:'gatling-charts-highcharts',版本:'3.3.1' testCompile 'org.scala-lang:scala-library :2.12.10' compile "org.scalaj:scalaj-http_2.12:2.4.2" 编译组:'com.github.tototoshi',名称:'scala-csv_2.12',版本:'1.3.6' 但是这没有用
    猜你喜欢
    • 1970-01-01
    • 2020-12-21
    • 1970-01-01
    • 2014-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多