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 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); }