robotframework / DbBot

DbBot is a tool to serialize Robot Framework test run results into a SQLite database.
robotframework.org
Apache License 2.0
60 stars 69 forks source link

AttributeError: 'TotalStatistics' object has no attribute 'all' #26

Open rhl07 opened 3 years ago

rhl07 commented 3 years ago

Issue found not able to move ahead.

(Robot) C:\Users\Rahul.Mangal>python -m dbbot.run E:/routput.xml
Traceback (most recent call last):
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\site-packages\dbbot\run.py", line 51, in <module>
    DbBot().run()
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\site-packages\dbbot\run.py", line 41, in run
    self._parser.xml_to_db(xml_file)
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\site-packages\dbbot\reader\robot_results_parser.py", line 51, in xml_to_db
    self._parse_suite(test_run.suite, test_run_id)
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\site-packages\dbbot\reader\robot_results_parser.py", line 116, in _parse_suite
    self._parse_suite_status(test_run_id, suite_id, suite)
  File "C:\Users\Rahul.Mangal\.conda\envs\Robot\lib\site-packages\dbbot\reader\robot_results_parser.py", line 125, in _parse_suite_status
    'passed': suite.statistics.all.passed,
AttributeError: 'TotalStatistics' object has no attribute 'all'
huyle-anh commented 2 months ago

How to fix this issue? I've encountered a similar issue.

AttributeError: 'TotalStatistics' object has no attribute 'all'
huyle-anh commented 2 months ago

The issue stems from the disparities and incompatibilities between Python versions. To fix them on my system, I used Python version 3.8 compiled from the source.

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
$ python3 -V
Python 3.8.19
$ pip3 -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)