報錯現象:如下圖
排查方法:
1.檢查xx.py文件中的類是否添加有 __init__函數。如果缺少,那么就會報錯紅顯
2.檢查xx.py文件中 引入模塊時,路徑是否為 [絕對路徑]。如果不是絕對路徑,那么就會由於找不到模塊(CommonLib)而報錯紅顯
若不為絕對路徑時,就會因為找不到模塊而報錯,報錯現象如下
Importing test library'kuangjiang_0719' failed: ModuleNotFoundError: No module named'CommonLib' |
如果上述的兩個情況都不是,那么從RIDE的 Tools -》 RIDE LOG中查看報錯原因
-例如會報錯:ChromeDriver版本與瀏覽器版本不一致
Importing test library 'py_custom_keyword' failed: SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 90 Current browser version is 92.0.4515.107 with binary path C:\Users\admin\AppData\Local\Google\Chrome\Application\chrome.exe |