Beispiel #1
0
 public abstract List<string> GetPlatformUIElementPropertiesList(eElementType ElementType);
Beispiel #2
0
 public FlowElement(eElementType ElementType, string Caption, double left, double top)
 {
     this.ElementType = ElementType;
     Init(left, top);
     CaptionLabel.Content = Caption;
 }
Beispiel #3
0
        internal static List<ActUIElement.eElementAction> GetPlatformUIElementActionsList(ePlatformType Platform, eElementType ElementType)
        {
            PlatformInfoBase PB = GetPlatformImpl(Platform);

            return PB.GetPlatformUIElementActionsList(ElementType);
        }
Beispiel #4
0
        public virtual List<ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            List<ActUIElement.eElementAction> list = new List<ActUIElement.eElementAction>();

            switch (ElementType)
            {
                case eElementType.Unknown:
                    foreach (ActUIElement.eElementAction item in Enum.GetValues(typeof(ActUIElement.eElementAction)))
                    {
                        if (!item.Equals(ActUIElement.eElementAction.Unknown))
                        {
                            list.Add(item);
                        }
                    }

                    break;
                case eElementType.Button:
                    list.Add(ActUIElement.eElementAction.Click);
                    break;
                case eElementType.TextBox:
                    list.Add(ActUIElement.eElementAction.SetValue);
                    list.Add(ActUIElement.eElementAction.GetValue);
                    break;
                case eElementType.ComboBox:
                    list.Add(ActUIElement.eElementAction.SetText);
                    list.Add(ActUIElement.eElementAction.Click);
                    list.Add(ActUIElement.eElementAction.SetValue);
                    list.Add(ActUIElement.eElementAction.GetText);
                    list.Add(ActUIElement.eElementAction.GetAllValues);
                    break;
                case eElementType.CheckBox:
                    list.Add(ActUIElement.eElementAction.SetValue);
                    break;
                case eElementType.Table:
                    list.Add(ActUIElement.eElementAction.TableAction);
                    list.Add(ActUIElement.eElementAction.TableCellAction);
                    list.Add(ActUIElement.eElementAction.TableRowAction);
                    break;
                case eElementType.ScrollBar:
                    list.Add(ActUIElement.eElementAction.ScrollUp);
                    list.Add(ActUIElement.eElementAction.ScrollDown);
                    list.Add(ActUIElement.eElementAction.ScrollLeft);
                    list.Add(ActUIElement.eElementAction.ScrollRight);
                    break;
                case eElementType.Dialog:
                    list.Add(ActUIElement.eElementAction.AcceptDialog);
                    list.Add(ActUIElement.eElementAction.DismissDialog);
                    break;
            }


            return list;
        }
Beispiel #5
0
        // By Xpath
        IGingerWebElement ILocateWebElement.LocateElementByXPath(eElementType elementType, string xpath)
        {
            IWebElement element = mDriver.FindElement(By.XPath(xpath));

            return(wrapper(elementType, element));
        }
