public UIElementJavaPlatformPage(ActUIElement Action) { InitializeComponent(); mAction = Action; //if widgets then no need to show and bind WaitforIdle field if (Convert.ToBoolean(mAction.GetInputParamValue(ActUIElement.Fields.IsWidgetsElement))) { lblWaitforIdleComboBox.Visibility = System.Windows.Visibility.Collapsed; WaitforIdleComboBox.Visibility = System.Windows.Visibility.Collapsed; return; } if (mAction.ElementType.ToString() == eElementType.Table.ToString()) { if (mAction.GetInputParamValue(ActUIElement.Fields.ControlAction) == ActUIElement.eElementAction.Click.ToString()) { mAction.GetOrCreateInputParam(ActUIElement.Fields.WaitforIdle, ActUIElement.eWaitForIdle.Medium.ToString()); } } else { if (mAction.ElementAction.ToString() == ActUIElement.eElementAction.Click.ToString()) { mAction.GetOrCreateInputParam(ActUIElement.Fields.WaitforIdle, ActUIElement.eWaitForIdle.Medium.ToString()); } else { mAction.GetOrCreateInputParam(ActUIElement.Fields.WaitforIdle, ActUIElement.eWaitForIdle.None.ToString()); } } WaitforIdleComboBox.Init(mAction.GetOrCreateInputParam(ActUIElement.Fields.WaitforIdle), typeof(ActUIElement.eWaitForIdle)); }
public void TableActionFieldBinding() { RowSelectorPanelInit(); //TODO:Use binding for row locator type radio buttons //xLocateRowTypeRadioButtonGroup.Init(typeof(ActUIElement.eLocateRowTypeOptions), RowSelectorPanel, mAct.GetOrCreateInputParam(ActUIElement.Fields.LocateRowType)); WhereColumn.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereColSelector, mAct.GetInputParamValue(ActUIElement.Fields.WhereColSelector)), typeof(ActUIElement.eTableElementRunColSelectorValue), isVENeeded: false, UCselectionChange: WhereColumn_SelectionChanged); WhereColumnTitle.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnTitle, mAct.GetInputParamValue(ActUIElement.Fields.WhereColumnTitle)), isVENeeded: true, UCselectionChange: WhereColumnTitle_SelectionChanged, context: Context.GetAsContext(mAct.Context)); WhereProperty.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereProperty, mAct.GetInputParamValue(ActUIElement.Fields.WhereProperty)), typeof(ActUIElement.eTableElementRunColPropertyValue), isVENeeded: false, UCselectionChange: WhereProperty_SelectionChanged); WhereOperator.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereOperator, mAct.GetInputParamValue(ActUIElement.Fields.WhereOperator)), typeof(ActUIElement.eTableElementRunColOperator), isVENeeded: false, UCselectionChange: WhereOperator_SelectionChanged); WhereColumnValue.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnValue, mAct.GetInputParamValue(ActUIElement.Fields.WhereColumnValue))); RowSelectorValue.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.LocateRowValue), isVENeeded: true, UCselectionChange: RowSelectorValue_SelectionChanged, context: Context.GetAsContext(mAct.Context)); }
public UIElementJavaPlatformPage(ActUIElement Action) { InitializeComponent(); mAction = Action; if (mAction.ElementType.ToString() == eElementType.Table.ToString()) { if (mAction.GetInputParamValue(ActUIElement.Fields.ControlAction) == ActUIElement.eElementAction.Click.ToString()) { mAction.AddOrUpdateInputParamValue(ActUIElement.Fields.WaitforIdle, ActUIElement.eWaitForIdle.Medium.ToString()); } } else { if (mAction.ElementAction.ToString() == ActUIElement.eElementAction.Click.ToString()) { mAction.AddOrUpdateInputParamValue(ActUIElement.Fields.WaitforIdle, ActUIElement.eWaitForIdle.Medium.ToString()); } else { mAction.AddOrUpdateInputParamValue(ActUIElement.Fields.WaitforIdle, ActUIElement.eWaitForIdle.None.ToString()); } } WaitforIdleComboBox.Init(mAction.GetOrCreateInputParam(ActUIElement.Fields.WaitforIdle), typeof(ActUIElement.eWaitForIdle)); }
private void AddActionButton_Click(object sender, RoutedEventArgs e) { if (mActions.CurrentItem == null) { Reporter.ToUser(eUserMsgKeys.AskToSelectAction); return; } Act act = (Act)((Act)(mActions.CurrentItem)).CreateCopy(); act.Active = true; act.AddNewReturnParams = true; ElementLocator EL = (ElementLocator)mLocators.CurrentItem; if ((mActions.CurrentItem).GetType() == typeof(ActUIElement)) { ActUIElement aaa = (ActUIElement)mActions.CurrentItem; ActUIElement actUI = (ActUIElement)act; actUI.ElementLocateBy = EL.LocateBy; actUI.ElementLocateValue = EL.LocateValue; actUI.Value = ValueTextBox.Text; actUI.GetOrCreateInputParam(ActUIElement.Fields.ControlActionValue, ValueTextBox.Text); actUI.GetOrCreateInputParam(ActUIElement.Fields.ElementType, aaa.GetInputParamValue(ActUIElement.Fields.ElementType)); actUI.GetOrCreateInputParam(ActUIElement.Fields.ControlAction, aaa.GetInputParamValue(ActUIElement.Fields.ControlAction)); actUI.GetOrCreateInputParam(ActUIElement.Fields.ElementAction, aaa.GetInputParamValue(ActUIElement.Fields.ElementAction)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColSelector, aaa.GetInputParamValue(ActUIElement.Fields.WhereColSelector)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnTitle, aaa.GetInputParamValue(ActUIElement.Fields.WhereColumnTitle)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnValue, aaa.GetInputParamValue(ActUIElement.Fields.WhereColumnValue)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereOperator, aaa.GetInputParamValue(ActUIElement.Fields.WhereOperator)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereProperty, aaa.GetInputParamValue(ActUIElement.Fields.WhereProperty)); act = actUI; } else { act.LocateBy = EL.LocateBy; act.LocateValue = EL.LocateValue; act.Value = ValueTextBox.Text; } App.BusinessFlow.AddAct(act); int selectedActIndex = -1; ObservableList <Act> actsList = App.BusinessFlow.CurrentActivity.Acts; if (actsList.CurrentItem != null) { selectedActIndex = actsList.IndexOf((Act)actsList.CurrentItem); } if (selectedActIndex >= 0) { actsList.Move(actsList.Count - 1, selectedActIndex + 1); } ActionEditPage AEP = new ActionEditPage(act); AEP.ShowAsWindow(); }
public UIElementXYCoordinatePage(ActUIElement Act) { mAct = Act; InitializeComponent(); xXCoordinate.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.XCoordinate, mAct.GetInputParamValue(ActUIElement.Fields.XCoordinate))); xYCoordinate.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.YCoordinate, mAct.GetInputParamValue(ActUIElement.Fields.YCoordinate))); xValue.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.Value, mAct.GetInputParamValue(ActUIElement.Fields.Value))); if (mAct.ElementAction == ActUIElement.eElementAction.SendKeysXY) { xValuePanel.Visibility = Visibility.Visible; } else { xValuePanel.Visibility = Visibility.Collapsed; } }
private void BindElementTypeComboBox() { ElementTypeComboBox.Items.Clear(); if (Convert.ToBoolean(mAction.GetInputParamValue(Fields.IsWidgetsElement))) { ElementTypeComboBox.BindControl(mAction, nameof(ActUIElement.ElementType), mPlatform.GetPlatformWidgetsUIElementsType()); xWidgetElementImage.Visibility = Visibility.Visible; } else { ElementTypeComboBox.BindControl(mAction, nameof(ActUIElement.ElementType), mPlatform.GetPlatformUIElementsType()); xWidgetElementImage.Visibility = Visibility.Collapsed; } }
private void TestButton_Click(object sender, RoutedEventArgs e) { TestStatusTextBlock.Text = "Executing"; //TODO: do events? Act act; //We came from ActionEditPage if (mAction != null) { act = (Act)((Act)(mAction)).CreateCopy(); } else { act = (Act)((Act)(mActions.CurrentItem)).CreateCopy(); } // Copy from the selected Locator ElementLocator EL = (ElementLocator)mLocators.CurrentItem; act.AddNewReturnParams = true; act.Active = true; if ((mActions.CurrentItem).GetType() == typeof(ActUIElement)) { ActUIElement aaa = (ActUIElement)mActions.CurrentItem; ActUIElement actUI = (ActUIElement)act; actUI.ElementLocateBy = EL.LocateBy; actUI.ElementLocateValue = EL.LocateValue; actUI.Value = ValueTextBox.Text; actUI.GetOrCreateInputParam(ActUIElement.Fields.ControlActionValue, ValueTextBox.Text); actUI.GetOrCreateInputParam(ActUIElement.Fields.ControlAction, aaa.GetInputParamValue(ActUIElement.Fields.ControlAction)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColSelector, aaa.GetInputParamValue(ActUIElement.Fields.WhereColSelector)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnTitle, aaa.GetInputParamValue(ActUIElement.Fields.WhereColumnTitle)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnValue, aaa.GetInputParamValue(ActUIElement.Fields.WhereColumnValue)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereOperator, aaa.GetInputParamValue(ActUIElement.Fields.WhereOperator)); actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereProperty, aaa.GetInputParamValue(ActUIElement.Fields.WhereProperty)); } else { act.LocateBy = EL.LocateBy; act.LocateValueCalculated = EL.LocateValue; act.Value = ValueTextBox.Text; } App.AutomateTabGingerRunner.PrepActionVE(act); ApplicationAgent ag = App.AutomateTabGingerRunner.ApplicationAgents.Where(x => x.AppName == App.BusinessFlow.CurrentActivity.TargetApplication).FirstOrDefault(); if (ag != null) { App.AutomateTabGingerRunner.ExecutionLogger.Configuration.ExecutionLoggerAutomationTabContext = ExecutionLoggerConfiguration.AutomationTabContext.ActionRun; ag.Agent.RunAction(act); } TestStatusTextBlock.Text = string.Empty; if (act.Status != null) { TestStatusTextBlock.Text += act.Status + System.Environment.NewLine; } if (string.IsNullOrEmpty(act.Error) == false) { TestStatusTextBlock.Text += act.Error + System.Environment.NewLine; } if (string.IsNullOrEmpty(act.ExInfo) == false) { TestStatusTextBlock.Text += act.ExInfo + System.Environment.NewLine; } string retval = GetAllRetVals(act); if (retval != null) { TestStatusTextBlock.Text += retval + System.Environment.NewLine; } }
public List <ElementConfigControl> GetRequiredConfigControls() { List <ElementConfigControl> elementList = new List <ElementConfigControl>(); if (new ActUIElement.eElementAction[] { ActUIElement.eElementAction.SetValue, ActUIElement.eElementAction.SendKeys, ActUIElement.eElementAction.SetDate, ActUIElement.eElementAction.SendKeyPressRelease, ActUIElement.eElementAction.SetText, ActUIElement.eElementAction.SetSelectedValueByIndex, ActUIElement.eElementAction.Select, ActUIElement.eElementAction.SelectByText }.Contains(mAction.ElementAction)) { if (mAction.ElementType == eElementType.TextBox || mAction.ElementType == eElementType.ComboBox || mAction.ElementType == eElementType.CheckBox || mAction.ElementType == eElementType.Unknown) { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.Value, ControlType = eElementType.TextBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.Value)) ? new List <string>() { "" } : mAction.GetInputParamValue(ActUIElement.Fields.Value).Split(',').ToList() }); } } else if ((mAction.ElementAction == ActUIElement.eElementAction.Select)) { if (mAction.ElementType != eElementType.RadioButton) { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.ComboBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect)) ? new List <string>() { "" } : mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect).Split(',').ToList() }); } } else if ((mAction.ElementAction == ActUIElement.eElementAction.SelectByIndex)) { if (mAction.ElementType != eElementType.RadioButton) { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.ComboBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect)) ? new List <string>() { "0", "1", "2", "3" } : mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect).Split(',').ToList() }); } } else if ((mAction.ElementAction == ActUIElement.eElementAction.Click)) { if (mAction.ElementType == eElementType.MenuItem) { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.TextBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.Value)) ? new List <string>() { "" } : mAction.GetInputParamValue(ActUIElement.Fields.Value).Split(',').ToList() }); } } else if ((mAction.ElementAction == ActUIElement.eElementAction.DoubleClick) || (mAction.ElementAction == ActUIElement.eElementAction.WinClick) || (mAction.ElementAction == ActUIElement.eElementAction.MouseClick) || (mAction.ElementAction == ActUIElement.eElementAction.MousePressRelease)) { if (mAction.ElementType == eElementType.RadioButton || mAction.ElementType == eElementType.CheckBox || mAction.ElementType == eElementType.ComboBox || mAction.ElementType == eElementType.Button) { elementList.Add(new ElementConfigControl() { Title = "XCoordinate", BindedString = ActUIElement.Fields.XCoordinate, ControlType = eElementType.TextBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.XCoordinate)) ? new List <string>() { "0" } : mAction.GetInputParamValue(ActUIElement.Fields.XCoordinate).Split(',').ToList() }); elementList.Add(new ElementConfigControl() { Title = "YCoordinate", BindedString = ActUIElement.Fields.YCoordinate, ControlType = eElementType.TextBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.YCoordinate)) ? new List <string>() { "0" } : mAction.GetInputParamValue(ActUIElement.Fields.YCoordinate).Split(',').ToList() }); } } else if ((mAction.ElementAction == ActUIElement.eElementAction.GetControlProperty)) { //TODO: find a better way to bind list of enum with possible values. List <ActUIElement.eElementProperty> propertyList = mPlatform.GetPlatformElementProperties(); List <string> propertyListString = new List <string>(); foreach (ActUIElement.eElementProperty property in propertyList) { propertyListString.Add(property.ToString()); } elementList.Add(new ElementConfigControl() { Title = "Name", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.ComboBox, PossibleValues = propertyListString }); } return(elementList); }
public List <ElementConfigControl> GetRequiredConfigControls() { List <ElementConfigControl> elementList = new List <ElementConfigControl>(); if (new ActUIElement.eElementAction[] { ActUIElement.eElementAction.SetValue, ActUIElement.eElementAction.MultiSetValue, ActUIElement.eElementAction.SendKeys, ActUIElement.eElementAction.SetDate, ActUIElement.eElementAction.SendKeyPressRelease, ActUIElement.eElementAction.SetText, ActUIElement.eElementAction.SelectByText, ActUIElement.eElementAction.GetAttrValue, ActUIElement.eElementAction.RunJavaScript }.Contains(mAction.ElementAction)) { if (mAction.ElementLocateBy == eLocateBy.POMElement && (mAction.ElementAction == ActUIElement.eElementAction.SetValue || mAction.ElementAction == ActUIElement.eElementAction.SetText || mAction.ElementAction == ActUIElement.eElementAction.SelectByText || mAction.ElementAction == ActUIElement.eElementAction.SendKeys)) { elementList.Add(GetPomOptionalValuesComboBox(ActUIElement.Fields.Value, ePomElementValuesType.Values)); } else { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.Value, ControlType = eElementType.TextBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.Value)) ? new List <string>() { "" } : new List <string>() { mAction.GetInputParamValue(ActUIElement.Fields.Value) } }); } } else if (mAction.ElementAction == ActUIElement.eElementAction.Select) { if (mAction.ElementType != eElementType.RadioButton) { if (mAction.ElementLocateBy == eLocateBy.POMElement) { elementList.Add(GetPomOptionalValuesComboBox(ActUIElement.Fields.ValueToSelect, ePomElementValuesType.Values)); } else { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.ComboBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect)) ? new List <string>() { "" } : new List <string>() { mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect) } }); } } } else if ((mAction.ElementAction == ActUIElement.eElementAction.SelectByIndex || mAction.ElementAction == ActUIElement.eElementAction.SetSelectedValueByIndex)) { if (mAction.ElementType != eElementType.RadioButton) { if (mAction.ElementLocateBy == eLocateBy.POMElement) { elementList.Add(GetPomOptionalValuesComboBox(ActUIElement.Fields.ValueToSelect, ePomElementValuesType.Indexs)); } else { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.ComboBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect)) ? new List <string>() { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" } : new List <string>() { mAction.GetInputParamValue(ActUIElement.Fields.ValueToSelect) } }); } } } else if ((mAction.ElementAction == ActUIElement.eElementAction.Click)) { if (mAction.ElementType == eElementType.MenuItem) { elementList.Add(new ElementConfigControl() { Title = "Value", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.TextBox, PossibleValues = String.IsNullOrEmpty(mAction.GetInputParamValue(ActUIElement.Fields.Value)) ? new List <string>() { "" } : new List <string>() { mAction.GetInputParamValue(ActUIElement.Fields.Value) } }); } } else if ((mAction.ElementAction == ActUIElement.eElementAction.GetControlProperty)) { //TODO: find a better way to bind list of enum with possible values. List <ActUIElement.eElementProperty> propertyList = mPlatform.GetPlatformElementProperties(); List <string> propertyListString = new List <string>(); foreach (ActUIElement.eElementProperty property in propertyList) { propertyListString.Add(property.ToString()); } elementList.Add(new ElementConfigControl() { Title = "Name", BindedString = ActUIElement.Fields.ValueToSelect, ControlType = eElementType.ComboBox, PossibleValues = propertyListString }); } return(elementList); }
public void TableActionFieldBinding() { RowSelectorPanelInit(); WhereColumn.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereColSelector, mAct.GetInputParamValue(ActUIElement.Fields.WhereColSelector)), typeof(ActUIElement.eTableElementRunColSelectorValue), isVENeeded: false, UCselectionChange: WhereColumn_SelectionChanged); WhereColumnTitle.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnTitle, mAct.GetInputParamValue(ActUIElement.Fields.WhereColumnTitle)), isVENeeded: true, UCselectionChange: WhereColumnTitle_SelectionChanged); WhereProperty.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereProperty, mAct.GetInputParamValue(ActUIElement.Fields.WhereProperty)), typeof(ActUIElement.eTableElementRunColPropertyValue), isVENeeded: false, UCselectionChange: WhereProperty_SelectionChanged); WhereOperator.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereOperator, mAct.GetInputParamValue(ActUIElement.Fields.WhereOperator)), typeof(ActUIElement.eTableElementRunColOperator), isVENeeded: false, UCselectionChange: WhereOperator_SelectionChanged); WhereColumnValue.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnValue, mAct.GetInputParamValue(ActUIElement.Fields.WhereColumnValue))); RowSelectorValue.Init(mAct.GetOrCreateInputParam(ActUIElement.Fields.LocateRowValue), isVENeeded: true, UCselectionChange: RowSelectorValue_SelectionChanged); }
public UIElementXYCoordinatePage(ActUIElement Act) { mAct = Act; InitializeComponent(); xXCoordinate.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActUIElement.Fields.XCoordinate, mAct.GetInputParamValue(ActUIElement.Fields.XCoordinate))); xYCoordinate.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActUIElement.Fields.YCoordinate, mAct.GetInputParamValue(ActUIElement.Fields.YCoordinate))); xValue.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActUIElement.Fields.Value, mAct.GetInputParamValue(ActUIElement.Fields.Value))); if (mAct.ElementData != null) { string[] spliter = new string[] { "," }; string[] cordinations = Convert.ToString(mAct.ElementData).Split(spliter, StringSplitOptions.RemoveEmptyEntries); mAct.AddOrUpdateInputParamValue("XCoordinate", cordinations[0]); mAct.AddOrUpdateInputParamValue("YCoordinate", cordinations[1]); } if (mAct.ElementAction == ActUIElement.eElementAction.SendKeysXY) { xValuePanel.Visibility = Visibility.Visible; } else { xValuePanel.Visibility = Visibility.Collapsed; } }