Ejemplo n.º 1
0
        private bool ExecuteStep(DataRow dr, RemoteWebDriver driver)
        {
            string guimapName        = string.Empty;
            string guiMapCommandName = string.Empty;
            bool   result;
            int    guiTestId       = Convert.ToInt32(dr["GuiTestID"].ToString().Trim());
            string inputTableValue = string.Empty;
            int    guiMapId        = Convert.ToInt32(dr["GuiMapID"].ToString().Trim());
            int    guiMapCommandId = Convert.ToInt32(dr["GuiMapCommandID"].ToString().Trim());

            try
            {
                var sql            = new Sql();
                var sl             = new Selenium();
                var adapterGuimap  = new GuiMapTableAdapter();
                var adapterTest    = new TestTableAdapter();
                var adapterCommand = new TestCommandTableAdapter();
                //var adapter_test_failurelog = new DataSetAutoTestTableAdapters.TestFailiureLogTableAdapter();
                string inputDataColumn   = string.Empty;
                var    adapterGuiproject = new GuiProjectPageTableAdapter();

                _projectPageId = Convert.ToInt32(adapterTest.GetProjectPageID(Convert.ToInt32(guiTestId)));
                //_projectId = Convert.ToInt32(adapterGuiproject.GetProjectID(_projectPageId));
                string inputTableValueDescription = string.Empty;
                if ((dr["InputDataRow"].ToString().Trim() != string.Empty) &&
                    (dr["InputDataRow"].ToString().IndexOf('-') < 0) && (dr["InputDataRow"].ToString().IndexOf(',') < 0))
                {
                    string inputDataRow = dr["InputDataRow"].ToString().Trim();
                    inputDataColumn = dr["InputDataColumn"].ToString().Trim();
                    string inputTableName = sql.GetInputDataTableName(guiTestId.ToString(CultureInfo.InvariantCulture),
                                                                      returnTestNameIfNotExists: true);
                    inputTableValue = sql.InputDataValue(inputTableName, inputDataRow, inputDataColumn);

                    inputTableValueDescription = " with DataInput=" + inputTableValue + "in DataRow=" + inputDataRow;
                    if (inputTableValue.IndexOf(Constants.RegularExpressionOutput, 0, StringComparison.Ordinal) >= 0)
                    {
                        inputTableValue = sl.GetLastCreatrdValue(inputDataColumn);
                    }
                }


                if (inputTableValue.IndexOf(Constants.RegularExpressionRandom, 0, StringComparison.Ordinal) >= 0)
                {
                    string rnd = Guid.NewGuid().ToString().Substring(2, 13);
                    inputTableValue = inputTableValue.Replace(Constants.RegularExpressionRandom, rnd);
                }


                result = sl.ExecuteOneStep(dr, inputDataColumn, inputTableValue, driver);

                adapterTest.GetTestName(guiTestId);
                if (guiMapId != 0)
                {
                    guimapName = adapterGuimap.GetGuiMapName(guiMapId).Trim();
                }
                if (guiMapCommandId != 0)
                {
                    guiMapCommandName = adapterCommand.GetTestCommandName(guiMapCommandId).Trim();
                }
                string description;
                int    status;
                string ss = string.Empty;

                if (result)
                {
                    description = string.Format("{0}={1}", Constants.LogStepStatus, "Passed");
                    status      = Constants.Passed;
                }
                //LogResult(_runExecutionId, _batchId, _flowId, guiTestId, guiMapId,"Step Passed: " + guiMapCommandName + " => " + guimapName + inputTableValueDescription,Constants.Passed, "0", _projectId, _projectPageId);
                else
                {
                    //ss = sl.ScreenShot(driver, Directory.GetCurrentDirectory() + "\\Logs");
                    ss = sl.ScreenShot(driver, "\\\\" + Environment.MachineName + "\\Logs");
                    string     pagesource = sl.SourcePage(driver);
                    TextParser tp         = new TextParser();
                    //get iis server
                    string iisServer = tp.GetIis(pagesource);
                    description = string.Format("{0}={1}\t{2}={3}\t{4}={5}\t{6}", Constants.LogStepStatus, "Failed",
                                                "SnapShot", ss, "IISServer", iisServer, sl.LastFailureMessage);
                    status = Constants.Failed;

                    //LogResult(_runExecutionId, _batchId, _flowId, guiTestId, guiMapId,"Step Failed: " + guiMapCommandName + " => " + guimapName + inputTableValueDescription +"\n" + sl.LastFailureMessage + "\n" + ss, Constants.Failed, "0", _projectId,_projectPageId);
                }
                LogResult(_runExecutionId, _batchId, _flowId, guiTestId, guiMapId, guiMapCommandName + " " + description + inputTableValueDescription, status, "0", _projectId, _projectPageId);
            }

            catch (Exception exception)
            {
                Logger.Error(exception.Message, exception);
                result = false;
            }


            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Unitest will cal this one
        /// </summary>
        /// <param name="batchId"></param>
        /// <returns></returns>
        public bool ExecuteOneBatch(string batchId)
        {
            try
            {
                var    jp     = new JsonParser();
                string remote = jp.ReadJson("RemoteNode");
                int    timeoutAllScenarios = Convert.ToInt32(jp.ReadJson("TimeoutAllScenarios")) * 1000;
                var    sel = new Selenium();
                if (batchId == string.Empty)
                {
                    MessageBox.Show("Select Batch first", "Applenium");
                    return(false);
                }
                var sql = new Sql();
                _batchId = Convert.ToInt32(batchId);
                DataTable dtScenario = sql.GetDataTable(Constants.StrBatchScenariosToSelenium,
                                                        _batchId.ToString(CultureInfo.InvariantCulture));
                //SetAllScenariusStatusToRunorNot(dtScenario, Constants.Pending);
                var    adapterBatches    = new BatchesTableAdapter();
                var    adapterBatchLogic = new BatchLogicTableAdapter();
                var    adapterBrowser    = new BrowsersTableAdapter();
                string batchname         = adapterBatches.GetBatchName(_batchId);
                var    adapterScenario   = new ScenarioTableAdapter();

                _projectId = Convert.ToInt32(adapterBatches.GetProjectID(Convert.ToInt32(_batchId)));

                LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, Constants.LogBatchStatus + "=Started",
                          Constants.Done,
                          "0", _projectId, 0);

                Singleton myInstance = Singleton.Instance;
                myInstance.BatchResult = true;
                var threadFinishEvents = new List <EventWaitHandle>();
                foreach (DataRow row in dtScenario.Rows)
                {
                    if (myInstance.StopExecution)
                    {
                        myInstance.BatchResult = false;
                        break;
                    }
                    var threadFinish = new EventWaitHandle(false, EventResetMode.ManualReset);

                    string browserId       = row["BrowserID"].ToString();
                    string batchLogicId    = row["BatchLogicID"].ToString();
                    int    executionStatus = Convert.ToInt32(row["ExecutionStatusID"].ToString());

                    if (executionStatus == 1) //run only selected scenarios
                    {
                        threadFinishEvents.Add(threadFinish);
                        string browserName = adapterBrowser.GetBrowserName(Convert.ToInt32(browserId));



                        ThreadStart ts = delegate
                        {
                            //wait till hub return available browser

                            RemoteWebDriver driver  = null;
                            int             elapsed = 0;
                            while ((driver == null) && (elapsed < timeoutAllScenarios))
                            {
                                //generate random number 30-60
                                Random r    = new Random();
                                int    rInt = r.Next(30000, 60000);  //for ints

                                Thread.Sleep(rInt);
                                driver   = sel.SetWebDriverBrowser(null, browserId, false);
                                elapsed += rInt;
                            }


                            string scenarioId = row["ScenarioID"].ToString();

                            // adapterBatchLogic.Update(_batchId, Convert.ToInt32(scenarioId), Convert.ToInt32(browserId),Constants.Running, Convert.ToInt32(batchLogicId));

                            string scenarioname = adapterScenario.GetScenarioName(Convert.ToInt32(scenarioId));
                            if (guiInstance != null && isBatchRun == true)
                            {
                                guiInstance.UpdateProgressLabel(scenarioname);
                            }
                            LogResult(_runExecutionId, Convert.ToInt32(_batchId), Convert.ToInt32(scenarioId), 0, 0,
                                      scenarioname + " ScenarioBrowser=" + browserName,
                                      Constants.Done,
                                      "0", _projectId, _projectPageId);

                            // Do long work here
                            bool scanearioresult = ExecuteOneScenario(scenarioId, driver);

                            Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, (EventHandler)
                                                                delegate
                            {
                                if (scanearioresult == false)
                                {
                                    myInstance.BatchResult = false;
                                    //adapterBatchLogic.Update(_batchId,Convert.ToInt32(scenarioId),Convert.ToInt32(browserId),Constants.Failed,Convert.ToInt32(batchLogicId));
                                }


                                driver.Quit();
                                threadFinish.Set();
                            }, null, null);
                        };

                        ts.BeginInvoke(delegate(IAsyncResult aysncResult) { ts.EndInvoke(aysncResult); }, null);
                        if (remote == "no")
                        {
                            WaitHandle.WaitAll(threadFinishEvents.ToArray(), Convert.ToInt32(timeoutAllScenarios));
                        }
                    }
                }

                WaitHandle.WaitAll(threadFinishEvents.ToArray(), Convert.ToInt32(timeoutAllScenarios));
                string description;
                int    status;

                if (myInstance.BatchResult)
                {
                    description = string.Format("{0}={1}", Constants.LogBatchName, "Passed");
                    status      = Constants.Passed;
                    //LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, batchname + " Batch Passed",Constants.Passed, "0", _projectId, 0);
                }

                else
                {
                    //LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, batchname + " Batch Failed",Constants.Failed, "0", _projectId, 0);
                    description = string.Format("{0}={1}", Constants.LogBatchStatus, "Failed");
                    status      = Constants.Failed;
                }
                LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, description, status, "0", _projectId, 0);

                //SetAllScenariusStatusToRunorNot(dtScenario, Constants.NotRunnig);
                return(myInstance.BatchResult);
            }
            catch (Exception exception)
            {
                Logger.Error(exception.Message, exception);
                return(false);
            }
        }
