Issue
i have a method and i want to run this method and then showing skip in report
@Test(priority = 18, dataProvider="excelSheetNameAsMethodName",dataProviderClass=ExcelDataProvider.class)
public void addNotesFromRequisitionListAndDetailsPage(String username,String emailID,String password) throws Exception {
cbatLoginPage().enterEmailID(emailID, password);
cbatMyAccountPage().verifyApplicantTrackingTile();
cbatMyAccountPage().selectTile("Applicant Tracking");
cbatHomePage().switchWindow();
cbatHomePage().verifyCBATHomePage(username);
cbatHomePage().selectWidget("MY REQUISITIONS");
cbatRequisitionPage().clickFirstNoteIcon();
String noteText = "Test Note "+ RandomGenerator.GenerateRandomNumber(3);
cbatRequisitionPage().enterNewNote(noteText);
cbatRequisitionPage().clickFirstNoteIcon();
cbatRequisitionPage().verifyNoteAdded(noteText);
cbatRequisitionPage().selectRequisition();
cbatRequisitionPage().clickFilledNoteIcon();
noteText = "Test Note "+ RandomGenerator.GenerateRandomNumber(3);
cbatRequisitionPage().enterNewNote(noteText);
cbatRequisitionPage().clickFilledNoteIcon();;
cbatRequisitionPage().verifyNoteAdded(noteText);
}
how can i Skipped this test case ? i use throw new skipexception("message") but it doesn't work.
Solution
Consider you have method A and method B . add annotation depends on tag in your method B so if method A fails method B will be skipped.
@Test(priority = 1, dependsOnMethods = "administration_device_configure_custom_fields_default")
Answered By - Jayanth Bala
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.