Forum Discussion

kendemoor's avatar
kendemoor
Occasional Contributor
6 years ago

How to run only testcases with a specific tag, in a full regression.

My scenario is the following.

I have a full regression with many test suites. In each of these test suites I have all my test cases tagged with "Known Defect" or "No defect"

The idea was to be able to run the entire regression for only the known defects, and also for only the known working functionality.

However when running my regression I seem to only be able to filter based on testsuite level tags, when running a testsuite seperately I can use testcase level tags but then I'd have to run every TestSuite seperately rather than in one large regression.

Is there a way for me to run all these testsuites at once using testcase filters, or is this missing functionality from SoapUI pro?

Thanks for your time

4 Replies

  • kendemoor

    as per my assumption you have to run bulk of testcases in testSuites those are tagged as "Known Defect"

    if this is your scenario then by following below step you can achive the result:-

    1) define a new custom property as 'key and the value as Known Defect'\

    2) put setup script on testSuite level as below it will disable the remaining testcases :-

    runner.testSuite.getTestCaseList().each{tc->
    if(tc.getPropertyValue("key").equalsIgnoreCase("Known Defect"))
    {

    log.info tc.name
    }else{
    log.info "disabling "+tc.name
    tc.disabled=true
    }
    }

    3) run the testsuite it will only run the testcases which are property key defined as Known Defect

     

    Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.Smiley Wink

     

    • kendemoor's avatar
      kendemoor
      Occasional Contributor

      Thanks,

      That is an interesting workaround and I could see how it could work, but for my specific use case it has some issues since I already disable/enable some testcases based on other factors. 

      I know the functionality to filter a test run specifically based on tags already exists, since it's available when I use it on a testsuite. I'd like to find a way to specifically use this functionality on a higher level when combining test suites in a regression, without enable/disable overwrites.

      Screenshot of the functionality for clarity.



      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi kendemoor,

         

        At the moment, there is no way to run all TestCases with a specific tag from different Test Suites at once. I suggest that you submit a feature request here. Other community members will be able to vote for this request, and this will increase its rating.

         

        Meantime, you can try using the suggestion given by ashu248 - it sounds reasonable.

  • nmrao's avatar
    nmrao
    Champion Level 3

    kendemoor,

     

    Another clean / elegant way to achieve the same could be to use Custom Events as there is no in built functionality. I am not sure though if API has been exposed it or not.

     

    Here is the idea.

     

    Write implement "beforeTestCase" method of TestSuiteRunListener.

    # Access the current test case tags (please check the javadocs to see if possible)

    # Execute the test case if the test case is tagged with intended one

    # Skip the execution of test case otherwise

     

    This way, either all the suites can be executed at once or execute them separately. Nothing to bother.

     

    Hope this helps.