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