How to zoom a particular element in apps by using C# Appium ?

using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Appium.Interfaces;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Remote;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace demoProjects
{
    public class Zoom
    {


        public static void Main(string[] args)
        {

            AppiumDriver<AndroidElement> driver;
            string app = "C:\\Users\\105798\\testapplications\\bigbasket_com.bigbasket.mobileapp.apk";

            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.SetCapability("deviceName", "emulator-5554");
            capabilities.SetCapability(CapabilityType.Version, "6.0");
            capabilities.SetCapability(CapabilityType.BrowserName, "Android");
            capabilities.SetCapability(CapabilityType.Platform, "Android");
            capabilities.SetCapability("appPackage", "com.bigbasket.mobileapp");
            capabilities.SetCapability("appActivity", "com.bigbasket.mobileapp.activity.SplashActivity");

            capabilities.SetCapability("NEW_COMAND_TIMEOUT", "50000");
            capabilities.SetCapability("app", "C:\\Users\\105798\\testapplications\\bigbasket_com.bigbasket.mobileapp.apk");

           driver = new AndroidDriver<AndroidElement>(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
            Thread.Sleep(10000);
             driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            driver.FindElementById("com.bigbasket.mobileapp:id/btn_login").Click();
            driver.FindElementById("com.bigbasket.mobileapp:id/email_input").SendKeys("healthyfi787@gmail.com");
            driver.FindElementById("com.bigbasket.mobileapp:id/edit_text_passwd").SendKeys("787healthyfi");
             driver.Navigate().Back();
            driver.FindElementById("com.bigbasket.mobileapp:id/btn_login").Click();
          Thread.Sleep(10000);
            driver.FindElementById("com.bigbasket.mobileapp:id/action_search").Click();
            driver.FindElementById("com.bigbasket.mobileapp:id/searchView").SendKeys("Onion" + "\t");
            Thread.Sleep(5000);
            driver.FindElementByXPath("//*[@resource-id = 'com.bigbasket.mobileapp:id/txtTerm' and @text= 'onion']").Click();
            driver.FindElementById("com.bigbasket.mobileapp:id/imgProduct").Click();
            driver.FindElementById("com.bigbasket.mobileapp:id/daimajia_slider_image").Click();
            Thread.Sleep(5000);
            IWebElement zoomele = driver.FindElementByXPath("//*[@resource-id = 'com.bigbasket.mobileapp:id/zoomImageView' and @index= '3'] ");
            driver.Zoom(zoomele);
            Thread.Sleep(5000);
            driver.Pinch(zoomele);
            Thread.Sleep(5000);
       
         
          }
       
       
        }
}

Copyright © 2017 qatoolsguide.blogspot.com || ALL RIGHTS RESERVED