Beispiel #6
0
 public FlowElement(eElementType ElementType, object obj, string prop, double left, double top)
 {
     this.ElementType = ElementType;
     Init(left, top);
     ControlsBinding.ObjFieldBinding(CaptionLabel, ContentProperty, obj, prop, BindingMode.OneWay);
 }
        public void ExecuteAction(ref NodePlatformAction platformAction)
        {
            InputParams = platformAction.InputParams;



            string Value = (string)InputParams["Value"];
            List <NodeActionOutputValue> AOVs = new List <NodeActionOutputValue>();

            try
            {
                // use enum or string/const ???
                eControlAction ElementAction = (eControlAction)Enum.Parse(typeof(eControlAction), InputParams["ControlAction"].ToString());
                switch (ElementAction)
                {
                case eControlAction.GotoURL:
                    string GotoURLType = String.Empty;

                    if (InputParams.ContainsKey("GotoURLType"))
                    {
                        GotoURLType = (string)InputParams["GotoURLType"];
                    }
                    if (string.IsNullOrEmpty(GotoURLType))
                    {
                        GotoURLType = "Current";
                    }

                    BrowserService.Navigate(Value, GotoURLType);



                    platformAction.exInfo += "Navigated to: " + Value;

                    break;

                case eControlAction.GetPageURL:
                    platformAction.Output.Add("PageUrl", BrowserService.GetCurrentUrl());
                    break;

                case eControlAction.Maximize:
                    BrowserService.Maximize();
                    break;

                case eControlAction.Close:
                    BrowserService.CloseCurrentTab();
                    break;

                case eControlAction.CloseAll:
                    BrowserService.CloseWindow();
                    break;

                case eControlAction.Refresh:
                    BrowserService.Refresh();
                    break;

                case eControlAction.NavigateBack:
                    BrowserService.NavigateBack();
                    break;

                case eControlAction.DismissMessageBox:
                    BrowserService.DismissAlert();
                    break;

                case eControlAction.DeleteAllCookies:
                    BrowserService.DeleteAllCookies();
                    break;

                case eControlAction.AcceptMessageBox:

                    BrowserService.AcceptAlert();
                    break;

                case eControlAction.GetWindowTitle:

                    string Title = BrowserService.GetTitle();

                    AOVs.Add(new NodeActionOutputValue()
                    {
                        Param = "Actual", Value = Title
                    });
                    break;

                case eControlAction.GetMessageBoxText:

                    string AlertText = BrowserService.GetAlertText();
                    AOVs.Add(new NodeActionOutputValue()
                    {
                        Param = "Actual", Value = AlertText
                    });
                    break;

                case eControlAction.SetAlertBoxText:


                    string value = (string)InputParams["Value"];
                    BrowserService.SendAlertText(value);
                    break;

                case eControlAction.SwitchFrame:
                    string ElementLocateBy;
                    string Locatevalue;
                    string mElementType = "";
                    Locatevalue = (string)InputParams["LocateValue"];

                    object elb;
                    InputParams.TryGetValue("ElementLocateBy", out elb);

                    ElementLocateBy = elb != null?elb.ToString() : "";

                    if (string.IsNullOrEmpty(ElementLocateBy))
                    {
                        ElementLocateBy = (string)InputParams["LocateBy"];
                    }

                    if (string.IsNullOrEmpty(Locatevalue))
                    {
                        Locatevalue = (string)InputParams["Value"];
                    }


                    eElementType ElementType = eElementType.WebElement;
                    _ = Enum.TryParse <eElementType>(mElementType, out ElementType);
                    IGingerWebElement Element = LocateElement(ElementType, ElementLocateBy, Locatevalue);
                    BrowserService.SwitchToFrame(Element);
                    break;

                case eControlAction.RunJavaScript:
                    string javascript = (string)InputParams["javascript"];
                    object Output     = BrowserService.ExecuteScript(javascript);
                    if (Output != null)
                    {
                        platformAction.Output.Add("Actual", Output.ToString());
                    }
                    break;

                case eControlAction.GetPageSource:

                    string PageSource = BrowserService.GetPageSource();
                    AOVs.Add(new NodeActionOutputValue()
                    {
                        Param = "PageSource", Value = PageSource
                    });

                    break;

                case eControlAction.InjectJS:



                    break;
                }
            }
            catch (Exception ex)
            {
                platformAction.addError(ex.Message);
            }

            finally
            {
                platformAction.Output.OutputValues.AddRange(AOVs);
            }
        }
