Example #1
0
        private void ElementRecordedHandler(ElementActionCongifuration args)
        {
            try
            {
                Act         actUI;
                ElementInfo einfo = null;
                if (args.LearnedElementInfo != null)
                {
                    einfo = (ElementInfo)args.LearnedElementInfo;
                    args.AddPOMToAction = CreatePOM;
                    args.POMGuid        = CurrentPOM.Guid.ToString();
                    args.ElementGuid    = einfo.Guid.ToString();

                    actUI = PlatformInfo.GetPlatformAction(einfo, args);
                }
                else
                {
                    actUI = PlatformInfo.GetPlatformAction(null, args);
                }
                if (actUI != null)
                {
                    if (CurrentPOM != null && einfo != null)
                    {
                        CurrentPOM.MappedUIElements.Add(einfo);
                    }
                    BusinessFlow.AddAct(actUI);
                }
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, "Error in Element recording event handler while recording", ex);
            }
        }
Example #2
0
        /// <summary>
        /// Just provide the ElementInfo Object and would generate supported Action for the same according to the current selected Platform
        /// </summary>
        /// <param name="elementInfo"></param>
        /// <param name="mContext"></param>
        /// <returns></returns>
        static Act GeneratePOMElementRelatedAction(ElementInfo elementInfo, Context mContext)
        {
            Act           instance;
            IPlatformInfo mPlatform  = PlatformInfoBase.GetPlatformImpl(mContext.Platform);
            string        elementVal = string.Empty;

            if (elementInfo.OptionalValuesObjectsList.Count > 0)
            {
                elementVal = Convert.ToString(elementInfo.OptionalValuesObjectsList.Where(v => v.IsDefault).FirstOrDefault().Value);
            }

            ElementActionCongifuration actionConfigurations = new ElementActionCongifuration
            {
                LocateBy           = eLocateBy.POMElement,
                LocateValue        = elementInfo.ParentGuid.ToString() + "_" + elementInfo.Guid.ToString(),
                ElementValue       = elementVal,
                AddPOMToAction     = true,
                POMGuid            = elementInfo.ParentGuid.ToString(),
                ElementGuid        = elementInfo.Guid.ToString(),
                LearnedElementInfo = elementInfo,
            };

            instance = mPlatform.GetPlatformAction(elementInfo, actionConfigurations);
            return(instance);
        }
        private void AddBrowserAction(string pageTitle, string pageURL)
        {
            try
            {
                ElementActionCongifuration actConfig = new ElementActionCongifuration()
                {
                    Description  = "Go to Url - " + pageTitle,
                    Operation    = "GotoURL",
                    ElementValue = pageURL,
                    LocateBy     = "NA"
                };

                ElementInfo einfo = new ElementInfo();
                einfo.ElementTypeEnum = eElementType.Iframe;
                Act actUI = PlatformInfo.GetPlatformAction(einfo, actConfig);
                if (actUI != null)
                {
                    AddActionToBusinessFlow(actUI, null);
                }
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, "Error while adding browser action", ex);
            }
        }
        private void PlatformDriver_RecordingEvent(object sender, RecordingEventArgs args)
        {
            try
            {
                switch (args.EventType)
                {
                case eRecordingEvent.ElementRecorded:
                    ElementActionCongifuration elementAction = (ElementActionCongifuration)args.EventArgs;
                    ElementRecordedHandler(elementAction);
                    break;

                case eRecordingEvent.PageChanged:
                    PageChangedEventArgs pageChanged = (PageChangedEventArgs)args.EventArgs;
                    PlatformDriverPageChangedHandler(pageChanged);
                    break;

                case eRecordingEvent.StopRecording:
                    RecordingNotificationEvent?.Invoke(this, args);
                    break;
                }
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, "Error in Element recording event handler while recording", ex);
            }
        }
