Пример #1
0
 public static string GetText()
 {
     var textControl = new HtmlControl(browserWindow);
     try
     {
         textControl.SearchProperties.Add(CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
         textControl.WaitForControlEnabled();
         textControl.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find HtmlEdit Element - Element not Found");
     }
     return Text = textControl.InnerText;
 }
Пример #2
0
        public void WaitForControl <T>(PropertyType type, string propertyValue) where T : HtmlControl
        {
            HtmlControl genericCtrl = (T)Activator.CreateInstance(typeof(T), new object[] { ParentWindow });

            if (type == PropertyType.Name)
            {
                genericCtrl.SearchProperties[HtmlEdit.PropertyNames.Name] = propertyValue;
            }
            else if (type == PropertyType.ID)
            {
                genericCtrl.SearchProperties[HtmlEdit.PropertyNames.Id] = propertyValue;
            }
            genericCtrl.WaitForControlEnabled();

            //genericCtrl.WaitForControlCondition(x => genericCtrl.WaitForControlPropertyEqual(type.ToString(), propertyValue));
        }
Пример #3
0
        public static string GetText()
        {
            var textControl = new HtmlControl(browserWindow);

            try
            {
                textControl.SearchProperties.Add(CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
                textControl.WaitForControlEnabled();
                textControl.WaitForControlReady();
            }
            catch (Exception)
            {
                Assert.Fail("Failed to find HtmlEdit Element - Element not Found");
            }
            return(Text = textControl.InnerText);
        }
Пример #4
0
        public UITestControl FindControl <T>(String Propertytype, string propertyvalue) where T : HtmlControl
        {
            try
            {
                genericControl = (T)Activator.CreateInstance(typeof(T), browser);
                if (Propertytype == "Id")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.Id] = propertyvalue;
                }
                else if (Propertytype == "Type")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.Type] = propertyvalue;
                }
                else if (Propertytype == "ClassName")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.ClassName] = propertyvalue;
                }
                else if (Propertytype == "FriendlyName")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.FriendlyName] = propertyvalue;
                }
                else if (Propertytype == "InnerText")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.InnerText] = propertyvalue;
                }
                else if (Propertytype == "Name")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.Name] = propertyvalue;
                }
                else if (Propertytype == "TagName")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.TagName] = propertyvalue;
                }
                else if (Propertytype == "ValueAttribute")
                {
                    genericControl.SearchProperties[HtmlControl.PropertyNames.ValueAttribute] = propertyvalue;
                }
                genericControl.WaitForControlEnabled();


                return(genericControl);
            }
            catch (Exception)
            {
                return(genericControl = null);
            }
        }