Error Traceback (most recent call last): AttributeError: 'test_1121' object has no attribute '' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\software\python\UI自动化脚本20220203\框架\unittest001\SDB\lig.py", line 17, in test_b222 agd = test_1121(test_1121.qa) ValueError: no such test method in <class 'lig.test_1121'>:
时间: 2023-12-19 10:29:40 浏览: 152
根据错误信息,`test_1121` 类没有一个空字符串名称的属性或方法。在 `test_b222` 方法中,你似乎试图通过传递一个空字符串参数来访问 `test_1121` 类的属性或方法。请检查你的代码,确保你在使用 `test_1121` 类时传递的参数是正确的并且符合预期。此外,`test_1121` 类应该是一个可调用对象,你不能通过实例化 `test_1121` 类的方式来访问类的属性或方法。你可以直接访问类的属性或方法,如 `test_1121.qa`。如果你需要进一步帮助,请提供更多的代码和错误堆栈信息。
相关问题
Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 939, in _find_spec AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec' During handling of the above exception, another exception occurred:
这个错误通常是由于Python版本不兼容导致的。请确认您正在使用的是与ChitGPT兼容的Python版本。ChitGPT是使用Python 3.6开发的,如果您的Python版本不是3.6,建议您升级到3.6或更高版本。您还可以尝试使用虚拟环境来确保ChitGPT的依赖项不会与其他Python项目发生冲突。
D:\Users\Administrator\python\python.exe D:/Users/Administrator/pythondaima/gongzhuolianli.py Traceback (most recent call last): File "D:\Users\Administrator\pythondaima\gongzhuolianli.py", line 17, in <module> web_actions() File "D:\Users\Administrator\pythondaima\gongzhuolianli.py", line 12, in web_actions WD.maximize_window() AttributeError: 'Chrome' object has no attribute 'maximize_window' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Users\Administrator\pythondaima\gongzhuolianli.py", line 20, in <module> time.sleep(1) AttributeError: type object 'datetime.time' has no attribute 'sleep'
这些错误看起来像是你正在尝试使用 Selenium 库来自动化浏览器操作,但是你的程序出现了一些问题。
第一个错误 "AttributeError: 'Chrome' object has no attribute 'maximize_window'" 表明你正在使用 Chrome 浏览器对象,但是它没有 "maximize_window" 属性。这个错误可能是由于你使用的 Selenium 版本过低导致的。你可以尝试更新 Selenium 或者使用 "set_window_size" 方法来代替 "maximize_window" 方法。
第二个错误 "AttributeError: type object 'datetime.time' has no attribute 'sleep'" 表明你正在使用 datetime 库中的 time 模块中的 sleep 函数。这是一个常见的错误,通常是因为你意外地导入了错误的模块或者函数。你可以尝试使用 "time.sleep" 函数来代替 "datetime.time.sleep" 函数。
如果你需要进一步帮助,请提供更多的代码和上下文信息。
阅读全文
相关推荐

