Example #5
0
        public string SetElementOperation(eElementType ElementTypeEnum, ElementActionCongifuration actConfig)
        {
            switch (ElementTypeEnum)
            {
            case eElementType.Button:
            case eElementType.CheckBox:
            case eElementType.RadioButton:
            case eElementType.HyperLink:
            case eElementType.Span:
            case eElementType.Div:
                //actConfig.Operation = ActUIElement.eElementAction.Click.ToString();
                return(ActUIElement.eElementAction.Click.ToString());

            case eElementType.TextBox:
                //actConfig.Operation = ActUIElement.eElementAction.SetText.ToString();
                return(ActUIElement.eElementAction.SetText.ToString());

            case eElementType.Iframe:
                //actConfig.Operation = ActUIElement.eElementAction.SetText.ToString();
                return(ActBrowserElement.eControlAction.SwitchFrame.ToString());

            case eElementType.ComboBox:
                return(ActUIElement.eElementAction.SelectByText.ToString());

            default:
                //actConfig.Operation = ActUIElement.eElementAction.NotExist.ToString();
                return(ActUIElement.eElementAction.NotExist.ToString());
            }
        }
        public void SetPOMProperties(Act elementAction, ElementInfo elementInfo, ElementActionCongifuration actConfig)
        {
            if (actConfig.AddPOMToAction)
            {
                elementAction.Description = actConfig.Operation + " - " + elementInfo.ElementName;
                PropertyInfo pLocateBy = elementAction.GetType().GetProperty(nameof(ActUIElement.ElementLocateBy));
                if (pLocateBy != null)
                {
                    if (pLocateBy.PropertyType.IsEnum)
                    {
                        pLocateBy.SetValue(elementAction, Enum.Parse(pLocateBy.PropertyType, nameof(eLocateBy.POMElement)));
                    }
                }

                PropertyInfo pLocateVal = elementAction.GetType().GetProperty(nameof(ActUIElement.ElementLocateValue));
                if (pLocateVal != null)
                {
                    pLocateVal.SetValue(elementAction, string.Format("{0}_{1}", actConfig.POMGuid, actConfig.ElementGuid));
                }

                PropertyInfo pElementType = elementAction.GetType().GetProperty(nameof(ActUIElement.ElementType));
                if (pElementType != null && pElementType.PropertyType.IsEnum)
                {
                    pElementType.SetValue(elementAction, ((ElementInfo)actConfig.LearnedElementInfo).ElementTypeEnum);
                }
            }
        }
