Example #1
0
 private static By CalculateBy(Models.TreeElement tree, int index)
 {
     if (tree == null)
     {
         throw new ArgumentNullException(nameof(tree));
     }
     return(By.XPath(string.IsNullOrEmpty(tree.Title) ? $"./ul/li[{index}]" : $".//li[./a[contains(.,\"{tree.Title}\")]]"));
 }
Example #2
0
 public Branch(SeleniumElement parent, Models.TreeElement tree, int index = 1, [CallerMemberName] string?toStringValue = null) :
     base(parent, CalculateBy(tree, index), toStringValue)
 {
     ChildBranches = tree.Branches.Select((x, i) => new Branch(this, x, ++i, x.ToString())).ToList();
 }