Not able to click on bottom Menu using Appium

@Massi_mass i see in txt file NOT screen that you are talking about. This is not screen from your screenshot. Does test end BEFORE you actually reach screen you are talking about with red bar on bottom and images?

try to add sleep to check this:

       try {
            Thread.sleep(10000); // 10 sec sleep to wait...
        } catch (Exception e) {
            // ignore
        }
        // now try to find Account element
        List<WebElement> elements = driver.findElements(MobileBy.id("navigation_account")); // package name NOT needed
        System.out.println("elements size: " + elements.size());
        try {
            Thread.sleep(10000); // 10 sec sleep and try again to see something
        } catch (Exception e) {
            // ignore
        }
        elements = driver.findElements(MobileBy.id("navigation_account")); // package name NOT needed
        System.out.println("elements size: " + elements.size());
        if (!elements.isEmpty()) {
            MobileElement el = (MobileElement) elements.get(0);
            System.out.println("element x: " + el.getCenter().x + ", y: " + el.getCenter().y);
            TapOptions tapOptions = new TapOptions().withElement(ElementOption.element(el));
            new TouchAction(driver).tap(tapOptions).perform();
        }

Yes sir, both screen shots screens are same.

Also I try you code but it is not working.

Hello Sir,

Again I add txt file of my all code. Sorry sir for the trouble, I really need to solve this issue as soon as possible that’s why I ping you again and again. HomeScreenCode.txt (3.2 KB)

i cant help more sorry. looks like you are on wrong screen. try latest code again and share System.out.println(driver.getPageSource()); results at the end. If you will not see in output your “Account” text = this is not needed screen.

It’s okay sir,

but right now I am on Home screen and I have to go on Account screen.

Thank you for the help

make 100% sure you are on needed screen before System.out.println(driver.getPageSource()); will work

I try but it’s not working.

but thank you for the help.

can you show your updated code

Sure Sir,

but I am working on that application which developed in Kotlin and I made code in java.

1 Like