Verify Image is present or not in Appium with C#

 public void VerifyImagePresentOrNot()
        {
            IWebElement ImageFile = driver.FindElementByXPath("//*[@class ='android.widget.Image' and @index= '0']");
            Boolean ImagePresent = (Boolean)((IJavaScriptExecutor)driver).ExecuteScript("return arguments[0].complete && typeof arguments[0].naturalWidth != \"undefined\" && arguments[0].naturalWidth > 0", ImageFile);
            if (!ImagePresent)
        {
           Console.Write("Image not displayed.");
           Console.ReadLine();
        }
        else
        {
            Console.Write("Image displayed.");
            Console.ReadLine();
        }
        }

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