'Appium-inspector[android] cannot load certain pages within the app

I am testing an android application on real device and i am not able to navigate to certain pages as Appium inspector just hangs and spinner is displayed on the screen which keeps loading endlessly.

I have followed following Steps:

  1. Open the app to the main homepage - Inspector works fine and loads the DOM
  2. Navigate to login page- Inspector loads the page fine and am able to inspect the elements.
  3. Enter username and password and tap on login button and proceed to landing screen -

Inspector cannot load the page & displays a spinner that keeps spinning and spinning and spinning. But when I tap on the phone the next screen is loaded on the inspector.I don't know why the landing page is not loading.

while running the test through TestNG -it cannot find the particular element(s), acting similarly to what inspector is doing.

Used Appium version: 1.6.1



Solution 1:[1]

If you have propagating screen in the app, appium desktop inspector will show the static screen. After the screen is switch in the mobile device, Click refresh button in the appium inspector and it will refresh the screen.

enter image description here

While testing in appium if the screen doesn't appear immediately, it will not find the element and throws element not find error. If your element doesn't appear immediately you can use the explicit wait until the element is visible.

public void ExplicitWait(MobileElement element, int timeOutInSeconds) {
    (new WebDriverWait(driver, timeOutInSeconds)).until(ExpectedConditions
            .visibilityOf(element));
} 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1