Appium Identify Web element even element is not displayed in Mobile screen for Amazon Hybrid Android app

Q1: I am trying to automate Amazon Hybrid App where identified the web element from Home screen which is not displayed in Mobile screen. So For that, I have scroll the screen down to up. But Appium is able to identify the web element even not displayed in the Mobile screen.
How is it possible in Mobile automation?

driver.find_element_by_xpath("//android.view.View[@content-desc = “ANY ELEMENT CONTENT”]")

Q2: Can we identify UI elements through UI Automater Viewer for Hybrid App (Native and Web element both)? Currently I am able to identify both using UI Automater Viewer. Pl confirm.

Appium: 1.6.4
Language: Python
SDK: 23
OS: Android

Pl help me to solve above problems and let me know, if any query.

@muditgupta87 well check element coordinates yourself :-). just a sample easier to understand


import io.appium.java_client.MobileBy;
import io.appium.java_client.MobileElement;
import org.openqa.selenium.WebElement;

        // Java
        int screenWidth = driver.manage().window().getSize().getWidth();
        int screenHeight = driver.manage().window().getSize().getHeight();
        MobileElement el = (MobileElement) driver.findElement(MobileBy.xpath("//android.view.View[@content-desc = “ANY ELEMENT CONTENT”]"));
        
        int elCenter_X = el.getCenter().getX();
        int elCenter_Y = el.getCenter().getY();
        
        if (elCenter_X > 0 && elCenter_X < screenWidth) {
            if (elCenter_Y > 0 && elCenter_Y < screenHeight) {
                // we are on screen :-)
            }
        }

@Aleksei Thanks for your reply.