Appium problem - android buttons strange working

Hi everyone.
I have problem with testing my app which is intended for online shopping. I noticed that all buttons from aplication working but I have problem with system buttons(look at the picture). I’m using to recognize the button UiAutomatorViewer. At the picture I’m trying add product to cart but when I’m click button “Dodaj”(means Add) the window closes but there are any actions in application, the product should be added to cart. I tested this application manually and everythings work correct.
I tried to operate the button in many ways but still nothing. Does anyone know how to solve it? It’s very important functions to testing for me.

public class Product extends MainPage {

private AndroidDriver<AndroidElement> driver;

@FindBy(id = "com.mec.leroy:id/product_add_to_cart")
private WebElement addToCart;

@FindBy(xpath = "//android.widget.Button[@index='1']") //problem with button
private WebElement buttonAdd;

@FindBy(id = "com.mec.leroy:id/product_name")
private WebElement productName;

public Product(AndroidDriver driver) {
    super(driver);
    this.driver = driver;
}


public Product addProduct() throws InterruptedException {
    driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(text(\"do koszyka\"));");
    addToCart.click();
    buttonAdd.click();
    Thread.sleep(5000);
    return new Product(driver);
}

public boolean productName() throws InterruptedException {
    Thread.sleep(2000);
    try {
        productName.getText();
        return true;
    } catch (ElementNotVisibleException e) {
        return false;
    }
}

public class Connector {
public AndroidDriver Settings() throws IOException, InterruptedException {

    runAppium();
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "33004db396a6c2d1"); // nazwa urządzenia
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");

    capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "UiAutomator2");
    capabilities.setCapability("noRest", "true");
    capabilities.setCapability("fullReset", "false");

    // capabilities.setCapability("useKeystore", "true");
    //uruchomienie aplikacji z poziomu telefonu
    capabilities.setCapability("appPackage", "com.mec.leroy");
    capabilities.setCapability("appActivity", "com.mec.leroy.main.activity.MainActivity");

    //inicjalizacja połączenia z Appium Server

    AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
    return driver;

}

}

Hi @Dawid_Branicki

It’s kinda hard to tell what happens with the button and why it is not clicked. I mean, if I wanted to troubleshoot this I would need to have the app and view its source page. The code seems fine, maybe you will find more info in the logs.

I did think about two things that you might want to try:
Replace @FindBy with @AndroidFindBy

Try //android.widget.button[1] or //android.widget.button[@text='Dodaj']

Let me know if it helped.

