Package: dbbot
DbBot is a Python script to serializeRobot Frameworkoutput files into
a SQLite database. This way the futureRobot Frameworkrelated tools and
plugins will have a unified storage for the test run results.RequirementsPython2.6 or newer installedRobot Framework2.7 or newer installedRobot Frameworkversion 2.7.4 or later is recommended as versions prior to
2.7.4 do not support storing total elapsed time for test runs or tags.How it worksThe script takes one or moreoutput.xmlfiles as input, initializes the
database schema, and stores the respective results into a database
(robot_results.dbby default, can be changed with options-bor–database). If database file is already existing, it will insert the new
results into that database.InstallationThis tool is installed with pip with command:$ pip install dbbotAlternatively you can download the source distribution, extract it and
install using:$ python setup.py installWhat is storedBoth the test data (names, content) and test statistics (how many did pass or
fail, possible errors occurred, how long it took to run, etc.) related to
suites and test cases are stored by default. However, keywords and related
data are not stored as it might take order of magnitude longer for massive
test runs. You can choose to store keywords and related data by using-kor–also-keywordsflag.Usage examplesTypical usage with a single output.xml file:python -m dbbot.run atest/testdata/one_suite/output.xmlIf the database does not already exist, it’s created. Otherwise the test
results are just inserted into the existing database. Only new results are
inserted.The default database is a file namedrobot_results.db.Additional options are:Short formatLong formatDescription-k–also-keywordsParse also suites’ and
tests’ keywords-v–verbosePrint output to the
console.-b DB_FILE_PATH–database=DB_FILE_PATHSQLite database for test
run results-d–dry-runDo everything except
store the results.Specifying custom database name:$ python -m dbbot.run  -b my_own_database.db atest/testdata/one_suite/output.xmlParsing test run results with keywords and related data included:python -m dbbot.run -k atest/testdata/one_suite/output.xmlGiving multiple test run result files at the same time:python -m dbbot.run atest/testdata/one_suite/output.xml atest/testdata/one_suite/output_latter.xmlDatabaseYou can inspect the created database using thesqlite3command-line tool:$ sqlite3 robot_results.dbsqlite>.tablesarguments        suite_status     test_run_errors  tests
keyword_status   suites           test_run_status
keywords         tag_status       test_runs
messages         tags             test_statussqlite>SELECTcount(),tests.id,tests.nameFROM tests, test_status
        WHERE tests.id == test_status.test_id AND
        test_status.status == "FAIL"
        GROUP BY tests.name;Please note that when database is initialized, no indices are created by
DbBot. This is to avoid slowing down the inserts. You might want to add
indices to the database by hand to speed up certain queries in your own
scripts.For information about the database schema, seedoc/robot_database.md.Migrating from Robot Framework 2.7 to 2.8In Robot Framework 2.8, output.xml has changed slightly. Due this, the
databases created with 2.7 need to migrated to be 2.8 compatible.To migrate the existing database, issue the following script:python tools/migrate27to28 -b <path_to_robot_results_db>Use case example: Most failing testsOne of the common use cases for DbBot is to get a report of the most commonly
failing suites, tests and keywords. There’s an example for this purpose inexamples/FailBot/bin/failbot.Failbot is a Python script used to produce a summary web page of the failing
suites, tests and keywords, using the information stored in the DbBot
database. Please adjust (the barebone) HTML templates inexamples/FailBot/templatesto your needs.Writing your own scriptsPlease take a look at the modules inexamples/FailBot/failbotas an example
on how to build on top of the classes provided by DbBot to satisfy your own
scripting needs.LicenseDbBot is released under theApache License, Version 2.0.See LICENSE.TXT for details.