public void SwipeTest()
        {
            ITouchAction touchAction = new TouchAction(_driver);
            var          element     = _driver.FindElementById("IntegerA");
            Point        point       = element.Coordinates.LocationInDom;
            Size         size        = element.Size;

            touchAction
            .Press(point.X + 5, point.Y + 5)
            .Wait(200).MoveTo(point.X + size.Width - 5, point.Y + size.Height - 5)
            .Release()
            .Perform();
        }
Пример #2
0
        public void AddTwoNumbersTest()
        {
            IOSElement numberOne = _driver.FindElementById("IntegerA");
            var        numberTwo = _driver.FindElementById("IntegerB");
            var        compute   = _driver.FindElementByName("ComputeSumButton");
            var        answer    = _driver.FindElementByName("Answer");

            numberOne.Clear();
            numberOne.SetImmediateValue("5");
            numberTwo.Clear();
            numberTwo.SetImmediateValue("6");
            compute.Click();

            Assert.AreEqual("11", answer.GetAttribute("value"));
        }
Пример #3
0
        public void TestShouldSendKetsToInputs()
        {
            IOSElement textField = driver.FindElementById("TextField1");

            Assert.Null(textField.GetAttribute("value"));

            textField.SendKeys("Hello World!");
            Assert.AreEqual("Hello World!", textField.GetAttribute("value"));
        }
Пример #4
0
        static void Main()
        {
            IOSDriver <IOSElement> driver;
            DesiredCapabilities    capability = DesiredCapabilities.IPhone();

            capability.SetCapability("browserstack.user", Environment.GetEnvironmentVariable("BROWSERSTACK_USERNAME"));
            capability.SetCapability("browserstack.key", Environment.GetEnvironmentVariable("BROWSERSTACK_ACCESS_KEY"));
            capability.SetCapability("build", "App Testing iOS");
            capability.SetCapability("name", "sample csharp");
            capability.SetCapability("browserstack.debug", true);
            capability.SetCapability("platform", "ios");
            capability.SetCapability("device", "iPhone 6S");
            capability.SetCapability("realMobile", true);
            capability.SetCapability("app", Environment.GetEnvironmentVariable("IOS_APP_URL"));

            driver = new IOSDriver <IOSElement>(
                new Uri("http://hub-cloud.browserstack.com/wd/hub/"), capability
                );

            ((ITakesScreenshot)driver).GetScreenshot();

            var contexts = driver.Contexts;

            IOSElement num1 = driver.FindElementById("IntegerA");
            IOSElement num2 = driver.FindElementById("IntegerB");

            num1.SendKeys("12");
            num2.SendKeys("32");

            IOSElement add_btn = driver.FindElementById("ComputeSumButton");

            add_btn.Tap(1, 1000);

            ((ITakesScreenshot)driver).GetScreenshot();
            IOSElement samplelabel = driver.FindElementById("Answer");

            Console.WriteLine(samplelabel.Text);

            driver.Quit();
        }
Пример #5
0
        public void ErrorFindElementByInvalidRuntimeId()
        {
            IOSElement element = session.FindElementById("InvalidRuntimeId");

            Assert.Fail("Exception should have been thrown");
        }
Пример #6
0
 public override IOSElement FindElement(IOSDriver <IOSElement> searchContext)
 {
     return(searchContext.FindElementById(Value));
 }