Skip to content

参数化数据驱动parameters加载自定义函数没找到 #1467

@BoxTester

Description

@BoxTester

问题描述

hrp run 运行json文件,json文件中使用parameters参数化数据驱动的其中一种方式,即返回list[dict]模式,报错函数未找到

版本信息

请提供如下版本信息:

  • 操作系统类型: Windows
  • Python 版本: 3.7
  • Go 版本: 1.18
  • HttpRunner 版本: 4.2.0

项目文件内容(非必须)

1
报错信息
PS $$$ hrp run testcases\suittestcasetestcopy.json -g
5:58PM INF Set log to color console other than JSON format.
5:58PM ??? Set log level
5:58PM INF [init] SetFailfast failfast=true
5:58PM INF [init] SetSaveTests saveTests=false
5:58PM INF [init] SetgenHTMLReport genHTMLReport=true
5:58PM INF [init] SetRequestsLogOn
5:58PM INF load file path="testcases\suittestcasetestcopy.json"
5:58PM INF load file path="C:\Users\95439\hrp4demo\.env"
5:58PM INF set env key=base_url
5:58PM INF set env key=USERNAME
5:58PM INF set env key=PASSWORD
5:58PM INF load testcases successfully count=1
5:58PM INF start to prepare python plugin output="C:\Users\95439\hrp4demo\.debugtalk_gen.py" path="C:\Users\95439\hrp4demo\debugtalk.py"
5:58PM INF exec command cmd="C:\WINDOWS\system32\cmd.exe /c python -m py_compile C:\Users\95439\hrp4demo\debugtalk.py"
5:58PM INF find all function names functionNames=["get_user_agent","sleep","sum","sum_ints","sum_two_int","sum_two_string","sum_strings","concatenate","setup_hook_example","teardown_hook_example","getkey","getparameters"]
5:58PM INF generate debugtalk success output="C:\Users\95439\hrp4demo\.debugtalk_gen.py"
5:58PM INF build python plugin successfully output="C:\Users\95439\hrp4demo\.debugtalk_gen.py" plugin="C:\Users\95439\hrp4demo\debugtalk.py"
5:58PM INF ensure python3 venv packages=["funppy==v0.5.0"] python3="C:\Users\95439\.hrp\venv\Scripts\python.exe"
5:58PM INF python package is ready name=funppy version=v0.5.0
5:58PM INF set python3 executable path Python3Executable="C:\Users\95439\.hrp\venv\Scripts\python.exe"
5:58PM INF load hashicorp go plugin success path="C:\Users\95439\hrp4demo\.debugtalk_gen.py"
5:58PM ERR call function failed error="function getparameters is not found" arguments=[] funcName=getparameters
5:58PM ERR parse parameters content failed error="function getparameters is not found" parametersRawContent=${getparameters()}
5:58PM ERR parse config parameters failed error="function getparameters is not found" parameters={"cardno-dtype-error_code":"${getparameters()}"} parametersSetting=null
5:58PM ERR [Run] init session runner failed error="parse testcase config failed: parse testcase config parameters failed: function getparameters is not found"
5:58PM INF quit hashicorp plugin process
2022-09-05T17:58:17.753+0800 [WARN] grpc-py: plugin failed to exit gracefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions