0

When writing manual test cases, the test case title used to be something like

TC1: Verify that the user is able to login to facebook and react using heart.

When trying to automate the scenario using selenium+ TestNG, how to write meaningful test case titles.

Note: I believe that in TestNG, the test case name is the same as the method identifier under @test annotation

//Testcase 1
  @Test
  public void VerifyThatUserCanLoginToFaceebookAndReactUsingHeart() {
   //Writeyourcodehere
}

Is it permissible to write such long method names or is there a better way to write test case names in TestNG or/and selenium.

1

I would keep the method name simple and add description in the @Test annotation like this:

@Test(description = "User can log into facebook and react with heart")
public void loginReactHeart() {
    //some code 
}
  • is there any other way? or this is the recommended practice. Here the description is not coming in emailable report – PDHide Jun 29 at 16:22
  • 1
    You will have to customize the report to include description – Moro Jun 29 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.