Hi @Nivi_Mor
First of all, thank you for your answer.
Unfortunately it didn’t help. The button has been pressed and the window closed, that’s all. No reaction from the application, product hasn’t been added to cart. I can’t give you the app because I’m working for the company and it’s forbidden. If you wanna I can give you log from Appium. What is funny when I’m testing app manually the process of adding product to cart work perfectly. Problem is only with automatic test, but it’s very strange because the button “Dodaj” is pressed as you can see on the movie( link https://streamable.com/6ejdz), but the cart is still empty. Any ideas?

Have you tried doing that in debug to see if it works? The tap on the button is so quick, have you tried to place some extra delay, too see if it continues to fail?

@Telmo_Cardoso
I tried with long press duration 3s and still nothing. After pushing, dialog window is closed, just like in the movie above, but the product hasn’t been added to cart :frowning:

Hello

  1. Could you turn on Show touches and Pointer location on devices settings (this options are in Settings/Developer options). Start test and see what appium clicking
  2. Try to click this button by appium inspector and seens what happens

@CrashTestDummy

Ok, I tried add product to cart by appium inspector and it’s the same situation. I noticed that when I tried add manually when was connection with appium I couldn’t add product only after switching off appium I could do it. I copied some log from appium containing logs with adding product to cart.

[HTTP] <-- GET /wd/hub/sessions 200 8 ms - 909
[HTTP] --> POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/elements {“using”:“id”,“value”:“com.mec.leroy:id/product_add_to_cart”}
[MJSONWP] Calling AppiumDriver.findElements() with args: [“id”,“com.mec.leroy:id/product_add_to_cart”,“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.mec.leroy:id/product_add_to_cart”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.mec.leroy:id/product_add_to_cart”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘com.mec.leroy:id/product_add_to_cart’ using ‘ID’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[RESOURCE_ID=com.mec.leroy:id/product_add_to_cart]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[RESOURCE_ID=com.mec.leroy:id/product_add_to_cart]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=com.mec.leroy:id/product_add_to_cart]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (1)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=1, RESOURCE_ID=com.mec.leroy:id/product_add_to_cart]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:[{“ELEMENT”:“28”}]}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.findElements() result: [{“ELEMENT”:“28”}]
[HTTP] <-- POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/elements 200 88 ms - 90
[HTTP] --> POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/element/28/click {}
[MJSONWP] Calling AppiumDriver.click() with args: [“28”,“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“28”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“28”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/element/28/click 200 336 ms - 76
[HTTP] --> GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/source {}
[MJSONWP] Calling AppiumDriver.getPageSource() with args: [“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“source”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“source”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: source
[AndroidBootstrap] [UIAUTO STDOUT] [APPIUM-UIAUTO] [debug] Returning result: {“status”:0,“value”:"</android.widget.LinearLayout></android.widget.LinearLayout>
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] [UIAUTO STDOUT] ed=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[87,713][993,1334]" resource-id=“android:id/custom” instance=“4”></android.widget.RelativeLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.FrameLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.FrameLayout></android.widget.FrameLayout></hierarchy>"}[/APPIUM-UIAUTO]

[MJSONWP] Responding to client with driver.getPageSource() result: "
[HTTP] <-- GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/source 200 72 ms - 7374
[HTTP] --> GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/screenshot {}
[MJSONWP] Calling AppiumDriver.getScreenshot() with args: [“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[ADB] Device API level: 22
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\AndroidSDK\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“33004db396a6c2d1”,“shell”,“dumpsys”,“input”]
[MJSONWP] Responding to client with driver.getScreenshot() result: “iVBORw0KGgoAAAANSUhEUgAABDgAAAeACAYAAAArYecKAACAAElEQVR4AezBC1zUBaL//c/vNwMDg4goCoQSeQcMNSXNvJS3VLxknDRLK0wz0/Zsbe5rt9pyT1unTtvWpv2XtNV0163UTCs1M29taob3UryhpKgIxkXkMswwv+eZ1+uZ18Pfo+Vdxr7vtwFYiIiIiIiIiIgEMBMRERERERERkQBnIiIiIiIiIiIS4ExERERERERERAKciYiIiIiIiIhIgDMREREREREREQlwJiIiIiIiIiIiAc5ERERERERERCTAmYiIiIiIiIiIBDgTEREREREREZEAZyIiIiIiIiIiEuBMREREREREREQCnImIiIiIiIiISIAzEREREREREREJcCYiIiIiIiIiIgHOjoiIiIjIWYSEhJCYmEiLFi1o1qwZ0dHR1K9fn/DwcJxOJzabDafTiWmaVFRU4Ha7cblclJWVcfr0aQoKCjh69Cg5OTlkZ2dTUlKCiNRNTz/9NGFhYZxLeXk5f/7znxGpy+yIiIiIiPx/DMOgadOm9OzZk9tuu42GDRsSHh6Ow+HANE3Oxel04tekSRN8LMuiurqa8vJySkpK2L59O+vWrSM7Oxuv14uI1B3dunWjfv36nMupU6cQqevsiIiIiIj8vxo2bMjo0aPp168foaGhXCrDMHA4HDgcDho2bEjz5s0ZOnQo27ZtY86cOezbtw+v18sv2YgRI5g/fz4iInLp7IiIiIjINREcHEyjRo04fvw410pQUBDR0dH079+fe+65h5CQEM6lurqa06dP43K5qKqqwu12Y1kWlmVhGAZBQUEEBQUREhJCWFgYTqeTM9ntdlJTU+nQoQNr165l0aJFHDlyhKqqKn5JIiIiyMjI4JZbbmHBggVYloWIiFwaOyIiIiJy1cXExHDXXXdRv359pk2bxrUQERFBjx49SEtLo0WLFpimyZlqamo4evQoR44cIScnh9zcXAoKCigsLKSsrIzq6mp8TNMkPDycBg0a…
[HTTP] <-- GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/screenshot 200 3202 ms - 190282
[HTTP] --> POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/elements {“using”:“id”,“value”:“android:id/button1”}
[MJSONWP] Calling AppiumDriver.findElements() with args: [“id”,“android:id/button1”,“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“android:id/button1”,“context”:”",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“android:id/button1”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android:id/button1’ using ‘ID’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[RESOURCE_ID=android:id/button1]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[RESOURCE_ID=android:id/button1]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=android:id/button1]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (1)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=1, RESOURCE_ID=android:id/button1]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:[{“ELEMENT”:“29”}]}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.findElements() result: [{“ELEMENT”:“29”}]
[HTTP] <-- POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/elements 200 29 ms - 90
[HTTP] --> POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/element/29/click {}
[MJSONWP] Calling AppiumDriver.click() with args: [“29”,“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“29”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“29”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/element/29/click 200 3140 ms - 76
[HTTP] --> GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/source {}
[MJSONWP] Calling AppiumDriver.getPageSource() with args: [“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“source”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“source”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: source
[AndroidBootstrap] [UIAUTO STDOUT] [APPIUM-UIAUTO] [debug] Returning result: {“status”:0,“value”:"
[AndroidBootstrap] [UIAUTO STDOUT] ="[358,75][721,219]" resource-id="" instance=“0”></android.widget.FrameLayout></android.widget.LinearLayout></android.widget.RelativeLayout></android.widget.RelativeLayout></android.view.View></android.widget.FrameLayout>
[AndroidBootstrap] [UIAUTO STDOUT] usable=“false” focused=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[0,219][1080,1920]" resource-id=“com.mec.leroy:id/main_content” instance=“6”></android.widget.FrameLayout></android.widget.FrameLayout>
[AndroidBootstrap] [UIAUTO STDOUT] d=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[0,1299][1080,1443]" resource-id="" instance=“3”></android.widget.LinearLayout></android.widget.TabWidget></android.widget.HorizontalScrollView></android.widget.LinearLayout></android.widget.TabHost></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.FrameLayout>
[AndroidBootstrap] [UIAUTO STDOUT] “8”></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.RelativeLayout>
[AndroidBootstrap] [UIAUTO STDOUT] ckable=“false” checked=“false” clickable=“false” enabled=“true” focusable=“false” focused=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[507,1783][771,1844]" resource-id=“com.mec.leroy:id/product_big_price” instance=“3”/></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.ListView></android.widget.FrameLayout>
[AndroidBootstrap] [UIAUTO STDOUT] instance=“0”></android.widget.LinearLayout></android.support.v4.view.ViewPager></android.widget.FrameLayout></android.widget.FrameLayout></android.widget.RelativeLayout></android.widget.LinearLayout>
[AndroidBootstrap] [UIAUTO STDOUT] “true” focusable=“false” focused=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[72,773][376,826]" resource-id="" instance=“17”></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.LinearLayout>
[AndroidBootstrap] [UIAUTO STDOUT] package=“com.mec.leroy” content-desc="" checkable=“false” checked=“false” clickable=“false” enabled=“true” focusable=“false” focused=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[72,1070][817,1123]" resource-id=“com.mec.leroy:id/product_promotion_info” instance=“11”/></android.widget.LinearLayout></android.widget.LinearLayout>
[AndroidBootstrap] [UIAUTO STDOUT] “false” password=“false” selected=“false” bounds="[72,1277][397,1330]" resource-id="" instance=“17”/></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.RelativeLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.LinearLayout>
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] Stream still not complete, waiting
[AndroidBootstrap] [UIAUTO STDOUT] ndroid.widget.LinearLayout" package=“com.mec.leroy” content-desc="" checkable=“false” checked=“false” clickable=“false” enabled=“true” focusable=“false” focused=“false” scrollable=“false” long-clickable=“false” password=“false” selected=“false” bounds="[72,1621][1008,1833]" resource-id="" instance=“27”></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.LinearLayout></android.widget.LinearLayout></android.widget.FrameLayout></android.widget.FrameLayout></android.widget.ListView></android.widget.FrameLayout></android.widget.FrameLayout></android.widget.FrameLayout></android.widget.FrameLayout></android.view.View></android.widget.FrameLayout></android.view.View></android.widget.FrameLayout></hierarchy>"}[/APPIUM-UIAUTO]

[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] Stream still not complete, waiting
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] Stream still not complete, waiting
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] Stream still not complete, waiting
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] Stream still not complete, waiting
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getPageSource() result: "
[HTTP] <-- GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/source 200 180 ms - 43362
[HTTP] --> GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/screenshot {}
[MJSONWP] Calling AppiumDriver.getScreenshot() with args: [“7ad631a0-19ef-476e-a794-4e7d203086a3”]
[ADB] Device API level: 22
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\AndroidSDK\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“33004db396a6c2d1”,“shell”,“dumpsys”,“input”]
[MJSONWP] Responding to client with driver.getScreenshot() result: "iVBORw0KGgoAAAANSUhEUgAABDgAAAeACAYAAAArYecKAACAAElEQVR4AezBCXiUhaH37d/zzCSTTDYCgSQGYmQnwQBCBBFB2WRH5AiioIIgIthTrfRq1So9Vo8ea7WCbyNYEFqqAiKogIhsVkAMu0LYAhEChASyELJMMpnn++a6vuf68nJA2cng/74NwEJEREREREREJICZiIiIiIiIiIgEOBMRERERERERkQBnIiIiIiIiIiIS4ExERERERERERAKciYiIiIiIiIhIgDMREREREREREQlwJiIiIiIiIiIiAc5ERERERERERCTAmYiIiIiIiIiIBDgTEREREREREZEAZyIiIiIiIiIiEuBMREREREREREQCnImIiIiIiIiISIAzEREREREREREJcE5ERERERM4iJCSEVq1a0aRJExo1akRsbCyRkZFERETgdrtxOBy43W5M06SsrIyqqio8Hg8lJSWcPn2avLw8jhw5QlZWFpmZmRQVFSEitdMzzzxDWFgY51JaWsqf//xnRGozJyIiIiIi/x/DMGjYsCFdu3bltttuo27dukREROByuTBNk3Nxu93YGjRogJ9lWVRWVlJaWkpRURHbtm1j7dq1ZGZm4vP5EJHao3PnzkRGRnIup06dQqS2cyIiIiIi8v+qW7cuI0eOpFevXoSGhnKpDMPA5XLhcrmoW7cujRs3ZtCgQWzdupXZs2ezd+9efD4fv2TDhg1j3rx5iIjIpXMiIiIiItdEcHAw9erV49ixY1wrQUFBxMbG0rt3b+69915CQkI4l8rKSk6fPo3H46GiooKqqiosy8KyLAzDICgoiKCgIEJCQggLC8PtdnMmp9NJWloabdu2Zc2aNSxcuJDDhw9TUVHBL0lUVBSjR4/mlltuYf78+ViWhYiIXBonIiIiInLVxcXFcffddxMZGcnUqVO5FqKiorjjjjvo378/TZo0wTRNzlRdXc2RI0c4fPgwWVlZZGdnk5eXR35+PiUlJVRWVuJnmiYRERHUqVOH…
[HTTP] <-- GET /wd/hub/session/7ad631a0-19ef-476e-a794-4e7d203086a3/screenshot 200 3350 ms - 330298

