Пример #1
0
        public void swipeElement(AppiumWebElement elemento, double inicio, double fim)
        {
            int y = elemento.Location.Y + (elemento.Size.Height / 2);

            int start_x = (int)(elemento.Size.Width * inicio);
            int end_x   = (int)(elemento.Size.Width * fim);

            new TouchAction(DriverFactory.getDriver())
            .Press(start_x, y)
            .Wait(TimeSpan.FromMilliseconds(500).Milliseconds)
            .MoveTo(end_x, y)
            .Release()
            .Perform();
        }
Пример #2
0
        public void scroll(double inicio, double fim)
        {
            System.Drawing.Size size = DriverFactory.getDriver().Manage().Window.Size;

            int x = size.Width / 2;

            int start_y = (int)(size.Height * inicio);
            int end_y   = (int)(size.Height * fim);

            new TouchAction(DriverFactory.getDriver())
            .Press(x, start_y)
            .Wait(TimeSpan.FromMilliseconds(500).Milliseconds)
            .MoveTo(x, end_y)
            .Release()
            .Perform();
        }
Пример #3
0
        public bool existeElementoPorTexto(String texto)
        {
            IList <AppiumWebElement> elementos = DriverFactory.getDriver().FindElements(By.XPath("//*[@text='" + texto + "']"));

            return(elementos.Count() > 0);


            /*
             * IList<AppiumWebElement> elements = DriverFactory.getDriver().FindElementsByClassName("android.widget.TextView");
             * String[] retorno = new String[elements.Count()];
             *
             * for (int i = 0; i < elements.Count(); i++)
             * {
             *  retorno[i] = elements.ElementAt(i).ToString();
             *  //System.out.print("\""+retorno[i]+"\", ");
             * }
             *
             */


            //return true;
        }
Пример #4
0
 public void tearDown()
 {
     //gerarScreenShot();
     DriverFactory.getDriver().ResetApp();
 }
Пример #5
0
 public static void finalizaClasse()
 {
     DriverFactory.killDriver();
 }
Пример #6
0
 public void tap(int x, int y)
 {
     new TouchAction(DriverFactory.getDriver()).Tap(x, y).Perform();
 }
Пример #7
0
 public bool isCheckMarcado(By by)
 {
     return(DriverFactory.getDriver().FindElement(by).GetAttribute("checked").Equals("true"));
 }
Пример #8
0
 public void selecionarCombo(By by, String valor)
 {
     DriverFactory.getDriver().FindElement(by).Click();
     clicarTexto(valor);
 }
Пример #9
0
 public void clicar(By by)
 {
     DriverFactory.getDriver().FindElement(by).Click();
 }
Пример #10
0
 public String obterTexto(By by)
 {
     return(DriverFactory.getDriver().FindElement(by).Text);
 }
Пример #11
0
 public void escrever(By by, String texto)
 {
     DriverFactory.getDriver().FindElement(by).SendKeys(texto);
 }