public void FindLastAndClickButton(AutomationElement root, PropertyCondition condition) { var el = root.FindAllDescendants(condition).Last().AsButton(); Assert.That(el, Is.Not.Null, "Failed to find :" + condition.ToString()); el.Click(); }
public void FindAndClickHyperlink(AutomationElement root, PropertyCondition condition) { var el = root.FindFirstDescendant(condition).FindAllChildren().FirstOrDefault(); Assert.That(el, Is.Not.Null, "Failed to find :" + condition.ToString()); el.Click(); }