Esempio n. 1
0
        public void FindElementsByXPath()
        {
            var elements = homePagePivot.FindElementsByXPath("//Button");

            Assert.IsNotNull(elements);
            Assert.AreEqual(4, elements.Count);
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public override IEnumerable <AppiumWebElement> FindAllElements(WindowsElement element)
 {
     return(element.FindElementsByXPath(string.Format(XpathEndingWithExpression, Value)));
 }
Esempio n. 7
0
 public override IEnumerable <AppiumWebElement> FindAllElements(WindowsElement element)
 {
     return(element.FindElementsByXPath(Value));
 }