HarmonyOS 鸿蒙Next Hypium框架,创建测试套文件后运行报错,File path does not exist,path: demo.pyc/demo.pyd/demo.py
HarmonyOS 鸿蒙Next Hypium框架,创建测试套文件后运行报错,File path does not exist,path: demo.pyc/demo.pyd/demo.py 创建测试套模版用例,只有2个,自己新增了2个
配置文件看着和官方文档一样
但是执行测试套报错,.pyd .pyc文件是怎么来的,也没有说明啊
这个问题要怎么解决呢,一头雾水。。。求大佬指点啊~
testsuite也要加相对路径,改成 demo/demo试试
![1.PNG](https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/241/989/980/0260086000241989980.20241021164524.27955971332893583602072534989782:50001231000000:2800:5A125263A8A0E7D938E562D3B91E052F1C7032A9AE29A64774B49F1CB9FC21BD.png)
更多关于HarmonyOS 鸿蒙Next Hypium框架,创建测试套文件后运行报错,File path does not exist,path: demo.pyc/demo.pyd/demo.py的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
感谢,之前的问题解决了,现在出现了新问题
TypeError: demo.__init__() takes 2 positional arguments but 3 were given
[ErrorNo=00000]
[2024-10-22 10:10:30,177] [15660] [DeviceTest] [INFO] [Executing test suite: D:\Project\Pycharm\HarmonyOS_UITest\testcases\demo\demo.py.]
[2024-10-22 10:10:30,177] [15660] [Listener] [DEBUG] [Start test suite [demo] with 0 tests]
[2024-10-22 10:10:30,330] [15660] [DeviceTest] [INFO] [Success to import demo.]
[2024-10-22 10:10:30,331] [15660] [DeviceTest] [ERROR] [[Script-0203017] Failed to run the test suite, error: demo.__init__() takes 2 positional arguments but 3 were given [Suggestions] 测试套运行失败] [ErrorNo=00000]
[2024-10-22 10:10:30,331] [15660] [DeviceTest] [ERROR] [Traceback (most recent call last):
File "D:\Install\Python310\lib\site-packages\devicetest\runner\test_runner.py", line 477, in run_test_suite
with test_cls(self.configs, suite_dir_path) as test_cls_instance:
TypeError: demo.__init__() takes 2 positional arguments but 3 were given
] [ErrorNo=00000]
[2024-10-22 10:10:30,331] [15660] [SuiteReporter] [ERROR] [demo no suite result exists] [ErrorNo=00000]
[2024-10-22 10:10:30,332] [15660] [Utils] [INFO] [D:\Project\Pycharm\HarmonyOS_UITest\reports\2024-10-22-10-10-28\result\demo.xml does not exist, create an empty report]
[2024-10-22 10:10:30,332] [15660] [ReporterHelper] [INFO] [Generate data report: D:\Project\Pycharm\HarmonyOS_UITest\reports\2024-10-22-10-10-28\result\demo.xml]
[2024-10-22 10:10:30,333] [15660] [Hdc] [INFO] [FMR0224125000008 execute command: hdc shell find /data/log/hilog -mtime -0s -type f with timeout 300.0s]
[2024-10-22 10:10:30,478] [15660] [Device] [DEBUG] [find: '/data/log/hilog/..': Permission denied,
已解决,初始化入参错误
针对您提到的HarmonyOS鸿蒙Next Hypium框架中创建测试套文件后运行报错的问题,错误信息提示"File path does not exist,path: demo.pyc/demo.pyd/demo.py",这通常意味着系统无法找到指定的文件路径。
-
检查文件路径:首先确认您的测试套文件是否确实位于您期望的目录下。错误信息中提到的
demo.pyc
、demo.pyd
和demo.py
可能是不同Python解释器或编译环境下的产物。通常,.pyc
是Python编译后的字节码文件,.pyd
是Windows平台上的Python动态链接库,而.py
是Python源代码文件。您需要确保使用的是正确的文件类型,并且该文件确实存在于指定路径。 -
路径格式:检查路径分隔符是否正确。在Windows系统中,路径分隔符通常为
\
,而在Linux或鸿蒙系统中,路径分隔符为/
。确保您的路径格式与操作系统相匹配。 -
文件访问权限:确认您的应用或测试框架是否有权限访问指定的文件路径。
如果以上步骤均无法解决问题,可能涉及到更具体的框架配置或环境问题。此时,您可以考虑查看HarmonyOS Next Hypium框架的官方文档或社区论坛,以获取更针对性的帮助。如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html