Selenium+Python自动化测试学习问题总结笔记

时间:2022-03-25 18:27:41

1.问题描述:不能导入自定义类

错误内容:This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items

截图:(count.py文件不能导入在相同路径下的pub.py的方法)

Selenium+Python自动化测试学习问题总结笔记

解决方法1:将导入部分写成:from WebTest.project.pub import add (将路径明确写入)

解决方法2:进入:File—setting—Bulidout,Excution,Deployment—Console—Python Console 如下图操作

Selenium+Python自动化测试学习问题总结笔记

之后右击项目,如下图操作

Selenium+Python自动化测试学习问题总结笔记