Unable to locate other elements after selecting value in Android Date Picker

enter image description hereenter image description hereWe are automating mobile app with Selenium, Apppium and Java.

In mobile app(Android), selected a date value from Calendar(popup) and clicked on SET button.

After this step, appium become unresponsive and unable to perform any other action and not showing any error message also. Manually when I perform a action on the app then the app and appium become responsive and the error showing as,

Returned value cannot be converted to WebElement: {stacktrace=NoSuchElementError: An element could not be located on the page using the given search parameters.

Date Picker class: android.widget.DatePicker

SET button class: android.widget.ScrollView

Shared app code snippet for reference.

Can some one please suggest how to resolve this.

1 answer

  • answered 2018-07-12 08:39 shiv

    There is an open issue with appium: After dismissing the alert, appium is no longer detecting any of the fields.

    Workarounds :

    1. You can put app in the background and launch again. driver.runAppInBackground(5);

    2. Get coordinates (x, y) of any element on screen before opening dialog interact with dialog (e.g. select elements, close etc.) tap by coordinates (x, y) after closing dialog: new TouchAction(driver).tap(x, y).perform();