使用Web App agent 试用版,执行时提示找不到配置

问题

使用Web App agent 试用版,执行时提示找不到配置,执行失败

报错信息

FAILED _testcase_dir/test_selenium.py::Testselenium::test_template - TypeError: SeleniumAgent.init() missing 1 required positional argument: ‘config’

环境

python 3.11.0,按照教程执行的

  • 上一个发布版本有一个适配性的BUG,现在已经修复了,可以用如下命令更新一下依赖包:
pip install -U 'hogwarts-ddt-framework  hogwarts-selenium-agent hogwarts-appium-agent -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple --extra-index-url https://pypi-business:zsAhMzdc422Cx6kvmaBadih4@repo.ceba.ceshiren.com/repository/pypi-business/simple 

(.venv) PS C:\Users\glodon\PycharmProjects\PythonProject5> hogwarts-ddt-pytest selenium.yaml -r . -p --alluredir=results
[2026-05-15 14:13:28][INFO][:51 load_ddt_describes] 注册到ddt_describe的数据2条:
[2026-05-15 14:13:28][INFO][:53 load_ddt_describes] appium_agent: {‘name_path_map’: {‘app’: ‘hogwarts_appium_agent.agent.appium_agent.AppiumAgent’}, ‘env_injection_path’: ‘hogwarts_appium_agent.injection.running_injection_env’, ‘init_file_generator’: <bound method AppiumAgentHelper.init_file_generator of <class ‘hogwarts_appium_agent.service.appium_agent_helper.AppiumAgentHelper’>>}
[2026-05-15 14:13:28][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-05-15 14:13:28][INFO][:145 inject_environment] 为appium_agent注入运行数据到模块 hogwarts_appium_agent.injection.running_injection_env 结果: {‘resource_root_dir’: True}
[2026-05-15 14:13:28][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.0, pytest-9.0.3, pluggy-1.6.0 – C:\Users\glodon\PycharmProjects\PythonProject5.venv\Scripts\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\glodon\PycharmProjects\PythonProject5
plugins: allure-pytest-2.16.0, anyio-4.13.0, langsmith-0.8.4
collected 1 item

_testcase_dir/test_selenium.py::Testselenium::test_template [2026-05-15 14:13:30][DEBUG][:33 register] {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>}
[2026-05-15 14:13:30][DEBUG][:33 register] {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>}
[2026-05-15 14:13:30][DEBUG][:33 register] {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘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-05-15 14:13:30][DEBUG][:33 register] {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘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-05-15 14:13:30][DEBUG][:33 register] {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘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-05-15 14:13:30][INFO][:67 collect_engine_factory] 注册到EngineFactoryRegistry的工厂类如下:
appium → <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>
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 0x000001448A78F090>

???

:88:


:77: in run_case
???
:44: in run
???
:112: in run
???
:144: in use
???
:51: in load_class
???
:29: in load_module
???
…..\AppData\Local\Programs\Python\Python311\Lib\importlib_init
.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:1206: in _gcd_import
???
:1178: in _find_and_load
???
:1149: in _find_and_load_unlocked
???
:690: in _load_unlocked
???
:940: in exec_module
???
:241: in _call_with_frames_removed
???
:3: in
???
:29: in
???
:3: in
???


???
E ImportError: cannot import name ‘NeedRecallException’ from ‘hogwarts_toolkit_framework.errors.running_errors’ (C:\Users\glodon\PycharmProjects\PythonProject5.venv\Lib\site-packages\hogwarts_toolkit_framework\errors\running_errors.py)

:9: ImportError
-------------------------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------------------------
DEBUG hogwarts::33 {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>}
DEBUG hogwarts::33 {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘selenium’: <class ‘hogwarts_selenium_framework.service.engine_factory.selenium_engine_factory.SeleniumEngineFactory’>}
DEBUG hogwarts::33 {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘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 {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘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 {‘appium’: <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>, ‘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的工厂类如下:
appium → <class ‘hogwarts_appium_framework.service.appium_engine_factory.AppiumEngineFactory’>
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/test_selenium.py::Testselenium::test_template - ImportError: cannot import name ‘NeedRecallException’ from ‘hogwarts_toolkit_framework.errors.running_errors’ (C:\Users\glodon\PycharmProjects\PythonProject5.venv\Lib\site-packages\hogwarts_toolkit_framework\errors\running…
======================================================================================================== 1 failed in 3.29s ========================================================================================================
[2026-05-15 14:13:32][INFO][:93 start_pytest] 删除临时目录:C:\Users\glodon\PycharmProjects\PythonProject5_testcase_dir

安装完是这个报错