Because of improving the automated test quality of our test cases in Robot Framework, we want to get a clear vision on the quality of our keywords that are used.
So, can somebody explain or help me with getting a report or a list with all failing keywords and if possible to create a "top 10 most failing keywords".
Currently I have written a Python script that can count all keywords over all test cases and test suites. However, when I want to filter them by status (count of status = PASS and status = FAIL), the totals aren't correct.
This has probably to do with the fact that the status of child-keywords in parent-keywords are counted as well...
for i in files_output:
dom = ElementTree.parse(i)
root = dom.getroot()
print("Adding Keywords")
for kw in root.iter('kw'):
count+=1
kw_element = kw.attrib["name"]
keyword_list_total[kw_element] = 1
if kw_element not in keyword_list_failed:
for item in kw.iter('status'):
if "FAIL" in item.attrib["status"]:
keyword_list_failed[kw_element] = 1
elif kw_element in keyword_list_failed:
for item in kw.iter('status'):
keyword_list_total[kw_element] += 1
if "FAIL" in item.attrib["status"]:
keyword_list_failed[kw_element] += 1
for example: a keyword in the last has a TOTAL: 30 but will give FAILED: 523. It clearly doesn't make sense.
Thank you already for helping me out!