Delivered by FeedBurner

Selenium WebDriver Framework - Implementing Suite Skip Function

Prerequisite : All previous selenium framework creation steps starting from STEP 1 to STEP 10 should be Implemented.

Right now we are at the middle of selenium Webdriver software automation framework creation process. Now next step Is to Implement software automation test suite skipping functionality In selenium data driven automation framework.

Why Need Test Suite Skip Function?
Supposing you are testing software web application and you have created 10 different software test automation suites for your application. But at any specific stage, You wants to execute only 3 software test suites from 10 test suites. In this condition, Your selenium automation framework should have a facility to run only selected 3 test cases. Remaining 7 software test automation suites should skiped from execution.

How To Skip Test Suites From Execution
For skipping test suites from execution, We have to add some code In both software automation test suite's base files and we have to set "SuiteToRun" = "N" (against the test suite you wants to skip) In TestSuiteList.xls file. So code of and files will check the "SuiteToRun" flag for that specific test case In "SuitesList" sheet of TestSuiteList.xls file.

Skip "SuiteOne" Suite From Execution
So let's consider, You wants to skip "SuiteOne" from execution and you wants to execute only "SuiteTwo" suite In our automation framework. For that you needs to set "SuiteToRun" = "N" for "SuiteOne" In  "SuitesList" sheet of  TestSuiteList.xls file as bellow.

I have updated and files and also updated TestSuiteList.xls file accordingly to skip "SuiteOne" from execution. You can download all three file's zip folder by clicking on bellow given link.

Extract the zip folder after downloading It. You will get bellow given three files from It. Replace them with existing files of "WDDF" project In Eclipse as described bellow.
(Note : It should replace existing file when paste It on package. It should not Insert new file.)

  • Paste TestSuiteList.xls File on com.stta.ExcelFiles Package.
  • Paste File on com.stta.SuiteOne Package.
  • Paste File on com.stta.SuiteTwo Package.
Now run your testng.xml file by right clicking on It as described In previous post and verify testng result and console result.

Testng result will looks like bellow

So we achieved our goal of skipping "SuiteOne" from execution. Now supposing you wants to skip "SuiteTwo" from execution. To do that, You just need to set  "SuiteToRun" = "Y" for "SuiteOne" and "SuiteToRun" = "N" for "SuiteTwo" In  "SuitesList" sheet of  TestSuiteList.xls file. It will execute only "SuiteOne" and skip "SuiteTwo" execution.


  1. Hello,
    Please is this the last step in creating the data driven framework?

  2. We are at the middle of framework creation.
    Still few more steps related to reporting result and Integrating webdriver with framework are pending

  3. Even if i give "N" inside "TestSuiteList" as SuitetoRun, it is still running all the classes. Kindly help me out

  4. I am giving "N" against SuiteOne in SuiteToRun column inside "TestSuiteList" .xls but all classes are running. Kindly help me out.

  5. Using @BeforeSuite annotation I am having problems as the SkipException never is thrown when matches the 'if' conditions. The exception is thrown from the DataProvider as NullPointException.
    I changed the annotation by @BeforeClass and it works pretty. But I don't think that's the best approach. Are some conditions to use @BeforeSuite annotation?

  6. This comment has been removed by the author.

  7. Even if i give "N" inside "TestSuiteList" as SuitetoRun, it is still running all the classes. Kindly help me out

  8. Even if i give "N" inside "TestSuiteList" as SuitetoRun, it is still running all the classes. Kindly help me out

  9. guys executing testng.xml,which has both suits but only one sute is executing when i try to executing testNG.xml....
    Plzzzzzzzzzzzz help
    thanks in advance

  10. Hi guys, despite giving N in 'SuiteToRun' for 'SuiteOne', its still running all the 4 test cases. Looking for somehelp to resolve it. Thanks in advance

  11. Hi Prem Reddy, Please use and files from Download After extraction replace the file and then do the changes in xls and try.