I’ve been testing Android 6 on emulators with Appium Server 1.5.3 for several months and my scripts have been very stable. On a test box, I upgraded to Appium 1.6.4 and the tests still run well on emulators running Android 6.0. However, when I try running the same scripts on an emulator configured with Android 7.1.1, many tests fail because the elements cannot be located. (TestNG message: “An element could not be located on the page using the given search parameters”). My config is:
Host machine: Windows 10
Appium 1.6.4 (Appium Desktop)
device: Android 7.1.1 emulator (Pixel)
TestNG: 6.9.10
Appium java client: 4.1.2
Below is what the Appium server log shows.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘search’ using ‘ID’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.myco:id/search]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=android:id/search]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=search]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION=search, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘search’ using ‘ID’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.myco:id/search]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=android:id/search]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=search]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION=search, INSTANCE=0]
[AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- POST /wd/hub/session/f737fe9c-446a-4837-b6e1-d98032b9901f/element 500 180903 ms - 164
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7,“value”:“No element found”}
My page object file looks like:
@FindBy(id=“search”)
public static WebElement cafeSearch;
Does anybody know if any changes need to be made to locators when upgrading to Android 7.x? If so, is there any code that works on both Android 6 and 7?