Example #7
0
        public override Act GetPlatformActionByElementInfo(ElementInfo elementInfo, ElementActionCongifuration actConfig)
        {
            var pomExcutionUtil = new POMExecutionUtils();
            Act elementAction   = null;

            if (elementInfo != null)
            {
                ElementTypeData elementTypeOperations = GetPlatformElementTypesData().Where(x => x.ElementType == elementInfo.ElementTypeEnum).FirstOrDefault();
                if (actConfig != null)
                {
                    if (string.IsNullOrWhiteSpace(actConfig.Operation))
                    {
                        actConfig.Operation = GetDefaultElementOperation(elementInfo.ElementTypeEnum);
                    }
                }
                if ((elementTypeOperations != null) && ((elementTypeOperations.ElementOperationsList != null)) && (elementTypeOperations.ElementOperationsList.Count > 0))
                {
                    if (elementTypeOperations.ActionType == typeof(ActBrowserElement))
                    {
                        elementAction = new ActBrowserElement()
                        {
                            Description   = string.IsNullOrWhiteSpace(actConfig.Description) ? "Browser Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                            ControlAction = (ActBrowserElement.eControlAction)System.Enum.Parse(typeof(ActBrowserElement.eControlAction), actConfig.Operation),
                            LocateBy      = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                            Value         = actConfig.ElementValue,
                            LocateValue   = actConfig.LocateValue
                        };
                    }
                    else if (elementTypeOperations.ActionType == typeof(ActUIElement))
                    {
                        elementAction = new ActUIElement()
                        {
                            Description   = string.IsNullOrWhiteSpace(actConfig.Description) ? "UI Element Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                            ElementAction = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), actConfig.Operation),
                            //LocateBy = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                            ElementLocateBy    = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                            ElementLocateValue = actConfig.LocateValue,
                            //LocateValue = actConfig.LocateValue,
                            ElementType = (eElementType)System.Enum.Parse(typeof(eElementType), Convert.ToString(actConfig.Type)),
                            Value       = actConfig.ElementValue
                        };

                        pomExcutionUtil.SetPOMProperties(elementAction, elementInfo, actConfig);
                    }
                }
            }
            else
            {
                elementAction = new ActUIElement()
                {
                    Description        = string.IsNullOrWhiteSpace(actConfig.Description) ? "UI Element Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                    ElementLocateBy    = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                    ElementAction      = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), actConfig.Operation),
                    ElementLocateValue = actConfig.LocateValue,
                    ElementType        = (eElementType)System.Enum.Parse(typeof(eElementType), Convert.ToString(actConfig.Type)),
                    Value = actConfig.ElementValue
                };
            }
            return(elementAction);
        }
        public Act GetPlatformAction(ElementInfo eInfo, ElementActionCongifuration actConfig)
        {
            TestAction elementAction = null;

            if (actConfig.LearnedElementInfo == null)
            {
                elementAction = new TestAction()
                {
                    Description        = actConfig.Description,
                    ElementLocateBy    = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                    ElementAction      = actConfig.Operation,
                    ElementLocateValue = actConfig.LocateValue,
                    ElementType        = Convert.ToString(actConfig.Type),
                    Value = actConfig.ElementValue
                };
            }
            else
            {
                elementAction = new TestAction()
                {
                    Description        = actConfig.Description,
                    ElementLocateBy    = eLocateBy.POMElement,
                    ElementAction      = actConfig.Operation,
                    ElementLocateValue = actConfig.LocateValue,
                    ElementType        = Convert.ToString(actConfig.Type),
                    Value = actConfig.ElementValue
                };
            }

            return(elementAction);
        }
Example #9
0
        private void DoRecording()
        {
            string name = "Name_" + Convert.ToString(i);

            ElementInfo eInfo = new ElementInfo();

            eInfo.ElementName = name;

            ElementActionCongifuration eleArgs = new ElementActionCongifuration();

            if (i == 1 || i == 3)
            {
                eleArgs.LocateBy      = eLocateBy.ByName.ToString();
                eleArgs.LocateValue   = name;
                eleArgs.ElementValue  = "aaa";
                eleArgs.Operation     = "SetText";
                eleArgs.Type          = "TextBox";
                eleArgs.Description   = "input Text " + name;
                eInfo.ElementTypeEnum = eElementType.TextBox;
            }
            else
            {
                eleArgs.LocateBy      = eLocateBy.ByID.ToString();
                eleArgs.LocateValue   = name;
                eleArgs.ElementValue  = "cc";
                eleArgs.Operation     = "Click";
                eleArgs.Type          = "Button";
                eleArgs.Description   = "input button " + name;
                eInfo.ElementTypeEnum = eElementType.Button;
            }

            if (LearnAdditionalDetails)
            {
                eleArgs.LearnedElementInfo = eInfo;
            }

            PageChangedEventArgs pageArgs = new PageChangedEventArgs();

            if (i != 2)
            {
                pageArgs.PageURL   = "www.google.com";
                pageArgs.PageTitle = "Google";
            }
            else
            {
                pageArgs.PageURL   = "www.new.com";
                pageArgs.PageTitle = "New";
            }

            OnRecordingEvent(new RecordingEventArgs()
            {
                EventType = eRecordingEvent.PageChanged, EventArgs = pageArgs
            });
            OnRecordingEvent(new RecordingEventArgs()
            {
                EventType = eRecordingEvent.PageChanged, EventArgs = eleArgs
            });
            i++;
        }
