예제 #1
0
        public TestOutcome CreateQuery(string referenceName)
        {
            TestOutcome outcome = new TestOutcome();

            outcome.moduleName = "Queries";
            outcome.methodName = "QueriesBuild";
            try
            {
                QueriesApi         queriesApi = new QueriesApi(_url);
                QueryTemplateArray templates  = queriesApi.QueriesTemplates(_session.SessionId, "QueueItem");
                foreach (QueryTemplate template in templates)
                {
                    Console.WriteLine(template.Title);
                }
                QueryTemplate a_template = templates[0];

                Dictionary <string, string> options = new Dictionary <string, string>();
                options["reference"]  = referenceName;
                options["properties"] = "";

                Query query = queriesApi.QueriesBuild(_session.SessionId, a_template.InternalRef, new QueryArguments(options));
                Console.WriteLine(query.Id);
                outcome.outcome = "Success";
                return(outcome);
            }
            catch (Exception ex)
            {
                outcome.outcome = ex.Message;
                return(outcome);
            }
        }
예제 #2
0
        public TestOutcome GetQueriesByTemplate()
        {
            TestOutcome outcome = new TestOutcome();

            outcome.moduleName = "Queries";
            outcome.methodName = "QueriesTemplates";
            try
            {
                QueriesApi         queriesApi = new QueriesApi(_url);
                QueryTemplateArray templates  = queriesApi.QueriesTemplates(_session.SessionId, "ResultTask", "", 100);
                foreach (QueryTemplate template in templates)
                {
                    Console.WriteLine(template.Title);
                }
                outcome.outcome = "Success";
                return(outcome);
            }
            catch (Exception ex)
            {
                outcome.outcome = ex.Message;
                return(outcome);
            }
        }