public void CaptureTestsInformation()
        {
            try
            {
                // initialize objects
                var context = TestContext.CurrentContext;
                var currentTestResult = new Execution();

                // get the runned test`s values
                string[] testsFullName = context.Test.FullName.Split('.');

                currentTestResult.testName = testsFullName[2];
                currentTestResult.idStatus = api.GetIdStatus(context.Result.Status.ToString());
                currentTestResult.idProject = api.GetIdProject(testsFullName[0]);
                currentTestResult.idPhase = api.GetCurrentIdPhase(currentTestResult.idPhase);

                currentTestResult.executionTime = this.stopTimer();
                currentTestResult.executionDate = System.DateTime.Now;

                // call the method to save the Execution Object
                api.PostExecution(currentTestResult);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void PostExecution(Execution exec)
        {
            var httpWebRequest = (HttpWebRequest)WebRequest.Create(string.Concat(URL, "api/executions"));
            httpWebRequest.Headers.Add(HttpRequestHeader.Authorization, getToke());

            httpWebRequest.ContentType = "application/json; charset=utf-8";
            httpWebRequest.Method = "POST";

            using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
            {
                string json = JsonConvert.SerializeObject(exec);

                streamWriter.Write(json);
                streamWriter.Flush();
            }

            var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
            using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
            {
                var result = streamReader.ReadToEnd();
            }
        }