This is a forked version of DbBot, which is a Python script to serialize Robot Framework produced test run results, i.e. output.xml files, into a database. This version serializes the results into a Microsoft® SQL Server database to provide the future Robot Framework related tools and plugins with a unified storage for the test run results.
I was playing around and encountered an error when using "-k" for keywords. Here is the command I used and below is the error message. Any help would be appreciated.
python dbbot.py -c -v -k -f c:\output.xml
Parser | `--> Parsing test: Enter Phone Information Then Refresh
Database | - Closing database connection
Traceback (most recent call last):
File "dbbot.py", line 62, in
DbBot().run()
File "dbbot.py", line 46, in run
self._parser.xml_to_db(xml_file)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 50, in
xml_to_db
self._parse_suite(test_run.suite, test_run_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 106, i
n _parse_suite
self._parse_suites(suite, test_run_id, suite_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 121, i
n _parse_suites
[self._parse_suite(subsuite, test_run_id, parent_suite_id) for subsuite in s
uite.suites]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 107, i
n _parse_suite
self._parse_tests(suite.tests, test_run_id, suite_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 124, i
n _parse_tests
[self._parse_test(test, test_run_id, suite_id) for test in tests]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 143, i
n _parse_test
self._parse_keywords(test.keywords, test_run_id, None, test_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 161, i
n _parse_keywords
for keyword in keywords]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 182, i
n _parse_keyword
self._parse_keywords(keyword.keywords, test_run_id, None, None, keyword_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 161, i
n _parse_keywords
for keyword in keywords]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 181, i
n _parse_keyword
self._parse_arguments(keyword.args, keyword_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 202, i
n _parse_arguments
[(keyword_id, arg) for arg in args]
File "C:\MSSQL-DbBot-master\dbbot\reader\database_writer.py", line 217, in ins
ert_many_or_ignore
cursor.executemany(sql_statement, doubled_values)
File "pymssql.pyx", line 475, in pymssql.Cursor.executemany (pymssql.c:7841)
File "pymssql.pyx", line 467, in pymssql.Cursor.execute (pymssql.c:7561)
pymssql.OperationalError: (8152, 'String or binary data would be truncated.DB-Li
b error message 20018, severity 16:\nGeneral SQL Server error: Check messages fr
om the SQL Server\n')
This is because the target column of your database is set to a size smaller than of this keyword argument content. You either need to increase the column size or do a substring on the argument content.
First, a big thanks for this library.
I was playing around and encountered an error when using "-k" for keywords. Here is the command I used and below is the error message. Any help would be appreciated.
python dbbot.py -c -v -k -f c:\output.xml
Parser | `--> Parsing test: Enter Phone Information Then Refresh Database | - Closing database connection Traceback (most recent call last): File "dbbot.py", line 62, in
DbBot().run()
File "dbbot.py", line 46, in run
self._parser.xml_to_db(xml_file)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 50, in
xml_to_db
self._parse_suite(test_run.suite, test_run_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 106, i
n _parse_suite
self._parse_suites(suite, test_run_id, suite_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 121, i
n _parse_suites
[self._parse_suite(subsuite, test_run_id, parent_suite_id) for subsuite in s
uite.suites]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 107, i
n _parse_suite
self._parse_tests(suite.tests, test_run_id, suite_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 124, i
n _parse_tests
[self._parse_test(test, test_run_id, suite_id) for test in tests]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 143, i
n _parse_test
self._parse_keywords(test.keywords, test_run_id, None, test_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 161, i
n _parse_keywords
for keyword in keywords]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 182, i
n _parse_keyword
self._parse_keywords(keyword.keywords, test_run_id, None, None, keyword_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 161, i
n _parse_keywords
for keyword in keywords]
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 181, i
n _parse_keyword
self._parse_arguments(keyword.args, keyword_id)
File "C:\MSSQL-DbBot-master\dbbot\reader\robot_results_parser.py", line 202, i
n _parse_arguments
[(keyword_id, arg) for arg in args]
File "C:\MSSQL-DbBot-master\dbbot\reader\database_writer.py", line 217, in ins
ert_many_or_ignore
cursor.executemany(sql_statement, doubled_values)
File "pymssql.pyx", line 475, in pymssql.Cursor.executemany (pymssql.c:7841)
File "pymssql.pyx", line 467, in pymssql.Cursor.execute (pymssql.c:7561)
pymssql.OperationalError: (8152, 'String or binary data would be truncated.DB-Li
b error message 20018, severity 16:\nGeneral SQL Server error: Check messages fr
om the SQL Server\n')