使用web_agent时,运行selenium.yaml文件执行测试报错,无法

问题

使用web_agent时,运行hogwarts-ddt-pytest selenium.yaml -r . -p --alluredir=results这条命令报错。一直报错SeleniumAgent.init() missing 1 required positional argument: ‘config’。
selenium.yaml的内容就是官方提供的内容。请问这个怎么解决?
template:

  • _use: ‘web’
  • web.run:
    task: |
    打开https://ceshiren.com
    搜索pytest
    断言搜索结果中存在 pytest

报错信息

(hogwarts_web_venv) D:\Program\ceba_web>hogwarts-ddt-pytest selenium.yaml -r . -p --alluredir=results
[2026-03-16 10:33:00][INFO][:51 load_ddt_describes] 注册到ddt_describe的数据1条:
[2026-03-16 10:33:00][INFO][:53 load_ddt_describes] selenium_agent: {‘name_path_map’: {‘web’: ‘hogwarts_selenium_agent.service.selenium_agent.SeleniumAgent’}, ‘env_injection_path’: ‘hogwarts_selenium_agent.injection.running_injection_env’, ‘init_file_generator’: <bound method SeleniumAgentHelper.init_file_generator of <class ‘hogwarts_selenium_agent.service.selenium_agent_helper.SeleniumAgentHelper’>>}
[2026-03-16 10:33:00][INFO][:145 inject_environment] 为selenium_agent注入运行数据到模块 hogwarts_selenium_agent.injection.running_injection_env 结果: {‘resource_root_dir’: True}
================================================= test session starts =================================================
platform win32 – Python 3.11.15, pytest-9.0.2, pluggy-1.6.0 – D:\Users\liany\miniconda3\envs\hogwarts_web_venv\python.exe
cachedir: .pytest_cache
rootdir: D:\Program\ceba_web
plugins: allure-pytest-2.15.3, anyio-4.12.1, langsmith-0.7.17
collected 1 item

_testcase_dir_1/test_selenium.py::Testselenium::test_template [2026-03-16 10:33:02][DEBUG][:33 register] {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>}
[2026-03-16 10:33:02][DEBUG][:33 register] {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>, ‘selenium_xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>}
[2026-03-16 10:33:02][DEBUG][:33 register] {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>, ‘selenium_xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>, ‘selenium_xml_v2’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory_v2.SeleniumXMLEngineFactoryV2’>}
[2026-03-16 10:33:02][DEBUG][:33 register] {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>, ‘selenium_xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>, ‘selenium_xml_v2’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory_v2.SeleniumXMLEngineFactoryV2’>, ‘xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>}
[2026-03-16 10:33:02][INFO][:67 collect_engine_factory] 注册到EngineFactoryRegistry的工厂类如下:
selenium → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>
selenium_xml → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>
selenium_xml_v2 → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory_v2.SeleniumXMLEngineFactoryV2’>
xml → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>
FAILED

====================================================== FAILURES =======================================================
_____________________________________________ Testselenium.test_template ______________________________________________

self = <hogwarts_ddt_framework.service.pytest_maker.pytest_hook_plugin.Testselenium object at 0x0000023B2EF02350>

???

:88:


:77: in run_case
???
:44: in run
???
:112: in run
???


self = <hogwarts_ddt_framework.service.built_in.built_in_service.BuiltInService object at 0x0000023B2D2D3A10>
name = ‘web’, args = (), kwargs = {}
_var_var_6 = {‘web’: ‘hogwarts_selenium_agent.service.selenium_agent.SeleniumAgent’}
_var_var_7 = ‘hogwarts_selenium_agent.service.selenium_agent.SeleniumAgent’
_var_var_0 = <class ‘hogwarts_selenium_agent.service.selenium_agent.SeleniumAgent’>

???
E TypeError: SeleniumAgent.init() missing 1 required positional argument: ‘config’

:145: TypeError
-------------------------------------------------- Captured log call --------------------------------------------------
DEBUG hogwarts::33 {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>}
DEBUG hogwarts::33 {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>, ‘selenium_xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>}
DEBUG hogwarts::33 {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>, ‘selenium_xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>, ‘selenium_xml_v2’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory_v2.SeleniumXMLEngineFactoryV2’>}
DEBUG hogwarts::33 {‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>, ‘selenium_xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>, ‘selenium_xml_v2’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory_v2.SeleniumXMLEngineFactoryV2’>, ‘xml’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>}
INFO hogwarts::67 注册到EngineFactoryRegistry的工厂类如下:
selenium → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>
selenium_xml → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>
selenium_xml_v2 → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory_v2.SeleniumXMLEngineFactoryV2’>
xml → <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_xml_engine_factory.SeleniumXMLEngineFactory’>
=============================================== short test summary info ===============================================
FAILED _testcase_dir_1/test_selenium.py::Testselenium::test_template - TypeError: SeleniumAgent.init() missing 1 required positional argument: ‘config’
================================================== 1 failed in 1.56s ==================================================
[2026-03-16 10:33:03][INFO][:93 start_pytest] 删除临时目录:D:\Program\ceba_web_testcase_dir_1

环境

Windows,selenium,web