Beispiel #8
0
        // by ID
        IGingerWebElement ILocateWebElement.LocateElementByID(eElementType elementType, string id)
        {
            IWebElement element = mDriver.FindElement(By.Id(id));

            return(wrapper(elementType, element));
        }
        private void ExecuteSmartSyncAction(IWebPlatform webPlatformService, ref NodePlatformAction platformAction)
        {
            Dictionary <string, object> InputParams = platformAction.InputParams;

            int MaxTimeout = Int32.Parse(InputParams.ContainsKey("WaitTime") ? InputParams["WaitTime"].ToString() : (string.IsNullOrEmpty(InputParams["Value"].ToString()) ? "5" : InputParams["Value"].ToString()));

            string SmartSyncAction = InputParams["SmartSyncAction"] as string;

            string LocateValue = InputParams["LocateValue"] as string;

            string       LocateBy    = InputParams["LocateBy"] as string;
            eElementType ElementType = eElementType.WebElement;

            IGingerWebElement WebElement = null;
            Stopwatch         st         = new Stopwatch();

            switch (SmartSyncAction)
            {
            case "WaitUntilDisplay":
                st.Reset();
                st.Start();
                WebElement = LocateElement(ref ElementType, LocateBy, LocateValue, webPlatformService);

                while (!(WebElement != null && (WebElement.IsVisible() || WebElement.IsEnabled())))
                {
                    Task.Delay(100);
                    WebElement = LocateElement(ref ElementType, LocateBy, LocateValue, webPlatformService);

                    if (st.ElapsedMilliseconds > MaxTimeout * 1000)
                    {
                        platformAction.addError("Smart Sync of WaitUntilDisplay is timeout");
                        break;
                    }
                }
                break;

            case "WaitUntilDisapear":
                st.Reset();
                st.Start();

                WebElement = LocateElement(ref ElementType, LocateBy, LocateValue, webPlatformService);

                if (WebElement == null)
                {
                    return;
                }
                else
                {
                    st.Start();

                    while (WebElement != null && WebElement.IsVisible())
                    {
                        Task.Delay(100);
                        WebElement = LocateElement(ref ElementType, LocateBy, LocateValue, webPlatformService);
                        if (st.ElapsedMilliseconds > MaxTimeout * 1000)
                        {
                            platformAction.addError("Smart Sync of WaitUntilDisapear is timeout");
                            break;
                        }
                    }
                }
                break;

            default:
                platformAction.error = "Smart Sync " + SmartSyncAction + "Action Not found";
                break;
            }
        }
Beispiel #10
0
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            List <ActUIElement.eElementAction> list = new List <ActUIElement.eElementAction>();

            switch (ElementType)
            {
            default:
                ElementTypeData elementTypeOperations = GetPlatformElementTypesData().Where(x => x.ElementType == ElementType).FirstOrDefault();
                if (elementTypeOperations != null)
                {
                    if (elementTypeOperations.ActionType == typeof(ActUIElement))
                    {
                        elementTypeOperations.ElementOperationsList.ForEach(z => list.Add((ActUIElement.eElementAction)(object) z));
                    }
                }
                break;
            }
            return(list);
        }
        internal static IGingerWebElement LocateElement(ref eElementType ElementType, string ElementLocateBy, string LocateByValue, IWebPlatform mPlatformService)
        {
            IGingerWebElement Element = null;

            try
            {
                switch (ElementLocateBy)
                {
                case "ByID":
                    Element = mPlatformService.LocateWebElement.LocateElementByID(ElementType, LocateByValue);
                    break;

                case "ByCSSSelector":
                case "ByCSS":
                    Element = mPlatformService.LocateWebElement.LocateElementByCss(ElementType, LocateByValue);
                    break;

                case "ByLinkText":
                    Element = mPlatformService.LocateWebElement.LocateElementByLinkTest(ElementType, LocateByValue);
                    break;

                case "ByName":
                    Element = mPlatformService.LocateWebElement.LocateElementByName(ElementType, LocateByValue);
                    break;

                case "ByRelXPath":
                case "ByXPath":
                    Element = mPlatformService.LocateWebElement.LocateElementByXPath(ElementType, LocateByValue);
                    break;
                }

                if (Element != null && (ElementType == eElementType.WebElement || ElementType == eElementType.Unknown))
                {
                    if (Element is IButton)
                    {
                        ElementType = eElementType.Button;
                    }
                    else if (Element is ICanvas)
                    {
                        ElementType = eElementType.Canvas;
                    }
                    else if (Element is ICheckBox)
                    {
                        ElementType = eElementType.CheckBox;
                    }
                    else if (Element is IComboBox)
                    {
                        ElementType = eElementType.ComboBox;
                    }
                    else if (Element is IDiv)
                    {
                        ElementType = eElementType.Div;
                    }
                    else if (Element is IHyperLink)
                    {
                        ElementType = eElementType.HyperLink;
                    }
                    else if (Element is IImage)
                    {
                        ElementType = eElementType.Image;
                    }
                    else if (Element is ILabel)
                    {
                        ElementType = eElementType.Label;
                    }
                    else if (Element is IWebList)
                    {
                        ElementType = eElementType.List;
                    }
                    else if (Element is IRadioButton)
                    {
                        ElementType = eElementType.RadioButton;
                    }
                    else if (Element is ISpan)
                    {
                        ElementType = eElementType.Span;
                    }
                    else if (Element is ITable)
                    {
                        ElementType = eElementType.Table;
                    }
                    else if (Element is ITextBox)
                    {
                        ElementType = eElementType.TextBox;
                    }
                }
            }

            catch
            {
            }
            return(Element);
        }
