public void FindElementsByXPath() { var elements = homePagePivot.FindElementsByXPath("//Button"); Assert.IsNotNull(elements); Assert.AreEqual(4, elements.Count); }
public SpinControl(string automationID, WindowsDriver<WindowsElement> Driver) { WindowsElement customControl = Driver.FindElementByAccessibilityId(automationID); ReadOnlyCollection<AppiumWebElement> customControlChildren = customControl.FindElementsByXPath(".//*"); _increaseButton = customControlChildren.First(e => e.FindElementByAccessibilityId("Part_IncreaseButton").Id == "Part_IncreaseButton"); _decreaseButton = customControlChildren.First(e => e.FindElementByAccessibilityId("Part_DecreaseButton").Id == "Part_DecreaseButton"); _textBox = customControlChildren.First(e => e != _increaseButton && e != _decreaseButton); }
static RemoteWebElement SwapInUsefulElement(WindowsElement element) { // AutoSuggestBox on UWP has some interaction issues with WebDriver // The AutomationID is set on the control group not the actual TextBox // This retrieves the actual TextBox which makes the behavior more consistent var isAutoSuggest = element?.FindElementsByXPath("//*[contains(@AutomationId,'_AutoSuggestBox')]")?.FirstOrDefault(); return(isAutoSuggest ?? element); }
public void FindElementsByXPath() { var elements = homePagePivot.FindElementsByXPath("//Button"); Assert.IsNotNull(elements); // There are at least 4 buttons in Windows 10 Alarms & Clock HomePagePivot // Version 1511: 5, Version 1607: 5, Version 1703: 4 Assert.IsTrue(elements.Count >= 4); }
public void Test(String input, String[] output) { WindowsElement inputBox = _session.FindElementByAccessibilityId("InputBox"); WindowsElement outputBox = _session.FindElementByAccessibilityId("OutputBox"); inputBox.SendKeys(input); var elements = outputBox.FindElementsByXPath("//ListItem") .Select(element => element.Text); Assert.AreEqual(output, elements); }
public override IEnumerable <AppiumWebElement> FindAllElements(WindowsElement element) { return(element.FindElementsByXPath(string.Format(XpathEndingWithExpression, Value))); }
public override IEnumerable <AppiumWebElement> FindAllElements(WindowsElement element) { return(element.FindElementsByXPath(Value)); }