Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Dynamic test run with test cases from multiple suites


#1

Hi,

I’m from Satori Software. I wanted to create dynamic test run with test cases from multiple test suites. Is it possible?

Right now i’m creating dynamic test run from one test suite:

   private int CreateTestRunSmallSet(string environment, string testType)
    {
        string runID = "";

        if (testType.Equals("SmallSet"))
        {

            var data = new Dictionary<string, object>
            {
                {"suite_id", 2122},
                {
                    "name", DateTime.Now.ToString("yyyy-MM-dd") + "  " + DateTime.Now.ToShortTimeString() + "  High priority SmallSet " + environment
                },
                {"include_all", false},
                {"case_ids", new string[]{"3940", "3941", "3942", "4101", "4112", "4161", "4162", "17519", "17520", "17521", "17522", "17523", "17524", "17525"}}

            };

          
            try
            {

                String sAPIMethod = "add_run/8";
                JObject p = (JObject) testRailClient.SendPost(sAPIMethod, data);
                //Console.WriteLine("Current Run ID " + p["id"].ToString() + "...........");
                runID = p["id"].ToString();
            }
            catch (APIException e)
            {
                Console.WriteLine(e.StackTrace);
            }

        }

        return Convert.ToInt32(runID);
    }

#2

Hi Sara,

Thanks for your posting. Test runs are always linked to a single suite but you can create a test plan in this case (a group of runs):

http://docs.gurock.com/testrail-api2/reference-plans
http://www.gurock.com/testrail/videos/test-plans-configurations/

In general, we recommend using a single suite (just one case repository) per project and TestRail 4.0 made this the default mode for new projects:

Cheers,
Tobias