internal void HighLightElementFromNode(TreeNode treeNode) { string xpath = GetXPathFromTreeNode(treeNode); var by = SwdBrowser.ConvertLocatorSearchMethodToBy(LocatorSearchMethod.XPath, xpath); SwdBrowser.HighlightElement(by); }
internal void HighLightWebElement(WebElementDefinition element) { if (!IsValidForm()) { return; } var by = SwdBrowser.ConvertLocatorSearchMethodToBy(element.HowToSearch, element.Locator); SwdBrowser.HighlightElement(by); }
public void UpdateWebElementWithAdditionalProperties(WebElementDefinition element) { var by = SwdBrowser.ConvertLocatorSearchMethodToBy(element.HowToSearch, element.Locator); var attributes = new Dictionary <string, string>(); try { attributes = SwdBrowser.ReadElementAttributes(by); } catch (Exception e) { string errorMsg = string.Format( "UpdateWebElementWithAdditionalProperties:\n" + "Failed to find element: How={0}; Locator={1}\n" + "With exception:\n {2}" , element.HowToSearch.ToString() , element.Locator.ToString() , e.Message ); MyLog.Error(errorMsg); } if (attributes.Count == 0) { return; } element.HtmlTag = attributes["TagName"]; attributes.Remove("TagName"); WebElementHtmlAttributes elementAttrs = new WebElementHtmlAttributes(); foreach (var attrKey in attributes.Keys) { elementAttrs.Add(attrKey, attributes[attrKey]); } element.AllHtmlTagProperties = elementAttrs; }
internal void HighLightWebElement(WebElementDefinition element) { var by = SwdBrowser.ConvertLocatorSearchMethodToBy(element.HowToSearch, element.Locator); SwdBrowser.HighlightElement(by); }
public ReadOnlyCollection <IWebElement> FindElements(LocatorSearchMethod searchMethod, string locator) { var by = SwdBrowser.ConvertLocatorSearchMethodToBy(searchMethod, locator); return(Driver.FindElements(by)); }