Beispiel #12
0
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            List <ActUIElement.eElementAction> javaPlatformElementActionslist = base.GetPlatformUIElementActionsList(ElementType);

            switch (ElementType)
            {
            case eElementType.Button:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MouseClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MousePressRelease);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.WinClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.winDoubleClick);
                break;

            case eElementType.TextBox:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetControlProperty);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValue);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsMandatory);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.SendKeys);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.SendKeyPressRelease);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.SetValue);
                break;

            case eElementType.ComboBox:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncSelect);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetControlProperty);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetItemCount);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetName);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValueByIndex);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValue);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsMandatory);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MouseClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MousePressRelease);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.SelectByIndex);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Select);
                break;

            case eElementType.CheckBox:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Click);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.DoubleClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsMandatory);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetControlProperty);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetName);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValue);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MouseClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MousePressRelease);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Toggle);
                break;

            case eElementType.RadioButton:

                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncSelect);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Click);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetControlProperty);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetItemCount);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetName);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValue);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MouseClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MousePressRelease);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Select);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.WinClick);
                break;

            case eElementType.List:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Click);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetItemCount);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValueByIndex);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValue);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MouseClick);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.MousePressRelease);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.WinClick);
                break;

            case eElementType.Label:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetName);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.GetValue);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsVisible);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsEnabled);
                break;

            case eElementType.MenuItem:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Click);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Collapse);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Expand);
                break;

            case eElementType.Window:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.CloseWindow);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.IsExist);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Switch);
                break;

            case eElementType.Tab:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.AsyncSelect);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.Select);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.SelectByIndex);
                break;

            case eElementType.EditorPane:
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.InitializeJEditorPane);
                javaPlatformElementActionslist.Add(ActUIElement.eElementAction.JEditorPaneElementAction);
                break;
            }
            return(javaPlatformElementActionslist);
        }
Beispiel #13
0
 public override List <string> GetPlatformUIElementPropertiesList(eElementType ElementType)
 {
     throw new NotImplementedException();
 }
Beispiel #14
0
        public static eImageType GetElementTypeImage(eElementType elementType = eElementType.Unknown)
        {
            switch (elementType)
            {
            case eElementType.Button:
                return(eImageType.Button);

            case eElementType.CheckBox:
                return(eImageType.CheckBox);

            case eElementType.ComboBox:
                return(eImageType.DropList);

            case eElementType.ComboBoxOption:
                return(eImageType.List);

            case eElementType.HyperLink:
                return(eImageType.Link);

            case eElementType.Image:
                return(eImageType.Image);

            case eElementType.Label:
                return(eImageType.Label);

            case eElementType.List:
                return(eImageType.List);

            case eElementType.ListItem:
                return(eImageType.List);

            case eElementType.MenuBar:
            case eElementType.MenuItem:
                return(eImageType.Menu);

            case eElementType.RadioButton:
                return(eImageType.RadioButton);

            case eElementType.Table:
            case eElementType.TableItem:
                return(eImageType.Table);

            case eElementType.Text:
                return(eImageType.Label);

            case eElementType.TextBox:
                return(eImageType.TextBox);

            case eElementType.Window:
            case eElementType.Dialog:
                return(eImageType.Window);

            case eElementType.DatePicker:
                return(eImageType.DatePicker);

            case eElementType.TreeView:
                return(eImageType.TreeView);
            }

            return(eImageType.Element);
        }
 private ElementConfigControl GetElementConfigControl(string title, string bindedString, eElementType elementType, List <string> possibleValue, RoutedEventHandler routedEvent = null)
 {
     return(new ElementConfigControl()
     {
         Title = title,
         BindedString = bindedString,
         ControlType = elementType,
         PossibleValues = possibleValue,
         ElementEvent = routedEvent
     });
 }
