TestNG- Skipping Test deliberately | Selenium Forum
M
Posted on 31/01/2017
Hi,
Is there any way to skip a test case in tesgng deliberately ...other than the dependsonMethod

For example if the Run more is N I want to be able to skip the test and report in the reports

M
Replied on 31/01/2017

yes, you can skip tests by putting runmode N.


M
Replied on 01/02/2017

I do have the Run mode N but how do I report it in the reports as skipped ???? in a extent report I want to report it has SKipped


M
Replied on 01/02/2017

where are you calling the function that checks runmode?


M
Replied on 01/02/2017

I am not calling any function
My hypothetical Excel file
Test case | Run Mode
login Y
Logout N
Registration Y


So I am checking through a for loop if the run mode for each and every test case given in the parameter is Y or N..
When it is Y I want to execute the test case and the report is reported in the extent report
but
when it is Y I want to report it as the test case SKIPPED in the report and NOT FAIL !!
I dont want to user Assert.fail() instead I want to report it as skipped

what should I do ? Please guide
If I use throw new SkipException("Test skipped");
will it come in the extent report as skipped for that test case ?


M
Replied on 01/02/2017

send me screen shot of your test case.