Example #10
0
        public override Act GetPlatformActionByElementInfo(ElementInfo elementInfo, ElementActionCongifuration actConfig)
        {
            var pomExcutionUtil = new POMExecutionUtils();
            Act elementAction   = null;

            if (elementInfo != null)
            {
                List <ActUIElement.eElementAction> elementTypeOperations = GetPlatformUIElementActionsList(elementInfo.ElementTypeEnum);
                if (actConfig != null)
                {
                    if (string.IsNullOrWhiteSpace(actConfig.Operation))
                    {
                        actConfig.Operation = GetDefaultElementOperation(elementInfo.ElementTypeEnum);
                    }
                }
                if ((elementTypeOperations != null) && (elementTypeOperations.Count > 0))
                {
                    elementAction = new ActUIElement()
                    {
                        Description        = string.IsNullOrWhiteSpace(actConfig.Description) ? "UI Element Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                        ElementAction      = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), actConfig.Operation),
                        ElementLocateValue = actConfig.LocateValue,
                        Value = actConfig.ElementValue
                    };

                    if (elementInfo.ElementTypeEnum.Equals(eElementType.Table))
                    {
                        elementAction.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnValue, actConfig.WhereColumnValue);
                        elementAction.GetOrCreateInputParam(ActUIElement.Fields.LocateRowType, actConfig.LocateRowType);
                        elementAction.GetOrCreateInputParam(ActUIElement.Fields.LocateRowValue, actConfig.RowValue);
                        elementAction.GetOrCreateInputParam(ActUIElement.Fields.ColSelectorValue, actConfig.ColSelectorValue);
                        elementAction.GetOrCreateInputParam(ActUIElement.Fields.LocateColTitle, actConfig.LocateColTitle);
                        elementAction.GetOrCreateInputParam(ActUIElement.Fields.ControlAction, actConfig.ControlAction);
                    }

                    pomExcutionUtil.SetPOMProperties(elementAction, elementInfo, actConfig);
                }
            }
            else
            {
                elementAction = new ActUIElement()
                {
                    Description        = string.IsNullOrWhiteSpace(actConfig.Description) ? "UI Element Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                    ElementLocateBy    = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                    ElementAction      = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), actConfig.Operation),
                    ElementLocateValue = actConfig.LocateValue,
                    ElementType        = (eElementType)System.Enum.Parse(typeof(eElementType), Convert.ToString(actConfig.Type)),
                    Value = actConfig.ElementValue
                };
            }
            return(elementAction);
        }
        // when launching from Window explore we get also available actions to choose so user can add
        public ControlActionsPage_New(IWindowExplorer driver, ElementInfo ElementInfo, Context context, ElementActionCongifuration actionConfigurations, ITreeViewItem CurrentControlTreeViewItem)
        {
            InitializeComponent();

            mElementInfo          = ElementInfo;
            mWindowExplorerDriver = driver;
            mLocators             = mElementInfo.Locators; // mWindowExplorerDriver.GetElementLocators(mElementInfo);
            mContext = context;
            mCurrentControlTreeViewItem = CurrentControlTreeViewItem;
            mPlatform       = PlatformInfoBase.GetPlatformImpl(context.Platform);
            mDataPage       = mCurrentControlTreeViewItem.EditPage(mContext);
            mActInputValues = ((IWindowExplorerTreeItem)mCurrentControlTreeViewItem).GetItemSpecificActionInputValues();

            DefaultAction = (mPlatform as IPlatformInfo).GetPlatformAction(mElementInfo, actionConfigurations);

            IsLegacyPlatform = DefaultAction == null;

            ((GingerExecutionEngine)mContext.Runner).GingerRunner.PropertyChanged += Runner_PropertyChanged;
            SetPlatformBasedUIUpdates();

            //mAction.PropertyChanged -= Action_PropertyChanged;
            //mAction.PropertyChanged += Action_PropertyChanged;
        }
Example #12
0
 Act IPlatformInfo.GetPlatformAction(ElementInfo eInfo, ElementActionCongifuration actConfig)
 {
     return(GetPlatformActionByElementInfo(eInfo, actConfig));
 }
Example #13
0
 public virtual Act GetPlatformActionByElementInfo(ElementInfo elementInfo, ElementActionCongifuration actConfig)
 {
     return(null);
 }
