调用第二个要素文件中的第一个要素失败,没有指定的线索 [英] call the first feature from the second feature file, failed without specified clue

查看:9
本文介绍了调用第二个要素文件中的第一个要素失败,没有指定的线索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

成功运行第一个.Feature文件,但是从第二个.Feature文件调用它。Feature失败,没有任何线索可供分析。你有什么办法帮我找出根本原因吗?

我第一个功能的来源:

Feature: 采样管理-样本登记

  Background: 读取随机生成的条形码、手机号、采样类型等作为入参
    * url baseURL

    * def randomData = Java.type('utils.RandomData')
    * def barcode = randomData.getRandom(11)
    * def randomPhone = randomData.getTelephone()
    * def sampletype = randomData.getNum(0,1)

  Scenario: 输入合法参数进行正常样本登记,确认能够登记成功

    Given path 'iEhr/PersonSample'
#    * header Content-type = 'application/x-www-form-urlencoded; charset=UTF-8'
    * cookies { JSESSIONID: '#(jsessionID)',SESSION: '#(sessionID)', ACMETMP: '#(acmetmpID)'}
    * def autoMotherName = "autoMname"+ barcode

#    * def confData = {mothername: "#(autoMotherName)", barcode: "#(barcode)", mobile: '#(randomPhone)', sampletype:"#(sampletype)" }
#   设置sampletype为1,已被采样
    * def confData = {mothername: "#(autoMotherName)", barcode: "#(barcode)", mobile: '#(randomPhone)', sampletype:"1" }
#    打印入参变量输出
    * print confData

#    用例与数据分离
    * def paramObj = read('classpath:mainFlow/sampleSaveReqTest.json')
    * print paramObj
    * form field param = paramObj

    When method post

    Then status 200
    * json result = response[0].result
    * def personId = result[0].personid
    * def sampleid = result[0].sampleid
    * print personId
    * print sampleid

我的第二个功能的来源:

Feature: 提交递送样本
  Background:

    * def sampleResult = call read('classpath:mainFlow/first.feature')
    * print sampleResult

我首先运行该功能。该功能单独运行,可以正常工作。但是,空手道在运行Second.功能后会报告下面的错误。你知道我怎么调试才能找到根本原因吗?我不知道二读有什么问题。非常感谢!

* def sampleResult = call read('classpath:mainFlow/first.feature')

-未知-:14-脚本求值失败:Read(‘classpath:mainFlow/first.Feature’),空

推荐答案

查找karate-config.js的问题。正如Babu在评论中所说,很难弄清楚问题是什么,我建议您遵循以下过程:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

如果最新的预览版本0.9.3.RC2能更好地显示错误是什么,请尝试。

如果您可以将问题复制为一个小示例,它将对我们有所帮助-因为我们确实需要更好地显示更有用的错误日志,而不仅仅是null

这篇关于调用第二个要素文件中的第一个要素失败,没有指定的线索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