public override string GetXPathCondition(object parameter, TermOptions termOptions)
        {
            IWebElement scope = component.ScopeSource.GetScopeElement(component, SearchOptions.SafelyAtOnce());

            IWebElement label = scope.Get(
                By.XPath($".//label[{TermResolver.CreateXPathCondition(parameter, termOptions)}]").
                SafelyAtOnce().
                Label(TermResolver.ToDisplayString(parameter)));

            if (label != null)
            {
                string elementId = label.GetAttribute("for");

                if (!string.IsNullOrEmpty(elementId))
                {
                    return($"[@id='{elementId}']");
                }
            }

            return($"[ancestor::label[{TermResolver.CreateXPathCondition(parameter, termOptions)}]]");
        }
 public override string GetXPathCondition(object parameter, TermOptions termOptions)
 {
     return($"[{RelativeElementXPath}[{TermResolver.CreateXPathCondition(parameter, termOptions)}]]");
 }
Beispiel #3
0
        protected string CreateSimpleXPathCodition(string locatorXPathFormat, object parameter, TermOptions termOptions, string operand)
        {
            string xPathCondition = TermResolver.CreateXPathCondition(parameter, termOptions, operand);

            return(locatorXPathFormat.FormatWith(xPathCondition));
        }
 public override string GetXPathCondition(object parameter, TermOptions termOptions)
 {
     return($"[{TermResolver.CreateXPathCondition(parameter, termOptions, "@value")}]");
 }