public Element BuildElement(WatiN.Core.Element element, string description) { if (element == null) { throw new MissingHtmlException(description); } return(new WatiNElement(element)); }
private static ElementFound BuildElement(WatiN.Core.Element element, string description) { if (element == null) { throw new MissingHtmlException(description); } return(BuildElement(element)); }
public WatinControl(WatinBaseControl parent, WatiN.Core.Element element, int idx) { _parent = parent; if (element != null) { htmlElement = element; _index = idx; } }
public static WC.ElementContainer <WC.Element> AsElementContainer(this WC.Element element) { if (element == null) { throw new NullReferenceException(); } if (!(element is WC.ElementContainer <WC.Element>)) { throw new InvalidCastException(element.GetType().Name + " does not implement ElementContainer<Element>."); } return(element as WC.ElementContainer <WC.Element>); }
private WatiN.Core.Element FindFieldByLabel(string locator, Scope scope) { WatiN.Core.Element field = null; var label = WatiNScope(scope).Labels.First(Find.ByText(new Regex(locator))); if (label != null) { var isVisible = Constraints.IsVisible(scope.ConsiderInvisibleElements); if (!string.IsNullOrEmpty(label.For)) { field = WatiNScope(scope).Elements.First(Find.ById(label.For) & isVisible); } if (field == null) { field = label.Elements.First(Constraints.IsField() & isVisible); } } return(field); }
private static ElementFound BuildElement(WatiN.Core.Element element) { return(new WatiNElement(element)); }
private Element BuildElement(WatiN.Core.Element element) { return(new WatiNElement(element, Watin)); }
internal WatiNElement(WatiN.Core.Element watinElement, WatiN.Core.Browser browser) { this.browser = browser; Native = watinElement; }
internal WatiNElement(WatiN.Core.Element watinElement) { Native = watinElement; }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { try { //foreach (WatiN.Core.TextField obj in ie.TextFields) //{ // obj.Highlight(false); //} //foreach (WatiN.Core.Button obj in ie.Buttons) //{ // obj.Highlight(false); //} //foreach (WatiN.Core.Div obj in ie.Divs) //{ // obj.Highlight(false); //}\ txtSelect.Text = e.Node.Text; string Value = e.Node.Text; if (Value.IndexOf(" = ") >= 0) { Value = Value.Split('=')[1].Trim(); } if (e.Node.FullPath.IndexOf("Div") >= 0) { if (txtSelect.Text.IndexOf("Name = ") >= 0) { Div div = ie.Div(Find.ByName(Value)); if (div != null && div.Exists) { div.Highlight(true); } } else { Div div = ie.Div(Find.ById(Value)); if (div != null && div.Exists) { div.Highlight(true); } } } else if (e.Node.FullPath.IndexOf("TextBox") >= 0) { TextField text = ie.TextField(Find.ByName(Value)); if (text != null && text.Exists) { text.Highlight(true); text.Select(); } } else if (e.Node.FullPath.IndexOf("Button") >= 0) { WatiN.Core.Button butt = ie.Button(Find.ByValue(Value)); if (butt != null && butt.Exists) { butt.Highlight(true); } } else if (e.Node.FullPath.IndexOf("Link") >= 0) { if (txtSelect.Text.IndexOf("Class = ") >= 0) { WatiN.Core.Link link = ie.Link(Find.ByClass(Value)); if (link != null && link.Exists) { link.Highlight(true); } } else { WatiN.Core.Link link = ie.Link(Find.ByText(Value)); if (link != null && link.Exists) { link.Highlight(true); } } } else if (e.Node.FullPath.IndexOf("Element") >= 0) { if (txtSelect.Text.IndexOf("Id = ") >= 0) { WatiN.Core.Element link = ie.Element(Find.ById(Value)); if (link != null && link.Exists) { link.Highlight(true); } } else { WatiN.Core.Element link = ie.Element(Find.ByText(Value)); if (link != null && link.Exists) { link.Highlight(true); } } } } catch { } }
private bool IsFieldset(WatiN.Core.Element e) { return(e.TagName == "FIELDSET"); }
public void ClearScope() { Scope = null; }
private bool IsElementInContainer(WatiN.Core.Element element, IElementContainer container) { return(container.Children().Any(child => child.Equals(element))); }
private bool HasAttribute(WatiN.Core.Element element, string attributeName, string attributeValue) { return(element.GetAttributeValue(attributeName) == attributeValue); }
private bool TextMatches(WatiN.Core.Element element, string expectedText) { return(!string.IsNullOrEmpty(element.OuterText) && element.OuterText.Trim() == expectedText.Trim()); }
private bool IsSection(WatiN.Core.Element e) { return(sectionTagNames.Contains(e.TagName)); }