Hi, im currently working on a project (android native) that requires a dropdown to select a customer id type.
The dropdown items are according to the sourcecode:
public void setOptions(@NonNull List<SelectableOption<T>> options) {
this.options = options;
List<String> strOpts = options.stream()
.map(opt -> getContext().getString(opt.getStringResource()))
.collect(Collectors.toList());
autoCompleteTextView.setAdapter(new ArrayAdapter<>(getContext(), R.layout.dropdown_item, strOpts));
And the layout:
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=“http://schemas.android.com/apk/res/android”
android:id="@android:id/text1"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:padding=“16dp”
android:ellipsize=“end”
android:maxLines=“1”
android:textAppearance="?attr/textAppearanceSubtitle1"
/>
The issue is that even with the id assigned (android:id/text1) i cant find it using appium via appium desktop or with code(python) or with android monitor/uiautomatorviewer
I have tried:
- driver.find_element_by_id(“android:id/text1”)
- driver.find_element_by_android_uiautomator(‘new UiScrollable(new UiSelector()).scrollIntoView(" + “new UiSelector().text(”" + CUIL + “”));"’)
- driver.find_element_by_android_uiautomator(‘new UiSelector().text("" + CUIL + “”));’)
- xpath with //*[contains(@text, ‘CUIL’)]
Any ideas? Or there is anything that the dev team can change so it appears on the app source/hierarchy?
Thanks