Search code examples
javaandroidappiumappium-androidbrowserstack

Clicking on absolute xpath is not working in Appium BrowserStack


When I try running in local it works but in BrowserStack its not working

MobileElement el = driver.findElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup[3]/android.widget.Button");
        el.click();

Exception is below enter image description here


Solution

  • Have you had the chance to specify the Appium version(same as your local set up) explicitly using the capability 'browserstack.appium_version' in your tests?

    Reference for the above capability can be found here: https://www.browserstack.com/app-automate/capabilities.