Hi,
How can I grep a table with heading Killed tests into Jira through Python?
I have been trying it like this, but this does'nt work.
def grep_killed_tests_table(jREG_REF):
jtableinfo = []
try:
response = requests.get(jREG_REF, verify=False)
response.raise_for_status()
content = response.text
tree = html.fromstring(content)
print(f"tree: {tree}")
xpath_exp = "//table[.//th[contains(., 'Killed tests')]]"
jkilled_tests_table = tree.xpath(xpath_exp)
print(f"jkilledteststable {jkilled_tests_table}")
if jkilled_tests_table:
jtable_data = []
for row in jkilled_tests_table[0].xpath(".//tr"):
row_data = [cell.text_content().strip() for cell in row.xpath(".//td|.//th")]
if row_data:
jtable_data.append(row_data)
print(f"jtabledata{jtable_data}")
for row in jtable_data:
return jtableinfo
except requests.exceptions.RequestException as e:
print(f"{script_error} Not found {e}")
jkilled_tests_table = grep_killed_tests_table(jREG)
I want it to be updated into Jira from Confluence . Could you help me out with this?
Warm Regards,
Keerthi