Ejemplo n.º 3
0
        private bool ExecuteStep(DataRow dr, IWebDriver driver)
        {
            string guimapName        = string.Empty;
            string guiMapCommandName = string.Empty;
            bool   result;
            int    guiTestId       = Convert.ToInt32(dr["GuiTestID"].ToString().Trim());
            string inputTableValue = string.Empty;
            int    guiMapId        = Convert.ToInt32(dr["GuiMapID"].ToString().Trim());
            int    guiMapCommandId = Convert.ToInt32(dr["GuiMapCommandID"].ToString().Trim());

            try
            {
                var sql            = new Sql();
                var sl             = new Selenium();
                var adapterGuimap  = new GuiMapTableAdapter();
                var adapterTest    = new TestTableAdapter();
                var adapterCommand = new TestCommandTableAdapter();
                //var adapter_test_failurelog = new DataSetAutoTestTableAdapters.TestFailiureLogTableAdapter();
                string inputDataColumn   = string.Empty;
                var    adapterGuiproject = new GuiProjectPageTableAdapter();

                _projectPageId = Convert.ToInt32(adapterTest.GetProjectPageID(Convert.ToInt32(guiTestId)));
                _projectId     = Convert.ToInt32(adapterGuiproject.GetProjectID(_projectPageId));
                string inputTableValueDescription = string.Empty;
                if ((dr["InputDataRow"].ToString().Trim() != string.Empty) &&
                    (dr["InputDataRow"].ToString().IndexOf('-') < 0) && (dr["InputDataRow"].ToString().IndexOf(',') < 0))
                {
                    string inputDataRow = dr["InputDataRow"].ToString().Trim();
                    inputDataColumn = dr["InputDataColumn"].ToString().Trim();
                    string inputTableName = sql.GetInputDataTableName(guiTestId.ToString(CultureInfo.InvariantCulture),
                                                                      returnTestNameIfNotExists: true);
                    inputTableValue = sql.InputDataValue(inputTableName, inputDataRow, inputDataColumn);

                    inputTableValueDescription = " with data input: " + inputTableValue + "in row : " + inputDataRow;
                    if (inputTableValue.IndexOf(Constants.RegularExpressionOutput, 0, StringComparison.Ordinal) >= 0)
                    {
                        inputTableValue = sl.GetLastCreatrdValue(inputDataColumn);
                    }
                }


                if (inputTableValue.IndexOf(Constants.RegularExpressionRandom, 0, StringComparison.Ordinal) >= 0)
                {
                    string rnd = Guid.NewGuid().ToString().Substring(2, 16);
                    inputTableValue = inputTableValue.Replace(Constants.RegularExpressionRandom, rnd);
                }


                result = sl.ExecuteOneStep(dr, inputDataColumn, inputTableValue, driver);

                adapterTest.GetTestName(guiTestId);
                if (guiMapId != 0)
                {
                    guimapName = adapterGuimap.GetGuiMapName(guiMapId).Trim();
                }
                if (guiMapCommandId != 0)
                {
                    guiMapCommandName = adapterCommand.GetTestCommandName(guiMapCommandId).Trim();
                }


                if (result)
                {
                    LogResult(_runExecutionId, _batchId, _flowId, guiTestId, guiMapId,
                              "Step Passed: " + guiMapCommandName + " => " + guimapName + inputTableValueDescription,
                              Constants.Passed, "0", _projectId, _projectPageId);
                }
                else
                {
                    string ss = sl.ScreenShot(driver, Directory.GetCurrentDirectory() + "\\Logs");
                    LogResult(_runExecutionId, _batchId, _flowId, guiTestId, guiMapId,
                              "Step Failed: " + guiMapCommandName + " => " + guimapName + inputTableValueDescription +
                              "\n" + sl.LastFailureMessage + "\n" + ss, Constants.Failed, "0", _projectId,
                              _projectPageId);
                }
            }

            catch (Exception exception)
            {
                Logger.Error(exception.Message, exception);
                result = false;
            }


            return(result);
        }
