appium / appium-uiautomator2-server

Appium UiAutomator/UiObject2-based server for Android UI automation. This module is used by appium-uiautomator2-driver component
Apache License 2.0
328 stars 232 forks source link

Unable to send text to edit text element by accessibility ID from Jetpack compose #577

Open stowy opened 10 months ago

stowy commented 10 months ago

I set the accessibility of a text field as follows:

                    OutlineTextField(
                        value = email,
                        onValueChange = viewModel::onEmailChange,
                        keyboardOptions = KeyboardOptions(
                            keyboardType = KeyboardType.Email,
                            imeAction = ImeAction.Next
                        ),
                        modifier = Modifier
                            .fillMaxWidth()
                            .focusRequester(focusRequester)
                            .semantics(mergeDescendants = true) {
                                testTag = "email";
                                testTagsAsResourceId = true},
                    )

It says the element cannot have the value set, eg see attached screenshot

Screenshot 2023-12-04 at 4 55 04 pm

If you click on the edit text above and send it passes the text

I'm using the robot library to send the input text which find field by accessibility Id.

KazuCocoa commented 10 months ago

I wondered if the "EditText" should have been selected. Or alternatively, https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-type may work after clicking the element