Beispiel #16
0
        private IGingerWebElement wrapper(eElementType elementType, IWebElement element)
        {
            IGingerWebElement Element = null;

            switch (elementType)
            {
            case eElementType.Button:      // return the generic base element
                Element = new Button();
                break;

            case eElementType.Canvas:
                // TODO: think if we want to check TagName to verify element type
                Element = new Canvas();
                break;

            case eElementType.CheckBox:
                Element = new CheckBox();
                break;

            case eElementType.ComboBox:
                Element = new ComboBox();
                break;

            case eElementType.Div:
                Element = new GingerWebElement();
                break;

            case eElementType.Image:
                Element = new GingerWebElement();
                break;

            case eElementType.Label:
                Element = new Label();
                break;

            case eElementType.List:
                Element = new List();
                break;

            case eElementType.RadioButton:
                Element = new RadioButton();
                break;

            case eElementType.Span:
                Element = new Span();
                break;

            case eElementType.Table:
                Element = new Table();
                break;

            case eElementType.TextBox:
                Element = new TextBox();
                break;

            case eElementType.WebElement:
            case eElementType.Unknown:

                eElementType MyElemetType = GetElementType(element);
                if (MyElemetType == eElementType.Unknown)
                {
                    Element         = new GingerWebElement();
                    Element.Element = element;
                }

                else
                {
                    Element = wrapper(MyElemetType, element);
                }
                break;

            case eElementType.HyperLink:
                Element = new HyperLink();
                break;
            }

            Element.Element = element;

            if (Element is GingerWebElement GE)
            {
                GE.Driver = mDriver;
            }

            return(Element);
        }
Beispiel #17
0
 public Element(SVG svg, Shape parent, eElementType eType, List<ShapeUtil.Attribute> attrs)
     : base(svg, attrs, parent)
 {
     this.ElementType = eType;
     this.Text = string.Empty;
     this.Children = new List<Element>();
 }
