I have created a framework using java in POM format. i want to update the test run result in test rail after every test method is executed in my test file. I have created a class TestRail where there is a method updateTest. This method takes id of test case and status of test case and hit the post request which the update the status in test rail.
Now my confusion is how should i pass the test case id from test file after every test method? Should i add test id as tag in every test case? How will i fetch the test id from tag in after method?
for example:
@Test(groups = {"1","2"})
public void verifyLogin()
{
Assert.assertTrue(anyMthodHere());
}
@AfterMethod
public void after()
{
postTestResult("pass", i want id 1 and 2 here);
}