How to report failed testcase in jira using automation

爱⌒轻易说出口 提交于 2019-12-24 11:15:13

问题


I am automating a website using selenium webdriver with java, I want to write the result "Pass" or "Fail" in excel sheet. How can i automate the reporting of a failed test case in JIRA by taking the status from excel sheet.


回答1:


Since you are already writing to an excel file, I understand that you are able to access the contents of the Excel Sheet. If this is not completed yet, you might want to consider using http://poi.apache.org/spreadsheet/index.html for this purpose. Once you have the status of the test cases, you can use the JIRA API to create bugs https://ecosystem.atlassian.net/wiki/display/JRJC/Home. A more specific example of how to do this is mentioned here (https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue). However, since a bug (defect) usually requires more information than a simple PASS / FAIL, I would suggest that you might want to collect more information like the stack trace etc and save it in the excel file (or an XML file) when the test fails. Which test runner are you using? If it is JUnit / TestNG, I believe a XML file is created by default for a test run, which might have some of this information.




回答2:


You can use 'Apache POI' to read cells from Excel sheet and 'Jira Client' to update status in Jira. 'Jira Client' is a JIRA REST based client library for Java. You can read more about this here: https://github.com/rcarz/jira-client/blob/master/README.md



来源:https://stackoverflow.com/questions/16827989/how-to-report-failed-testcase-in-jira-using-automation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!