Beispiel #18
0
        private eElementType GetElementType(IWebElement element)
        {
            eElementType elementType    = eElementType.Unknown;
            string       elementTagName = element.TagName;
            string       elementTypeAtt = element.GetAttribute("type");

            if (element == null)
            {
                return(eElementType.Unknown);
            }



            if ((elementTagName.ToUpper() == "INPUT" && (elementTypeAtt.ToUpper() == "UNDEFINED" || elementTypeAtt.ToUpper() == "TEXT" || elementTypeAtt.ToUpper() == "PASSWORD" || elementTypeAtt.ToUpper() == "EMAIL" ||
                                                         elementTypeAtt.ToUpper() == "TEL" || elementTypeAtt.ToUpper() == "SEARCH" || elementTypeAtt.ToUpper() == "NUMBER" || elementTypeAtt.ToUpper() == "URL" ||
                                                         elementTypeAtt.ToUpper() == "DATE")) || elementTagName.ToUpper() == "TEXTAREA" || elementTagName.ToUpper() == "TEXT")
            {
                elementType = eElementType.TextBox;
            }
            else if ((elementTagName.ToUpper() == "INPUT" && (elementTypeAtt.ToUpper() == "IMAGE" || elementTypeAtt.ToUpper() == "SUBMIT" || elementTypeAtt.ToUpper() == "BUTTON")) ||
                     elementTagName.ToUpper() == "BUTTON" || elementTagName.ToUpper() == "SUBMIT" || elementTagName.ToUpper() == "RESET")
            {
                elementType = eElementType.Button;
            }
            else if (elementTagName.ToUpper() == "TD" || elementTagName.ToUpper() == "TH" || elementTagName.ToUpper() == "TR")
            {
                elementType = eElementType.Table;
            }
            else if (elementTagName.ToUpper() == "LINK" || elementTagName.ToUpper() == "A" || elementTagName.ToUpper() == "LI")
            {
                elementType = eElementType.HyperLink;
            }
            else if (elementTagName.ToUpper() == "LABEL" || elementTagName.ToUpper() == "TITLE")
            {
                elementType = eElementType.Label;
            }
            else if (elementTagName.ToUpper() == "SELECT" || elementTagName.ToUpper() == "SELECT-ONE")
            {
                elementType = eElementType.ComboBox;
            }
            else if (elementTagName.ToUpper() == "TABLE" || elementTagName.ToUpper() == "CAPTION")
            {
                elementType = eElementType.Table;
            }
            else if (elementTagName.ToUpper() == "JEDITOR.TABLE")
            {
                elementType = eElementType.TextBox;
            }
            else if (elementTagName.ToUpper() == "DIV")
            {
                elementType = eElementType.Div;
            }
            else if (elementTagName.ToUpper() == "SPAN")
            {
                elementType = eElementType.Span;
            }
            else if (elementTagName.ToUpper() == "IMG" || elementTagName.ToUpper() == "MAP")
            {
                elementType = eElementType.Image;
            }
            else if ((elementTagName.ToUpper() == "INPUT" && elementTypeAtt.ToUpper() == "CHECKBOX") || (elementTagName.ToUpper() == "CHECKBOX"))
            {
                elementType = eElementType.CheckBox;
            }
            else if (elementTagName.ToUpper() == "OPTGROUP" || elementTagName.ToUpper() == "OPTION")
            {
                elementType = eElementType.ComboBox;
            }
            else if ((elementTagName.ToUpper() == "INPUT" && elementTypeAtt.ToUpper() == "RADIO") || (elementTagName.ToUpper() == "RADIO"))
            {
                elementType = eElementType.RadioButton;
            }
            //else if (elementTagName.ToUpper() == "IFRAME" || elementTagName.ToUpper() == "FRAME" || elementTagName.ToUpper() == "FRAMESET")
            //{
            //    elementType = eElementType.Iframe;
            //}
            else if (elementTagName.ToUpper() == "CANVAS")
            {
                elementType = eElementType.Canvas;
            }
            //else if (elementTagName.ToUpper() == "FORM")
            //{
            //    elementType = eElementType.Form;
            //}
            else if (elementTagName.ToUpper() == "UL" || elementTagName.ToUpper() == "OL" || elementTagName.ToUpper() == "DL")
            {
                elementType = eElementType.List;
            }
            else if (elementTagName.ToUpper() == "LI" || elementTagName.ToUpper() == "DT" || elementTagName.ToUpper() == "DD")
            {
                elementType = eElementType.List;
            }
            //else if (elementTagName.ToUpper() == "MENU")
            //{
            //    elementType = eElementType.MenuBar;
            //}
            else if (elementTagName.ToUpper() == "H1" || elementTagName.ToUpper() == "H2" || elementTagName.ToUpper() == "H3" || elementTagName.ToUpper() == "H4" || elementTagName.ToUpper() == "H5" || elementTagName.ToUpper() == "H6" || elementTagName.ToUpper() == "P")
            {
                elementType = eElementType.TextBox;
            }
            else
            {
                elementType = eElementType.Unknown;
            }


            return(elementType);
        }
Beispiel #19
0
 public virtual string GetDefaultElementOperation(eElementType ElementTypeEnum)
 {
     return(string.Empty);
 }
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            // just as example we can override and add action which exist only in Android - like LongClick
            List <ActUIElement.eElementAction> list = base.GetPlatformUIElementActionsList(ElementType);

            // if ElementType
            // switch
            list.Add(ActUIElement.eElementAction.LongClick);
            return(list);
        }
Beispiel #21
0
 public UIElementFilter(eElementType elementType, string elementExtraInfo, bool isSelected = false)
 {
     Selected         = isSelected;
     ElementType      = elementType;
     ElementExtraInfo = elementExtraInfo;
 }
Beispiel #22
0
 internal static List<string> GetPlatformUIElementPropertiesList(ePlatformType Platform, eElementType ElementType)
 {
     PlatformInfoBase PB = GetPlatformImpl(Platform);
     return PB.GetPlatformUIElementPropertiesList(ElementType);
 }