Ejemplo n.º 4
0
        internal List <OpenBookPositionData> GetOpenBookPositionData(RemoteWebDriver driver, int tableRowweguiMapId)
        {
            try
            {
                var          sl                       = new Selenium();
                TestFlowInfo tfi                      = new TestFlowInfo(true, "OpenBookValidator");
                var          dataAccess               = new DataAccessor(true, ref tfi);
                var          guimapadapter            = new GuiMapTableAdapter();
                string       userNameElementValue     = guimapadapter.GetTagTypeValue(Constants.ObOpenTradesUserName);
                string       userName                 = driver.FindElement((By)sl.GetWebElement(1, userNameElementValue, string.Empty)).Text;
                string       userTableRowElementValue = guimapadapter.GetTagTypeValue(tableRowweguiMapId);
                ReadOnlyCollection <IWebElement> rows =
                    driver.FindElements((By)sl.GetWebElement(1, userTableRowElementValue, string.Empty));
                var openbookpositiondata = new List <OpenBookPositionData>();
                foreach (IWebElement row in rows)
                {
                    StockStatus?stockStatus = StockStatus.Position;
                    string      parentUserNameElementValue =
                        guimapadapter.GetTagTypeValue(Constants.ObOpenTardesParentNameGuiMapId);
                    string parentUserName =
                        row.FindElement((By)sl.GetWebElement(1, parentUserNameElementValue, string.Empty)).Text;
                    string initRateStringElementValue =
                        guimapadapter.GetTagTypeValue(Constants.ObOpenTardesInitRateStringGuimapid);
                    string initRateString =
                        row.FindElement((By)sl.GetWebElement(1, initRateStringElementValue, string.Empty)).Text;
                    decimal initRate;

                    if (initRateString != string.Empty)
                    {
                        String trimmedRate = sl.GetCleanRate(initRateString);
                        initRate = Convert.ToDecimal(trimmedRate);
                    }
                    else
                    {
                        initRate = 0;
                    }
                    string instrumentDisplayNameElementValue =
                        guimapadapter.GetTagTypeValue(Constants.ObOpenTradedInstrumentDisplayName);
                    string instrumentDisplayName =
                        row.FindElement((By)sl.GetWebElement(1, instrumentDisplayNameElementValue, string.Empty))
                        .Text.Replace("/", "");
                    string isBuyStringElementValue = guimapadapter.GetTagTypeValue(Constants.ObOpenTradesIsBuyString);
                    string isBuyString             =
                        row.FindElement((By)sl.GetWebElement(1, isBuyStringElementValue, string.Empty)).Text;
                    bool isBuy;
                    if (String.Compare(isBuyString, "BUY", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        isBuy = true;
                    }
                    else
                    {
                        isBuy = false;
                    }
                    string isOverWeekendNameElementValue =
                        guimapadapter.GetTagTypeValue(Constants.ObOpenTradesIsOverWeekendNonStocks);
                    bool isOverWeekend = sl.CheckIfElementFind(row,
                                                               (By)sl.GetWebElement(1, isOverWeekendNameElementValue, string.Empty),
                                                               driver);
                    if (isOverWeekend == false)
                    {
                        //non stocks
                        isOverWeekendNameElementValue =
                            guimapadapter.GetTagTypeValue(Constants.ObOpenTradesIsOverWeekendStocks);
                        isOverWeekend = sl.CheckIfElementFind(row, (By)sl.GetWebElement(1, isOverWeekendNameElementValue, string.Empty), driver);
                    }

                    decimal limitRate;
                    string  limitRateElementValue = guimapadapter.GetTagTypeValue(Constants.ObOpenTradesLimitRate);
                    if (sl.CheckIfElementFind(row, (By)sl.GetWebElement(1, limitRateElementValue, string.Empty), driver))
                    {
                        string limitRateString =
                            row.FindElement((By)sl.GetWebElement(1, limitRateElementValue, string.Empty)).Text;
                        Char[] limitRatearr =
                            limitRateString.ToCharArray().Where(c => Char.IsDigit(c) || Char.IsPunctuation(c)).ToArray();
                        limitRate = Convert.ToDecimal(new string(limitRatearr));

                        stockStatus = new StockStatus(); //non stock
                    }
                    else
                    {
                        limitRate = 999999.9m;
                    }
                    decimal stopRate;
                    string  stopRateElementValue = guimapadapter.GetTagTypeValue(Constants.ObOpenTradeStopRate);
                    if (sl.CheckIfElementFind(row, (By)sl.GetWebElement(1, stopRateElementValue, string.Empty),
                                              driver))
                    {
                        string stopRateString =
                            row.FindElement((By)sl.GetWebElement(1, stopRateElementValue, string.Empty)).Text;
                        Char[] stopRatearr =
                            stopRateString.ToCharArray().Where(c => Char.IsDigit(c) || Char.IsPunctuation(c)).ToArray();
                        stopRate = Convert.ToDecimal(new string(stopRatearr));
                    }
                    else
                    {
                        stopRate = 0;
                    }


                    string instrumentElementValue = guimapadapter.GetTagTypeValue(Constants.ObOpenTradesInstrument);
                    int    positionId             =
                        Convert.ToInt32(
                            row.FindElement((By)sl.GetWebElement(1, instrumentElementValue, string.Empty))
                            .GetAttribute("positionid"));

                    string infoRowPendingElementValue =
                        guimapadapter.GetTagTypeValue(Constants.ObOpenTaredsInfoRowPending);
                    bool isInfoRowPending = sl.CheckIfElementFind(row,
                                                                  (By)
                                                                  sl.GetWebElement(1, infoRowPendingElementValue, string.Empty),
                                                                  driver);
                    if (isInfoRowPending)
                    {
                        stockStatus = StockStatus.Order;
                    }

                    try
                    {
                        openbookpositiondata.Add(new OpenBookPositionData(userName, parentUserName, initRate, instrumentDisplayName, isBuy, isOverWeekend, limitRate, stopRate, positionId, stockStatus));
                    }
                    catch (Exception e)
                    {
                        Logger.Error("Can't Add + " + instrumentDisplayName + " to openbook position data" + e.Message);
                    }
                }
                return(openbookpositiondata);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Unitest will cal this one
        /// </summary>
        /// <param name="batchId"></param>
        /// <returns></returns>
        public bool ExecuteOneBatch(string batchId)
        {
            var    jp     = new JsonParser();
            string remote = jp.ReadJson("RemoteNode");
            int    timeoutAllScenarios = Convert.ToInt32(jp.ReadJson("TimeoutAllScenarios")) * 1000;
            var    sel = new Selenium();

            if (batchId == string.Empty)
            {
                MessageBox.Show("Select Batch first", "Applenium");
                return(false);
            }
            var sql = new Sql();

            _batchId = Convert.ToInt32(batchId);
            DataTable dtScenario = sql.GetDataTable(Constants.StrBatchScenariosToSelenium,
                                                    _batchId.ToString(CultureInfo.InvariantCulture));

            SetAllScenariusStatusToRunorNot(dtScenario, Constants.Pending);
            var    adapterBatches    = new BatchesTableAdapter();
            var    adapterBatchLogic = new BatchLogicTableAdapter();
            var    adapterBrowser    = new BrowsersTableAdapter();
            string batchname         = adapterBatches.GetBatchName(_batchId);
            var    adapterScenario   = new ScenarioTableAdapter();

            _projectId = Convert.ToInt32(adapterBatches.GetProjectID(Convert.ToInt32(_batchId)));

            LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, batchname + " Batch Started", Constants.Done,
                      "0", _projectId, 0);

            Singleton myInstance = Singleton.Instance;

            myInstance.BatchResult = true;
            var threadFinishEvents = new List <EventWaitHandle>();

            foreach (DataRow row in dtScenario.Rows)
            {
                if (myInstance.StopExecution)
                {
                    myInstance.BatchResult = false;
                    break;
                }
                var threadFinish = new EventWaitHandle(false, EventResetMode.ManualReset);
                threadFinishEvents.Add(threadFinish);
                string browserId    = row["BrowserID"].ToString();
                string batchLogicId = row["BatchLogicID"].ToString();


                string      browserName = adapterBrowser.GetBrowserName(Convert.ToInt32(browserId));
                IWebDriver  driver      = null;
                ThreadStart ts          = delegate
                {
                    driver = sel.SetWebDriverBrowser(driver, browserId, false);
                    if (driver == null)
                    {
                        return;
                    }


                    string scenarioId = row["ScenarioID"].ToString();

                    adapterBatchLogic.Update(_batchId, Convert.ToInt32(scenarioId), Convert.ToInt32(browserId), Constants.Running, Convert.ToInt32(batchLogicId));

                    string scenarioname = adapterScenario.GetScenarioName(Convert.ToInt32(scenarioId));
                    LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0,
                              scenarioname + " Scenario will run on " + browserName + " browser.", Constants.Done,
                              "0", _projectId, 0);


                    // Do long work here
                    bool scanearioresult = ExecuteOneScenario(scenarioId, driver);
                    Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, (EventHandler)
                                                        delegate
                    {
                        if (scanearioresult == false)
                        {
                            myInstance.BatchResult = false;
                            adapterBatchLogic.Update(_batchId, Convert.ToInt32(scenarioId),
                                                     Convert.ToInt32(browserId), Constants.Failed,
                                                     Convert.ToInt32(batchLogicId));
                        }
                        else
                        {
                            adapterBatchLogic.Update(_batchId, Convert.ToInt32(scenarioId), Convert.ToInt32(browserId), Constants.Passed, Convert.ToInt32(batchLogicId));
                        }
                        driver.Quit();
                        threadFinish.Set();
                    }, null, null);
                };

                ts.BeginInvoke(delegate(IAsyncResult aysncResult) { ts.EndInvoke(aysncResult); }, null);
                if (remote == "no")
                {
                    WaitHandle.WaitAll(threadFinishEvents.ToArray(), Convert.ToInt32(timeoutAllScenarios));
                }
            }

            WaitHandle.WaitAll(threadFinishEvents.ToArray(), Convert.ToInt32(timeoutAllScenarios));
            if (myInstance.BatchResult)
            {
                LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, batchname + " Batch Passed",
                          Constants.Passed, "0", _projectId, 0);
            }
            else
            {
                LogResult(_runExecutionId, Convert.ToInt32(_batchId), 0, 0, 0, batchname + " Batch Failed",
                          Constants.Failed, "0", _projectId, 0);
                //LogFailiure(_runExecutionID, 0, null, 0, null, "Description in the scenario");
            }

            SetAllScenariusStatusToRunorNot(dtScenario, Constants.NotRunnig);
            return(myInstance.BatchResult);
        }