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();
        }
        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();
        }
        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;
        }
 public void tearDown()
 {
     //gerarScreenShot();
     DriverFactory.getDriver().ResetApp();
 }
 public static void finalizaClasse()
 {
     DriverFactory.killDriver();
 }
 public void tap(int x, int y)
 {
     new TouchAction(DriverFactory.getDriver()).Tap(x, y).Perform();
 }
 public bool isCheckMarcado(By by)
 {
     return(DriverFactory.getDriver().FindElement(by).GetAttribute("checked").Equals("true"));
 }
 public void selecionarCombo(By by, String valor)
 {
     DriverFactory.getDriver().FindElement(by).Click();
     clicarTexto(valor);
 }
 public void clicar(By by)
 {
     DriverFactory.getDriver().FindElement(by).Click();
 }
 public String obterTexto(By by)
 {
     return(DriverFactory.getDriver().FindElement(by).Text);
 }
 public void escrever(By by, String texto)
 {
     DriverFactory.getDriver().FindElement(by).SendKeys(texto);
 }