Beispiel #23
0
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            List <ActUIElement.eElementAction> list = new List <ActUIElement.eElementAction>();

            switch (ElementType)
            {
            case eElementType.Unknown:
                foreach (ActUIElement.eElementAction item in Enum.GetValues(typeof(ActUIElement.eElementAction)))
                {
                    list.Add(item);
                }
                break;

            case eElementType.Button:
                list.Add(ActUIElement.eElementAction.Click);
                list.Add(ActUIElement.eElementAction.JavaScriptClick);
                list.Add(ActUIElement.eElementAction.MouseClick);
                list.Add(ActUIElement.eElementAction.MousePressRelease);
                list.Add(ActUIElement.eElementAction.ClickAndValidate);
                list.Add(ActUIElement.eElementAction.Submit);

                list.Add(ActUIElement.eElementAction.GetValue);
                list.Add(ActUIElement.eElementAction.IsDisabled);
                list.Add(ActUIElement.eElementAction.GetFont);
                list.Add(ActUIElement.eElementAction.IsVisible);
                list.Add(ActUIElement.eElementAction.GetWidth);
                list.Add(ActUIElement.eElementAction.GetHeight);
                list.Add(ActUIElement.eElementAction.GetStyle);
                break;

            case eElementType.CheckBox:
                list.Add(ActUIElement.eElementAction.SetValue);
                list.Add(ActUIElement.eElementAction.Click);
                list.Add(ActUIElement.eElementAction.JavaScriptClick);
                list.Add(ActUIElement.eElementAction.MouseClick);
                list.Add(ActUIElement.eElementAction.MousePressRelease);
                list.Add(ActUIElement.eElementAction.ClickAndValidate);

                list.Add(ActUIElement.eElementAction.GetValue);
                list.Add(ActUIElement.eElementAction.IsDisabled);
                list.Add(ActUIElement.eElementAction.IsVisible);
                list.Add(ActUIElement.eElementAction.GetWidth);
                list.Add(ActUIElement.eElementAction.GetHeight);
                list.Add(ActUIElement.eElementAction.GetStyle);
                break;

            case eElementType.TextBox:
                list.Add(ActUIElement.eElementAction.SetText);
                list.Add(ActUIElement.eElementAction.SendKeys);
                list.Add(ActUIElement.eElementAction.ClearValue);
                list.Add(ActUIElement.eElementAction.IsValuePopulated);
                list.Add(ActUIElement.eElementAction.GetTextLength);

                list.Add(ActUIElement.eElementAction.GetValue);
                list.Add(ActUIElement.eElementAction.IsDisabled);
                list.Add(ActUIElement.eElementAction.GetFont);
                list.Add(ActUIElement.eElementAction.IsVisible);
                list.Add(ActUIElement.eElementAction.GetWidth);
                list.Add(ActUIElement.eElementAction.GetHeight);
                list.Add(ActUIElement.eElementAction.GetStyle);
                list.Add(ActUIElement.eElementAction.GetSize);
                break;

            case eElementType.ComboBox:
                list.Add(ActUIElement.eElementAction.SelectByIndex);
                list.Add(ActUIElement.eElementAction.Select);
                list.Add(ActUIElement.eElementAction.SelectByText);
                list.Add(ActUIElement.eElementAction.SetFocus);
                list.Add(ActUIElement.eElementAction.GetValidValues);
                list.Add(ActUIElement.eElementAction.GetSelectedValue);
                list.Add(ActUIElement.eElementAction.IsValuePopulated);
                list.Add(ActUIElement.eElementAction.GetFont);
                list.Add(ActUIElement.eElementAction.GetWidth);
                list.Add(ActUIElement.eElementAction.GetHeight);
                list.Add(ActUIElement.eElementAction.GetStyle);
                list.Add(ActUIElement.eElementAction.GetValue);
                list.Add(ActUIElement.eElementAction.GetAllValues);
                break;

            case eElementType.Table:
                list.Add(ActUIElement.eElementAction.TableAction);
                list.Add(ActUIElement.eElementAction.TableCellAction);
                list.Add(ActUIElement.eElementAction.TableRowAction);
                break;

            case eElementType.ScrollBar:
                list.Add(ActUIElement.eElementAction.ScrollUp);
                list.Add(ActUIElement.eElementAction.ScrollDown);
                list.Add(ActUIElement.eElementAction.ScrollLeft);
                list.Add(ActUIElement.eElementAction.ScrollRight);
                break;

            case eElementType.HyperLink:
                list.Add(ActUIElement.eElementAction.Click);
                list.Add(ActUIElement.eElementAction.JavaScriptClick);
                list.Add(ActUIElement.eElementAction.MouseClick);
                list.Add(ActUIElement.eElementAction.MousePressRelease);
                list.Add(ActUIElement.eElementAction.ClickAndValidate);

                list.Add(ActUIElement.eElementAction.GetWidth);
                list.Add(ActUIElement.eElementAction.GetHeight);
                list.Add(ActUIElement.eElementAction.GetStyle);
                list.Add(ActUIElement.eElementAction.GetValue);
                list.Add(ActUIElement.eElementAction.IsVisible);
                list.Add(ActUIElement.eElementAction.Hover);
                break;
            }
            return(list);
        }