1 Like

This look like appium clicks somewhere off window, or clicks buttona “Anuluj”. Try to slow down test execution before the appium clicks button “Dodaj”.

Still nothing :smirk: I have no ideas. Maybe I will try on virtual device?

can you try clicking on the coordinates (centre of the text Dodaj), looks like the new Activity Buttons are not recognised by the UIAutomator. In screen shot also the buttons are of previous screen.

@Venkatesh

I tried tap by coordinates and still the same effect. I noticed when I maximize Appium Inspector all buttons changed location, for example if I want click some button I have to press it down instead of the centre of the button. Look on the movie, strange appium behavior - > https://streamable.com/syijg

(new TouchAction(driver)).tap(761, 1412).perform()
(new TouchAction(driver)).tap(794, 1530).perform()
(new TouchAction(driver)).tap(756, 1395).perform()
(new TouchAction(driver)).tap(779, 1531).perform()
(new TouchAction(driver)).tap(772, 1394).perform()
MobileElement el2 = (MobileElement) driver.findElementById(“com.mec.leroy:id/product_add_to_cart”);
el2.click();
MobileElement el3 = (MobileElement) driver.findElementById(“android:id/button1”);
el3.click();
(new TouchAction(driver)).tap(787, 1512).perform()
(new TouchAction(driver)).tap(759, 1392).perform()
(new TouchAction(driver)).tap(772, 1525).perform()
(new TouchAction(driver)).tap(761, 1403).perform()
(new TouchAction(driver)).tap(768, 1525).perform()
MobileElement el4 = (MobileElement) driver.findElementById(“android:id/button1”);
el4.click();
MobileElement el5 = (MobileElement) driver.findElementById(“com.mec.leroy:id/product_add_to_cart”);
el5.click();
MobileElement el6 = (MobileElement) driver.findElementById(“android:id/button1”);
el6.click();
MobileElement el7 = (MobileElement) driver.findElementById(“com.mec.leroy:id/product_add_to_cart”);
el7.click();
MobileElement el8 = (MobileElement) driver.findElementById(“android:id/button1”);
el8.click();
(new TouchAction(driver)).tap(790, 1525).perform()
(new TouchAction(driver)).tap(752, 1395).perform()
(new TouchAction(driver)).tap(811, 1527).perform()
(new TouchAction(driver)).tap(766, 1397).perform()
MobileElement el9 = (MobileElement) driver.findElementById(“com.mec.leroy:id/product_add_to_cart”);
el9.click();
MobileElement el10 = (MobileElement) driver.findElementById(“android:id/button1”);
el10.click();
(new TouchAction(driver)).tap(790, 1525).perform()
(new TouchAction(driver)).tap(756, 1399).perform()
MobileElement el11 = (MobileElement) driver.findElementById(“com.mec.leroy:id/product_add_to_cart”);
el11.click();
MobileElement el12 = (MobileElement) driver.findElementById(“android:id/button1”);
el12.click();
MobileElement el13 = (MobileElement) driver.findElementById(“com.mec.leroy:id/product_add_to_cart”);
el13.click();
MobileElement el14 = (MobileElement) driver.findElementById(“android:id/button1”);
el14.click();
(new TouchAction(driver)).tap(575, 143).perform()
(new TouchAction(driver)).tap(740, 1418).perform()
(new TouchAction(driver)).tap(718, 1523).perform()
(new TouchAction(driver)).tap(714, 1314).perform()
(new TouchAction(driver)).tap(750, 1372).perform()

Hi,
I’m having a similar situation, as discussed in this thread. I have an Android app, and I can run appium to insert text in text boxes, but when appium clicks on a button, the code behind it doesn’t execute. The button gets tapped/clicked successfully but no action from the button is taken. Has anyone found a solution to this issue?