Example #14
0
        public override Act GetPlatformActionByElementInfo(ElementInfo elementInfo, ElementActionCongifuration actConfig)
        {
            Act elementAction = null;

            if (elementInfo != null)
            {
                ElementTypeData elementTypeOperations = GetPlatformElementTypesData().Where(x => x.ElementType == elementInfo.ElementTypeEnum).FirstOrDefault();
                if (actConfig != null)
                {
                    if (string.IsNullOrWhiteSpace(actConfig.Operation))
                    {
                        actConfig.Operation = SetElementOperation(elementInfo.ElementTypeEnum, actConfig);
                    }
                }
                if ((elementTypeOperations != null) && ((elementTypeOperations.ElementOperationsList != null)) && (elementTypeOperations.ElementOperationsList.Count > 0))
                {
                    if (elementTypeOperations.ActionType == typeof(ActBrowserElement))
                    {
                        elementAction = new ActBrowserElement()
                        {
                            Description   = string.IsNullOrWhiteSpace(actConfig.Description) ? "Browser Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                            ControlAction = (ActBrowserElement.eControlAction)System.Enum.Parse(typeof(ActBrowserElement.eControlAction), actConfig.Operation),
                            LocateBy      = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                            Value         = actConfig.ElementValue,
                            LocateValue   = actConfig.LocateValue
                        };
                    }
                    else if (elementTypeOperations.ActionType == typeof(ActUIElement))
                    {
                        elementAction = new ActUIElement()
                        {
                            Description        = string.IsNullOrWhiteSpace(actConfig.Description) ? "UI Element Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                            ElementAction      = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), actConfig.Operation),
                            ElementLocateValue = actConfig.LocateValue,
                            Value = actConfig.ElementValue
                        };

                        if (actConfig.AddPOMToAction)
                        {
                            elementAction.Description = actConfig.Operation + " - " + elementInfo.ElementName;
                            PropertyInfo pLocateBy = elementAction.GetType().GetProperty(nameof(ActUIElement.ElementLocateBy));
                            if (pLocateBy != null)
                            {
                                if (pLocateBy.PropertyType.IsEnum)
                                {
                                    pLocateBy.SetValue(elementAction, Enum.Parse(pLocateBy.PropertyType, nameof(eLocateBy.POMElement)));
                                }
                            }

                            PropertyInfo pLocateVal = elementAction.GetType().GetProperty(nameof(ActUIElement.ElementLocateValue));
                            if (pLocateVal != null)
                            {
                                pLocateVal.SetValue(elementAction, string.Format("{0}_{1}", actConfig.POMGuid, actConfig.ElementGuid));
                            }

                            PropertyInfo pElementType = elementAction.GetType().GetProperty(nameof(ActUIElement.ElementType));
                            if (pElementType != null && pElementType.PropertyType.IsEnum)
                            {
                                pElementType.SetValue(elementAction, ((ElementInfo)actConfig.LearnedElementInfo).ElementTypeEnum);
                            }
                        }
                    }
                }
            }
            else
            {
                elementAction = new ActUIElement()
                {
                    Description        = string.IsNullOrWhiteSpace(actConfig.Description) ? "UI Element Action : " + actConfig.Operation + " - " + elementInfo.ItemName : actConfig.Description,
                    ElementLocateBy    = (eLocateBy)System.Enum.Parse(typeof(eLocateBy), Convert.ToString(actConfig.LocateBy)),
                    ElementAction      = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), actConfig.Operation),
                    ElementLocateValue = actConfig.LocateValue,
                    ElementType        = (eElementType)System.Enum.Parse(typeof(eElementType), Convert.ToString(actConfig.Type)),
                    Value = actConfig.ElementValue
                };
            }
            return(elementAction);
        }