Beispiel #24
0
 public virtual List<ActUIElement.eElementAction> GetPlatformWidgetsUIActionsList(eElementType ElementType)
 {
     return null;
 }
Beispiel #25
0
 public Element(Shape parent, eElementType eType, List <ShapeUtil.Attribute> attrs) : base(attrs, parent)
 {
     ElementType = eType;
     Text        = string.Empty;
     Children    = new List <Element>();
 }
Beispiel #26
0
 public virtual List<ActUIElement.eSubElementType> GetSubElementType(eElementType elementType)
 {
     return null;
 }
Beispiel #27
0
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            List <ActUIElement.eElementAction> pbTableControlActionlist = base.GetPlatformUIElementActionsList(ElementType);

            switch (ElementType)
            {
            case eElementType.Unknown:
                break;

            case eElementType.Button:
                pbTableControlActionlist.Add(ActUIElement.eElementAction.ClickAndValidate);
                break;
            }
            return(pbTableControlActionlist);
        }
Beispiel #28
0
 public FlowElement(eElementType ElementType, Page f, double left, double top, double width, double height)
 {
     this.ElementType = ElementType;
     Init(left, top, width, height);
     CustomeShape.Content = f;
 }
Beispiel #29
0
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            //TOOD: Currently we support only drag and drop for PB. So avoiding the call to get actions list from base
            List <ActUIElement.eElementAction> pbTableControlActionlist = new List <ActUIElement.eElementAction>();

            switch (ElementType)
            {
            case eElementType.Unknown:
                pbTableControlActionlist.Add(ActUIElement.eElementAction.DragDrop);
                break;

            case eElementType.Button:
                pbTableControlActionlist.Add(ActUIElement.eElementAction.ClickAndValidate);
                break;

            case eElementType.List:
            case eElementType.ComboBox:
                pbTableControlActionlist.Add(ActUIElement.eElementAction.SendKeysAndValidate);
                pbTableControlActionlist.Add(ActUIElement.eElementAction.SelectandValidate);
                break;

            case eElementType.TextBox:
            case eElementType.Text:
                pbTableControlActionlist.Add(ActUIElement.eElementAction.SendKeysAndValidate);
                break;

            case eElementType.Dialog:
                pbTableControlActionlist.Add(ActUIElement.eElementAction.AcceptDialog);
                pbTableControlActionlist.Add(ActUIElement.eElementAction.DismissDialog);
                break;
            }
            return(pbTableControlActionlist);
        }
Beispiel #30
0
 public FlowElement(eElementType ElementType, object obj, string prop, double left, double top)
 {
     this.ElementType = ElementType;
     Init(left, top);
     GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(CaptionLabel, ContentProperty, obj, prop, BindingMode.OneWay);
 }
Beispiel #31
0
 public UIElementFilter(eElementType elementType, string elementExtraInfo)
 {
     Selected         = false;
     ElementType      = elementType;
     ElementExtraInfo = elementExtraInfo;
 }