How to read a HTML file and create test steps in TEST issue on Jira using Xray python ? Also, do I need to convert HTML file to JSON file for creating TEST using Xray python module ??
-
Can you please refine your question and provide more info? Which python library are you referring to by "Xray python module", as there is no such official library? – Sérgio Jul 05 '22 at 17:18
-
Using this library: from tf_altasian_tools.application.lib_jira_xray import * from atlassian import Jira, Xray – Oshin aggrawal Jul 05 '22 at 17:51
-
What is the structure of the html file? Have you extracted it from some other tool? – Sérgio Jul 05 '22 at 17:53
-
Yes, generated it from TestProject test report. – Oshin aggrawal Jul 05 '22 at 17:54
1 Answers
HTML is not a data format suitable for structuring information in a machine readable way; it's meant to present information in a readable way for humans. Whenever a tool generates an HTML report with some information, such as test cases, it doesn't follow a well-know, machine friendly syntax/schema.
My recommendation would be to get that info from your source tool (e.g., TestProject) in a format that can easily be parsed and that doesn't easily break. You can try checking if your source tool can generate a JSON or a XML report; then you need to process it yourself and implement the logic to convert it to the objects you need to make the API requests. To create tests in Xray, you can either use Xray APIs or generate a CSV that Xray supports. If you're using some library to make the requests to create the tests, it can be easier to implement but you'll have to implement the logic referred earlier.

- 1,777
- 2
- 10
- 12
-
-
you're welcome; I appreciate if you could mark my answer as correct. thanks in advance :) – Sérgio Jul 06 '22 at 08:40