Example #15
0
        void UpdateElementActionTab()
        {
            if (SelectedElement == null)
            {
                return;
            }

            if (LocatorChanged)
            {
                ElementLocator locator = xLocatorsGrid.CurrentItem as ElementLocator;
                if (locator != null && xActUIPageFrame.HasContent && (xActUIPageFrame.Content as ControlActionsPage_New).DefaultAction is ActUIElement)
                {
                    if (((xActUIPageFrame.Content as ControlActionsPage_New).DefaultAction as ActUIElement).ElementLocateBy != eLocateBy.POMElement)
                    {
                        ((xActUIPageFrame.Content as ControlActionsPage_New).DefaultAction as ActUIElement).ElementLocateBy    = locator.LocateBy;
                        ((xActUIPageFrame.Content as ControlActionsPage_New).DefaultAction as ActUIElement).ElementLocateValue = locator.LocateValue;
                    }
                }

                LocatorChanged = false;
            }

            if (!SelectedElementChanged)
            {
                return;
            }

            SetPOMBasedChecks();

            ControlActionsPage_New CAP = null;

            if (xActUIPageFrame.HasContent)
            {
                xActUIPageFrame.Content = null;
            }

            if (SelectedElement.Locators.CurrentItem == null && SelectedElement.Locators.Count > 0)
            {
                SelectedElement.Locators.CurrentItem = SelectedElement.Locators[0];
            }

            ElementLocator eiLocator = SelectedElement.Locators.CurrentItem as ElementLocator;

            string elementVal = string.Empty;

            if (SelectedElement.OptionalValuesObjectsList.Count > 0)
            {
                elementVal = Convert.ToString(SelectedElement.OptionalValuesObjectsList.Where(v => v.IsDefault).FirstOrDefault().Value);
            }

            ElementActionCongifuration actConfigurations;

            if (POMBasedAction)
            {
                //POMElement
                actConfigurations = new ElementActionCongifuration
                {
                    LocateBy           = eLocateBy.POMElement,
                    LocateValue        = POMElement.ParentGuid.ToString() + "_" + POMElement.Guid.ToString(),
                    ElementValue       = elementVal,
                    AddPOMToAction     = true,
                    POMGuid            = POMElement.ParentGuid.ToString(),
                    ElementGuid        = POMElement.Guid.ToString(),
                    LearnedElementInfo = POMElement,
                    Type = POMElement.ElementTypeEnum
                };
            }
            else
            {
                //check if we have POM in context if yes set the Locate by and value to the specific POM if not so set it to the first active Locator in the list of Locators
                actConfigurations = new ElementActionCongifuration
                {
                    LocateBy           = eiLocator.LocateBy,
                    LocateValue        = eiLocator.LocateValue,
                    Type               = SelectedElement.ElementTypeEnum,
                    ElementValue       = elementVal,
                    ElementGuid        = SelectedElement.Guid.ToString(),
                    LearnedElementInfo = SelectedElement
                };
            }

            CAP = new ControlActionsPage_New(WindowExplorerDriver, SelectedElement, Context, actConfigurations, mCurrentControlTreeViewItem);
            //}

            if (CAP == null)
            {
                xAddActionTab.Visibility         = Visibility.Collapsed;
                xActUIPageFrame.Visibility       = Visibility.Collapsed;
                xAddRunOperationPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                if (CAP.IsLegacyPlatform)
                {
                    xExecutionStatusIcon.Visibility = Visibility.Visible;
                    BindingHandler.ObjFieldBinding(xExecutionStatusIcon, UcItemExecutionStatus.StatusProperty, CAP.DefaultAction, nameof(Act.Status));
                }
                else
                {
                    xExecutionStatusIcon.Visibility = Visibility.Collapsed;
                }

                //xRunActBtn.Click += CAP.RunActionClicked;
                //xAddActBtn.Click += CAP.AddActionClicked;

                xActUIPageFrame.Content          = CAP;
                xAddActionTab.Visibility         = Visibility.Visible;
                xActUIPageFrame.Visibility       = Visibility.Visible;
                xAddRunOperationPanel.Visibility = Visibility.Visible;
            }

            SelectedElementChanged = false;
        }