/*This is a default execution of action, some actions may perform differently, like a complex action.
         * We should choose to override execute routine if possible to enable action test */
        public void ExecuteAction(bool reportLabel)
        {
            /* This is moved from constructor: We should launch browser when required only,
             * keep this inside constructor will make unable to access other function that doesnot require browser*/
            //  if (!Modules.BrowserSupport.BrowserIsOpenned() || !Modules.BrowserSupport._ProfileName.Equals(_user.ChromeProfile))
            if (!Modules.BrowserSupport.BrowserIsOpenned())
            {
                //  Modules.BrowserSupport.OpenBrowser(_user.ChromeProfile);
                Modules.BrowserSupport.OpenBrowser(null);
            }
            //The convert node happen repeated and don't need to be reported
            if (_wk != null && _ReportActionName)
            {
                _wk.ReportProgress(0, "Execute action " + _ActionData.ActionName);
            }
            try
            {
                //we handle errors here so to cover all overload method of innerexecuteaction
                InnerExecuteAction(reportLabel);
            }
            catch (MyExceptions.MyMyExceptions)
            {
                throw;
            }
            catch (OpenQA.Selenium.NoSuchElementException)
            {
                throw;
            }
            catch (Exception ex)
            {
                //we should make the error short for easy reading
                if (objLastError == null)
                {
                    objLastError            = new ErrorObject();
                    objLastError.ActionName = _ActionData.ActionName;
                }
                string message = "Error on action: " + _ActionData.ActionName + Environment.NewLine;
                if (objLastError.Label == null)
                {
                    message += "Label Null" + Environment.NewLine;
                }
                else
                {
                    message += "Label: " + objLastError.Label.LabelName + Environment.NewLine;
                }
                message += "Error Type: " + ex.GetType() + Environment.NewLine;
                message += "Detail message: " + ex.ToString();
                _wk.ReportProgress(0, ex.ToString());
                //  FrmLabelNavigator nav = new FrmLabelNavigator(this, objLastError.Label, message);
                //   DialogResult dresult = nav.ShowDialog();
                DialogResult dresult = DialogResult.Yes;

                /* We supposed to execute manually in LabelNavigator, if success
                 * then we just continue everything, if not then break */
                if (dresult != DialogResult.Yes)
                {
                    //if the error is handle we don't need to add it to error collection
                    bool isRepeated = Global.CheckIfErrorRepeatedInAPeriod(objLastError, TimeSpan.FromMinutes(60));
                    Global.AddError(objLastError);
                    if (dresult == DialogResult.Abort)
                    {
                        throw new MyExceptions.ActionCanceledException("Action canceled by user");
                    }
                    else if (dresult == DialogResult.Ignore)//this case happens on auto close after some minutes
                    {
                        if (isRepeated)
                        {
                            if (ex is MyExceptions.LabelException)
                            {
                                throw new MyExceptions.LabelException(message);
                            }
                            else
                            {
                                //The exception is likely come from overload version of ExecuteRoutine
                                throw new MyExceptions.MyMyExceptions(message);
                            }
                        }
                    }
                }
            }
        }